{"openapi":"3.0.3","info":{"title":"call2all API","version":"1.0.0","description":"AI phone agents, numbers, contacts, campaigns and Prepaid Balance. Conventions: docs/API.md."},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer"}},"schemas":{}},"paths":{"/v1/health":{"get":{"tags":["system"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}}}}},"/v1/prices":{"get":{"summary":"Current price list and recharge tiers (public)","tags":["catalog"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string"},"gst_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billing_block_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minimum_recharge":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tiers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"min_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","label","min_value","discount_bp"],"additionalProperties":false}},"per_minute":{"type":"object","properties":{"base":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"included_prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"badge":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"standard":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"fast":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"long_instructions_per_1k":{"type":"object","properties":{"standard":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"fast":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["standard","fast"],"additionalProperties":false}},"required":["id","label","badge","description","default","standard","fast","long_instructions_per_1k"],"additionalProperties":false}},"voice":{"type":"object","properties":{"standard":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"premium":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"natural":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["standard","premium","natural"],"additionalProperties":false},"messages":{"type":"object","properties":{"recorded":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tts":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tts_premium_voice":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["recorded","tts","tts_premium_voice"],"additionalProperties":false},"forwarding":{"type":"object","properties":{"per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"transcription":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["per_min","transcription"],"additionalProperties":false}},"required":["base","included_prompt_tokens","models","voice","messages","forwarding"],"additionalProperties":false},"monthly":{"type":"object","properties":{"number":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"extra_line":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["number","extra_line"],"additionalProperties":false}},"required":["currency","gst_bp","billing_block_seconds","minimum_recharge","tiers","per_minute","monthly"],"additionalProperties":false}}}}}}},"/v1/auth/signup":{"post":{"tags":["auth (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"company":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":10,"maxLength":200},"accept_terms":{"type":"boolean","enum":[true]}},"required":["name","company","email","password","accept_terms"]}}}},"security":[],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"email_verified":{"type":"boolean"}},"required":["id","email","name","role","email_verified"],"additionalProperties":false},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false}},"required":["user","account"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/login":{"post":{"tags":["auth (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200}},"required":["email","password"]}}}},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"email_verified":{"type":"boolean"}},"required":["id","email","name","role","email_verified"],"additionalProperties":false},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false}},"required":["user","account"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/logout":{"post":{"tags":["auth (dashboard)"],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/me":{"get":{"tags":["auth (dashboard)"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"email_verified":{"type":"boolean"}},"required":["id","email","name","role","email_verified"],"additionalProperties":false},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false}},"required":["user","account"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/verify-email":{"post":{"tags":["auth (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":10,"maxLength":200}},"required":["token"]}}}},"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"email_verified":{"type":"boolean"}},"required":["id","email","name","role","email_verified"],"additionalProperties":false}},"required":["user"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/resend-verification":{"post":{"tags":["auth (dashboard)"],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/forgot-password":{"post":{"tags":["auth (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]}}}},"security":[],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/reset-password":{"post":{"tags":["auth (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":10,"maxLength":200},"password":{"type":"string","minLength":10,"maxLength":200}},"required":["token","password"]}}}},"security":[],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/account":{"get":{"tags":["account"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"legal_name":{"nullable":true,"type":"string"},"gstin":{"nullable":true,"type":"string"},"state_code":{"nullable":true,"type":"string"},"billing_address":{"nullable":true,"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","minLength":1,"maxLength":100},"pincode":{"type":"string","pattern":"^[1-9]\\d{5}$"}},"required":["line1","city","pincode"],"additionalProperties":false},"billing_ready":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","name","status","legal_name","gstin","state_code","billing_address","billing_ready","created_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update the account name and billing details (dashboard; owner or admin)","tags":["account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"legal_name":{"type":"string","minLength":2,"maxLength":200},"gstin":{"nullable":true,"type":"string"},"state_code":{"type":"string"},"billing_address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","minLength":1,"maxLength":100},"pincode":{"type":"string","pattern":"^[1-9]\\d{5}$"}},"required":["line1","city","pincode"]}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"legal_name":{"nullable":true,"type":"string"},"gstin":{"nullable":true,"type":"string"},"state_code":{"nullable":true,"type":"string"},"billing_address":{"nullable":true,"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","minLength":1,"maxLength":100},"pincode":{"type":"string","pattern":"^[1-9]\\d{5}$"}},"required":["line1","city","pincode"],"additionalProperties":false},"billing_ready":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","name","status","legal_name","gstin","state_code","billing_address","billing_ready","created_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog/gst-states":{"get":{"tags":["catalog"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}}}}},"/v1/balance":{"get":{"summary":"Prepaid Balance","tags":["billing"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"debt":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"lots":{"type":"array","items":{"type":"object","properties":{"tier":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["tier","discount_bp","remaining"],"additionalProperties":false}},"can_spend":{"type":"boolean"}},"required":["balance","debt","lots","can_spend"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/ledger":{"get":{"summary":"Statement: every change to the Prepaid Balance, newest first","tags":["billing"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["recharge","usage","fixed","adjustment_credit","adjustment_debit","debt","debt_settle"]},"in":"query","name":"kind","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"list":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount_bp":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"settled":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"lot_id":{"nullable":true,"type":"string"},"lot_tier":{"nullable":true,"type":"string"},"reference":{"nullable":true,"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":false},"description":{"type":"string"},"balance_after":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"created_at":{"type":"string"}},"required":["id","kind","amount","list","discount","discount_bp","settled","lot_id","lot_tier","reference","description","balance_after","created_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/lots":{"get":{"summary":"Recharge lots and what each has left, newest first","tags":["billing"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"original":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"remaining":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"recharge_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","tier","discount_bp","original","remaining","recharge_id","created_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/api-keys":{"get":{"tags":["api keys (dashboard)"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"last_used_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","name","prefix","scopes","last_used_at","created_at"],"additionalProperties":false}},"scopes":{"type":"array","items":{"type":"string"}}},"required":["data","scopes"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"tags":["api keys (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"scopes":{"minItems":1,"maxItems":18,"type":"array","items":{"type":"string","enum":["account:read","billing:read","agents:read","agents:write","numbers:read","numbers:write","contacts:read","contacts:write","calls:read","calls:write","campaigns:read","campaigns:write","triggers:read","triggers:write","webhooks:read","webhooks:write","settings:read","settings:write"]}}},"required":["name","scopes"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"last_used_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"key":{"type":"string"}},"required":["id","name","prefix","scopes","last_used_at","created_at","key"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/api-keys/{id}":{"delete":{"tags":["api keys (dashboard)"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recharges/terms":{"get":{"summary":"The non-refundable acknowledgement shown before every recharge","tags":["billing"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"}},"required":["version","text"],"additionalProperties":false}}}}}}},"/v1/recharges/quote":{"post":{"summary":"GST and tier for a recharge value (dashboard)","tags":["billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value_paise":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991}},"required":["value_paise"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"gst":{"type":"object","properties":{"cgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"sgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"igst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["cgst","sgst","igst","total"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tier":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","label","discount_bp"],"additionalProperties":false},"next_tier":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"min_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["id","label","discount_bp","min_value"],"additionalProperties":false}},"required":["value","gst","total","tier","next_tier"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recharges":{"post":{"summary":"Start a recharge: creates the payment order (dashboard; owner or admin)","tags":["billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value_paise":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991},"acknowledgement":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"version":{"type":"string","maxLength":40}},"required":["accepted","version"]}},"required":["value_paise","acknowledgement"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recharge":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"gst":{"type":"object","properties":{"cgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"sgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"igst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["cgst","sgst","igst","total"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tier":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoice_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"paid_at":{"nullable":true,"type":"string"},"autopay":{"nullable":true,"description":"Auto-recharge details; null for checkout and offline recharges","type":"object","properties":{"mandate_id":{"nullable":true,"type":"string"},"state":{"type":"string","enum":["requesting","pending","paid","failed"],"description":"pending = the bank has the debit request; UPI and card debits land 1–3 days later"},"requested_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"}},"required":["mandate_id","state","requested_at","failure_reason"],"additionalProperties":false}},"required":["id","status","source","value","gst","total","tier","discount_bp","invoice_id","created_at","paid_at","autopay"],"additionalProperties":false},"checkout":{"type":"object","properties":{"key_id":{"type":"string"},"order_id":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["key_id","order_id","amount","currency","name","description"],"additionalProperties":false}},"required":["recharge","checkout"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"get":{"tags":["billing"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"gst":{"type":"object","properties":{"cgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"sgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"igst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["cgst","sgst","igst","total"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tier":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoice_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"paid_at":{"nullable":true,"type":"string"},"autopay":{"nullable":true,"description":"Auto-recharge details; null for checkout and offline recharges","type":"object","properties":{"mandate_id":{"nullable":true,"type":"string"},"state":{"type":"string","enum":["requesting","pending","paid","failed"],"description":"pending = the bank has the debit request; UPI and card debits land 1–3 days later"},"requested_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"}},"required":["mandate_id","state","requested_at","failure_reason"],"additionalProperties":false}},"required":["id","status","source","value","gst","total","tier","discount_bp","invoice_id","created_at","paid_at","autopay"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recharges/verify":{"post":{"summary":"Confirm a Checkout payment (dashboard)","tags":["billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"razorpay_order_id":{"type":"string","maxLength":60},"razorpay_payment_id":{"type":"string","maxLength":60},"razorpay_signature":{"type":"string","maxLength":200}},"required":["razorpay_order_id","razorpay_payment_id","razorpay_signature"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recharge":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"gst":{"type":"object","properties":{"cgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"sgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"igst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["cgst","sgst","igst","total"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tier":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoice_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"paid_at":{"nullable":true,"type":"string"},"autopay":{"nullable":true,"description":"Auto-recharge details; null for checkout and offline recharges","type":"object","properties":{"mandate_id":{"nullable":true,"type":"string"},"state":{"type":"string","enum":["requesting","pending","paid","failed"],"description":"pending = the bank has the debit request; UPI and card debits land 1–3 days later"},"requested_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"}},"required":["mandate_id","state","requested_at","failure_reason"],"additionalProperties":false}},"required":["id","status","source","value","gst","total","tier","discount_bp","invoice_id","created_at","paid_at","autopay"],"additionalProperties":false}},"required":["recharge"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recharges/{id}":{"get":{"tags":["billing"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"gst":{"type":"object","properties":{"cgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"sgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"igst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["cgst","sgst","igst","total"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"tier":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoice_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"paid_at":{"nullable":true,"type":"string"},"autopay":{"nullable":true,"description":"Auto-recharge details; null for checkout and offline recharges","type":"object","properties":{"mandate_id":{"nullable":true,"type":"string"},"state":{"type":"string","enum":["requesting","pending","paid","failed"],"description":"pending = the bank has the debit request; UPI and card debits land 1–3 days later"},"requested_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"}},"required":["mandate_id","state","requested_at","failure_reason"],"additionalProperties":false}},"required":["id","status","source","value","gst","total","tier","discount_bp","invoice_id","created_at","paid_at","autopay"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices":{"get":{"tags":["billing"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"recharge_id":{"type":"string"},"issued_at":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"cgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"sgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"igst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"place_of_supply":{"type":"string"}},"required":["id","number","recharge_id","issued_at","value","cgst","sgst","igst","total","place_of_supply"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}.pdf":{"get":{"summary":"One GST tax invoice as a PDF","tags":["billing"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"The GST tax invoice (A4 PDF)","content":{"application/pdf":{"schema":{"type":"string","description":"PDF file (binary)"}}}},"400":{"description":"Default Response","content":{"application/pdf":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/pdf":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/pdf":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/pdf":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/pdf":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/pdf":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/pdf":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}":{"get":{"summary":"One GST invoice with seller and buyer details","tags":["billing"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"recharge_id":{"type":"string"},"issued_at":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"cgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"sgst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"igst":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"place_of_supply":{"type":"string"},"place_of_supply_name":{"nullable":true,"type":"string"},"supply_type":{"type":"string","enum":["intra_state","inter_state"]},"line_description":{"type":"string"},"seller":{"type":"object","properties":{"legal_name":{"type":"string"},"gstin":{"type":"string"},"state_code":{"type":"string"},"state_name":{"nullable":true,"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"pincode":{"type":"string"}},"required":["line1","city","pincode"],"additionalProperties":false},"sac_code":{"type":"string"}},"required":["legal_name","gstin","state_code","state_name","address","sac_code"],"additionalProperties":false},"buyer":{"type":"object","properties":{"legal_name":{"nullable":true,"type":"string"},"gstin":{"nullable":true,"type":"string"},"state_code":{"nullable":true,"type":"string"},"state_name":{"nullable":true,"type":"string"},"address":{"nullable":true,"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"pincode":{"type":"string"}},"required":["line1","city","pincode"],"additionalProperties":false}},"required":["legal_name","gstin","state_code","state_name","address"],"additionalProperties":false}},"required":["id","number","recharge_id","issued_at","value","cgst","sgst","igst","total","place_of_supply","place_of_supply_name","supply_type","line_description","seller","buyer"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contacts":{"get":{"summary":"List contacts (search and filters; newest first)","tags":["contacts"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"list_id","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"tag","required":false},{"schema":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"in":"query","name":"source","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"dnc","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string","description":"E.164, e.g. +919876543210"},"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"list_ids":{"type":"array","items":{"type":"string"}},"dnc":{"type":"boolean","description":"True when the number is on the account's do-not-call list"},"first_source":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"first_seen_at":{"type":"string"},"last_inbound_at":{"nullable":true,"type":"string"},"last_outbound_at":{"nullable":true,"type":"string"},"last_call_at":{"nullable":true,"type":"string"},"inbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_outcome":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","name","email","attributes","tags","list_ids","dnc","first_source","first_seen_at","last_inbound_at","last_outbound_at","last_call_at","inbound_count","outbound_count","last_outcome","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a contact (409 contact_exists if the number already has one)","tags":["contacts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"nullable":true,"type":"string","maxLength":120},"email":{"nullable":true,"type":"string","maxLength":254},"attributes":{"type":"object","additionalProperties":{}},"tags":{"type":"array","items":{"type":"string"}},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"phone":{"type":"string","minLength":1,"maxLength":32},"list_ids":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":40}}},"required":["phone"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string","description":"E.164, e.g. +919876543210"},"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"list_ids":{"type":"array","items":{"type":"string"}},"dnc":{"type":"boolean","description":"True when the number is on the account's do-not-call list"},"first_source":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"first_seen_at":{"type":"string"},"last_inbound_at":{"nullable":true,"type":"string"},"last_outbound_at":{"nullable":true,"type":"string"},"last_call_at":{"nullable":true,"type":"string"},"inbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_outcome":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","name","email","attributes","tags","list_ids","dnc","first_source","first_seen_at","last_inbound_at","last_outbound_at","last_call_at","inbound_count","outbound_count","last_outcome","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contacts/bulk":{"post":{"summary":"Create or update up to 1,000 contacts by phone (per-item results)","tags":["contacts"],"description":"Each item takes the same fields as POST /contacts. A number that already has a contact is merged (on_existing=update, never emptying a stored value) or left alone (skip). Invalid items and repeats of a number earlier in the request are reported, never stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","additionalProperties":{}}},"list_id":{"type":"string","maxLength":40},"tags":{"description":"Added to every contact in this request.","type":"array","items":{"type":"string"}},"on_existing":{"default":"update","type":"string","enum":["update","skip"]}},"required":["contacts"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["created","updated","skipped","invalid","duplicate"]},"id":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"duplicate_of":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}},"required":["code","message"],"additionalProperties":false}},"required":["index","status","id","phone"],"additionalProperties":false}},"totals":{"type":"object","properties":{"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["received","created","updated","skipped","duplicates","invalid"],"additionalProperties":false}},"required":["results","totals"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contacts/export":{"get":{"summary":"Download contacts as CSV (same filters as GET /contacts)","tags":["contacts"],"description":"text/csv, UTF-8 with a byte-order mark, newest first. Attribute keys become extra columns.","parameters":[{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"list_id","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"tag","required":false},{"schema":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"in":"query","name":"source","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"dnc","required":false}],"responses":{"200":{"description":"CSV text","content":{"text/csv":{"schema":{"type":"string","description":"CSV text"}}}},"400":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contacts/by-phone/{phone}":{"get":{"summary":"Find the contact for a phone number (any Indian format)","tags":["contacts"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"phone","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string","description":"E.164, e.g. +919876543210"},"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"list_ids":{"type":"array","items":{"type":"string"}},"dnc":{"type":"boolean","description":"True when the number is on the account's do-not-call list"},"first_source":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"first_seen_at":{"type":"string"},"last_inbound_at":{"nullable":true,"type":"string"},"last_outbound_at":{"nullable":true,"type":"string"},"last_call_at":{"nullable":true,"type":"string"},"inbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_outcome":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","name","email","attributes","tags","list_ids","dnc","first_source","first_seen_at","last_inbound_at","last_outbound_at","last_call_at","inbound_count","outbound_count","last_outcome","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contacts/{id}":{"get":{"summary":"One contact","tags":["contacts"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string","description":"E.164, e.g. +919876543210"},"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"list_ids":{"type":"array","items":{"type":"string"}},"dnc":{"type":"boolean","description":"True when the number is on the account's do-not-call list"},"first_source":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"first_seen_at":{"type":"string"},"last_inbound_at":{"nullable":true,"type":"string"},"last_outbound_at":{"nullable":true,"type":"string"},"last_call_at":{"nullable":true,"type":"string"},"inbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_outcome":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","name","email","attributes","tags","list_ids","dnc","first_source","first_seen_at","last_inbound_at","last_outbound_at","last_call_at","inbound_count","outbound_count","last_outcome","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a contact (attributes and metadata are merged; tags are replaced)","tags":["contacts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"description":"Not changeable: a contact IS its phone number. Add a new contact instead."},"name":{"nullable":true,"type":"string","maxLength":120},"email":{"nullable":true,"type":"string","maxLength":254},"attributes":{"description":"Merged key by key; a key set to null is removed.","type":"object","additionalProperties":{}},"tags":{"description":"Replaces the contact's tags.","type":"array","items":{"type":"string"}},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"description":"Merged key by key; a key set to null is removed.","type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}}}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string","description":"E.164, e.g. +919876543210"},"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"list_ids":{"type":"array","items":{"type":"string"}},"dnc":{"type":"boolean","description":"True when the number is on the account's do-not-call list"},"first_source":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"first_seen_at":{"type":"string"},"last_inbound_at":{"nullable":true,"type":"string"},"last_outbound_at":{"nullable":true,"type":"string"},"last_call_at":{"nullable":true,"type":"string"},"inbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_outcome":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","name","email","attributes","tags","list_ids","dnc","first_source","first_seen_at","last_inbound_at","last_outbound_at","last_call_at","inbound_count","outbound_count","last_outcome","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a contact","tags":["contacts"],"description":"Erases the contact's name, email, attributes, tags, external_ref, metadata and list memberships. Past calls keep their link. Adding the same number again later brings back the same contact id with fresh details. The do-not-call list is not changed.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contact-fields":{"get":{"summary":"The account's custom contact fields, in display order","tags":["contacts"],"description":"The fields this account keeps on its contacts. Each one declares a `contacts.attributes` key, so the values are read and written as `attributes.<key>` on every contact endpoint. A key no field declares is still accepted.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The contacts.attributes key this field declares, e.g. appointment_at"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","yes_no","choice","date","date_time"]},"options":{"type":"array","items":{"type":"string"},"description":"The allowed values of a choice field, in order (empty for every other type)"},"help":{"nullable":true,"type":"string"},"required":{"type":"boolean","description":"Required in the dashboard's Add/Edit contact form. Calls, imports and the API can still create a contact without it."},"in_table":{"type":"boolean","description":"Shown as a column in the contacts table"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","label","type","options","help","required","in_table","position","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":"string","nullable":true,"enum":[null]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add a custom contact field","tags":["contacts"],"description":"The name (key) is where the value is stored on every contact. A date field's name must end in \"_date\" and a date-and-time field's in \"_at\", because that is how dates are recognised everywhere else. Leave `key` out and it is made from the label.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"key":{"description":"Defaults to the label, e.g. “Appointment time” → appointment_time.","type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"default":"text","type":"string","enum":["text","number","yes_no","choice","date","date_time"]},"options":{"description":"Required for type choice.","maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"help":{"nullable":true,"type":"string","maxLength":200},"required":{"type":"boolean"},"in_table":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":999}},"required":["label"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The contacts.attributes key this field declares, e.g. appointment_at"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","yes_no","choice","date","date_time"]},"options":{"type":"array","items":{"type":"string"},"description":"The allowed values of a choice field, in order (empty for every other type)"},"help":{"nullable":true,"type":"string"},"required":{"type":"boolean","description":"Required in the dashboard's Add/Edit contact form. Calls, imports and the API can still create a contact without it."},"in_table":{"type":"boolean","description":"Shown as a column in the contacts table"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","label","type","options","help","required","in_table","position","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contact-fields/undeclared":{"get":{"summary":"Attribute keys found on contacts that no field declares yet","tags":["contacts"],"description":"Keys that imports, calls or the API have stored, so they can be added to the master list in one step. Most-used first.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sample":{"nullable":true,"type":"string"}},"required":["key","contacts","sample"],"additionalProperties":false}},"next_cursor":{"type":"string","nullable":true,"enum":[null]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contact-fields/{id}":{"get":{"summary":"One custom contact field","tags":["contacts"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The contacts.attributes key this field declares, e.g. appointment_at"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","yes_no","choice","date","date_time"]},"options":{"type":"array","items":{"type":"string"},"description":"The allowed values of a choice field, in order (empty for every other type)"},"help":{"nullable":true,"type":"string"},"required":{"type":"boolean","description":"Required in the dashboard's Add/Edit contact form. Calls, imports and the API can still create a contact without it."},"in_table":{"type":"boolean","description":"Shown as a column in the contacts table"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","label","type","options","help","required","in_table","position","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change a custom contact field (its key never changes)","tags":["contacts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"key":{"description":"Not changeable: the key is where the values are stored. Add a new field instead."},"type":{"description":"Only between types that keep the same key suffix.","type":"string","enum":["text","number","yes_no","choice","date","date_time"]},"options":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"help":{"nullable":true,"type":"string","maxLength":200},"required":{"type":"boolean"},"in_table":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":999}}}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The contacts.attributes key this field declares, e.g. appointment_at"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","yes_no","choice","date","date_time"]},"options":{"type":"array","items":{"type":"string"},"description":"The allowed values of a choice field, in order (empty for every other type)"},"help":{"nullable":true,"type":"string"},"required":{"type":"boolean","description":"Required in the dashboard's Add/Edit contact form. Calls, imports and the API can still create a contact without it."},"in_table":{"type":"boolean","description":"Shown as a column in the contacts table"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","label","type","options","help","required","in_table","position","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a custom contact field (the values on your contacts are kept)","tags":["contacts"],"description":"The field stops being shown and offered. Every value already stored under its key stays on the contact and is still exported, still readable as {{contact.<key>}}, and still shown under “Other fields”.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contact-fields/order":{"post":{"summary":"Set the order the fields are shown in","tags":["contacts"],"description":"Send every field id in the order you want. Any field left out keeps its place after the ones you sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","maxLength":40}}},"required":["ids"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","description":"The contacts.attributes key this field declares, e.g. appointment_at"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","yes_no","choice","date","date_time"]},"options":{"type":"array","items":{"type":"string"},"description":"The allowed values of a choice field, in order (empty for every other type)"},"help":{"nullable":true,"type":"string"},"required":{"type":"boolean","description":"Required in the dashboard's Add/Edit contact form. Calls, imports and the API can still create a contact without it."},"in_table":{"type":"boolean","description":"Shown as a column in the contacts table"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","key","label","type","options","help","required","in_table","position","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"type":"string","nullable":true,"enum":[null]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/lists":{"get":{"summary":"List contact lists (newest first)","tags":["lists"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":80},"in":"query","name":"q","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","member_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a list","tags":["lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"nullable":true,"type":"string","maxLength":500},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"required":["name"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","member_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/lists/{id}":{"get":{"summary":"One list with its member count","tags":["lists"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","member_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Rename or describe a list","tags":["lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"nullable":true,"type":"string","maxLength":500},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"description":"Merged key by key; a key set to null is removed.","type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}}}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","member_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a list (its contacts stay)","tags":["lists"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/lists/{id}/members":{"get":{"summary":"Contacts in a list (newest first; same search as GET /contacts)","tags":["lists"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"q","required":false},{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string","description":"E.164, e.g. +919876543210"},"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"list_ids":{"type":"array","items":{"type":"string"}},"dnc":{"type":"boolean","description":"True when the number is on the account's do-not-call list"},"first_source":{"type":"string","enum":["import","inbound","outbound","api","webhook","manual"]},"first_seen_at":{"type":"string"},"last_inbound_at":{"nullable":true,"type":"string"},"last_outbound_at":{"nullable":true,"type":"string"},"last_call_at":{"nullable":true,"type":"string"},"inbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"outbound_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_outcome":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","name","email","attributes","tags","list_ids","dnc","first_source","first_seen_at","last_inbound_at","last_outbound_at","last_call_at","inbound_count","outbound_count","last_outcome","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add contacts to a list by id and/or phone (a phone with no contact gets one)","tags":["lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_ids":{"maxItems":1000,"type":"array","items":{"type":"string","maxLength":40}},"phones":{"maxItems":1000,"type":"array","items":{"type":"string","maxLength":40}}}}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"already":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"not_found":{"type":"array","items":{"type":"string"}},"invalid":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value":{"type":"string"},"message":{"type":"string"}},"required":["index","value","message"],"additionalProperties":false}},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["added","already","created_contacts","not_found","invalid","member_count"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Remove contacts from a list (the contacts stay)","tags":["lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","maxLength":40}}},"required":["contact_ids"]}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"member_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["removed","member_count"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/imports":{"post":{"summary":"Import contacts from CSV text (processed in the background)","tags":["imports"],"description":"The first row names the columns. `mapping` says which column holds the phone (required), name, email, external_ref and tags (separated by , ; or |), and which columns become attributes. Up to 10 MB and 50,000 rows. Poll GET /imports/{id} or listen for the import.completed webhook.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"csv":{"type":"string","minLength":1,"maxLength":20971520,"description":"The file's text, at most 10 MB as UTF-8 (400 file_too_large)."},"file_name":{"type":"string","maxLength":200},"mapping":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":200},"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","minLength":1,"maxLength":200},"external_ref":{"type":"string","minLength":1,"maxLength":200},"tags":{"type":"string","minLength":1,"maxLength":200},"attributes":{"description":"CSV column → attribute key, e.g. { \"Appointment\": \"appointment_at\" }","type":"object","additionalProperties":{"type":"string"}}},"required":["phone"]},"list_id":{"type":"string","maxLength":40},"new_list_name":{"type":"string","minLength":1,"maxLength":80},"tags":{"description":"Added to every imported contact.","type":"array","items":{"type":"string"}},"on_existing":{"default":"update","description":"update: merge into the existing contact; skip: leave it as it is","type":"string","enum":["update","skip"]}},"required":["csv","mapping"]}}}},"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","processing","completed","failed"]},"file_name":{"nullable":true,"type":"string"},"mapping":{"type":"object","properties":{"phone":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"external_ref":{"type":"string"},"tags":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}}},"required":["phone"],"additionalProperties":false},"list_id":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"on_existing":{"type":"string","enum":["update","skip"]},"progress":{"type":"object","properties":{"processed_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["processed_rows","total_rows","percent"],"additionalProperties":false},"totals":{"type":"object","properties":{"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates_in_file":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Saved rows whose number is on the do-not-call list (they are never called)"}},"required":["rows","created","updated","skipped","duplicates_in_file","invalid","dnc"],"additionalProperties":false},"error":{"nullable":true,"type":"string"},"errors_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"started_at":{"nullable":true,"type":"string"},"finished_at":{"nullable":true,"type":"string"}},"required":["id","status","file_name","mapping","list_id","tags","on_existing","progress","totals","error","errors_count","created_at","started_at","finished_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"get":{"summary":"Your imports (newest first)","tags":["imports"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","processing","completed","failed"]},"file_name":{"nullable":true,"type":"string"},"mapping":{"type":"object","properties":{"phone":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"external_ref":{"type":"string"},"tags":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}}},"required":["phone"],"additionalProperties":false},"list_id":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"on_existing":{"type":"string","enum":["update","skip"]},"progress":{"type":"object","properties":{"processed_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["processed_rows","total_rows","percent"],"additionalProperties":false},"totals":{"type":"object","properties":{"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates_in_file":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Saved rows whose number is on the do-not-call list (they are never called)"}},"required":["rows","created","updated","skipped","duplicates_in_file","invalid","dnc"],"additionalProperties":false},"error":{"nullable":true,"type":"string"},"errors_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"started_at":{"nullable":true,"type":"string"},"finished_at":{"nullable":true,"type":"string"}},"required":["id","status","file_name","mapping","list_id","tags","on_existing","progress","totals","error","errors_count","created_at","started_at","finished_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/imports/{id}":{"get":{"summary":"One import: status, progress and totals","tags":["imports"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","processing","completed","failed"]},"file_name":{"nullable":true,"type":"string"},"mapping":{"type":"object","properties":{"phone":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"external_ref":{"type":"string"},"tags":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"type":"string"}}},"required":["phone"],"additionalProperties":false},"list_id":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"on_existing":{"type":"string","enum":["update","skip"]},"progress":{"type":"object","properties":{"processed_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["processed_rows","total_rows","percent"],"additionalProperties":false},"totals":{"type":"object","properties":{"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates_in_file":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Saved rows whose number is on the do-not-call list (they are never called)"}},"required":["rows","created","updated","skipped","duplicates_in_file","invalid","dnc"],"additionalProperties":false},"error":{"nullable":true,"type":"string"},"errors_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"started_at":{"nullable":true,"type":"string"},"finished_at":{"nullable":true,"type":"string"}},"required":["id","status","file_name","mapping","list_id","tags","on_existing","progress","totals","error","errors_count","created_at","started_at","finished_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/imports/{id}/errors.csv":{"get":{"summary":"Rows that were not saved (CSV: row, value, reason)","tags":["imports"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"CSV text","content":{"text/csv":{"schema":{"type":"string","description":"CSV text"}}}},"400":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/dnc":{"get":{"summary":"The do-not-call list (newest first)","tags":["do-not-call"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"q","required":false,"description":"Digits of the number"},{"schema":{"type":"string","enum":["opt_out","manual","import","complaint","keypad"]},"in":"query","name":"reason","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"reason":{"type":"string","enum":["opt_out","manual","import","complaint","keypad"]},"protected":{"type":"boolean","description":"The person opted out themselves; only an account owner can remove it"},"note":{"nullable":true,"type":"string"},"source_call_id":{"nullable":true,"type":"string"},"contact_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","reason","protected","note","source_call_id","contact_id","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add a number to the do-not-call list (idempotent)","tags":["do-not-call"],"description":"201 when the number was added, 200 when it was already on the list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":32},"reason":{"default":"manual","type":"string","enum":["manual","complaint","opt_out","import"]},"note":{"type":"string","maxLength":200}},"required":["phone"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"reason":{"type":"string","enum":["opt_out","manual","import","complaint","keypad"]},"protected":{"type":"boolean","description":"The person opted out themselves; only an account owner can remove it"},"note":{"nullable":true,"type":"string"},"source_call_id":{"nullable":true,"type":"string"},"contact_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","reason","protected","note","source_call_id","contact_id","created_at","updated_at"],"additionalProperties":false},"added":{"type":"boolean"}},"required":["entry","added"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"entry":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"reason":{"type":"string","enum":["opt_out","manual","import","complaint","keypad"]},"protected":{"type":"boolean","description":"The person opted out themselves; only an account owner can remove it"},"note":{"nullable":true,"type":"string"},"source_call_id":{"nullable":true,"type":"string"},"contact_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","phone","reason","protected","note","source_call_id","contact_id","created_at","updated_at"],"additionalProperties":false},"added":{"type":"boolean"}},"required":["entry","added"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/dnc/bulk":{"post":{"summary":"Add up to 1,000 numbers to the do-not-call list","tags":["do-not-call"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phones":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","maxLength":40}},"reason":{"default":"import","type":"string","enum":["manual","complaint","opt_out","import"]},"note":{"type":"string","maxLength":200}},"required":["phones"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"value":{"type":"string"},"phone":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["added","already","duplicate","invalid"]},"message":{"type":"string"}},"required":["index","value","phone","status"],"additionalProperties":false}},"totals":{"type":"object","properties":{"received":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"already":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["received","added","already","duplicates","invalid"],"additionalProperties":false}},"required":["results","totals"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/dnc/{phone}":{"delete":{"summary":"Remove a number from the do-not-call list","tags":["do-not-call"],"description":"A person's own opt-out (reason opt_out or keypad) can be removed only by an account owner in the dashboard (403 opt_out_protected).","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"phone","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/settings/calling":{"get":{"summary":"Calling hours, quiet days and frequency caps","tags":["calling hours"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"window_start":{"type":"string"},"window_end":{"type":"string"},"quiet_days":{"type":"array","items":{"type":"string","enum":["sun","mon","tue","wed","thu","fri","sat"]}},"caps":{"type":"object","properties":{"per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"per_week":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_day","per_week"],"additionalProperties":false},"timezone":{"type":"string","enum":["Asia/Kolkata"]},"legal_window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"next_allowed_at":{"type":"string","description":"The next instant an outbound call may start, given the window, quiet days and holidays"}},"required":["window_start","window_end","quiet_days","caps","timezone","legal_window","next_allowed_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change calling hours, quiet days or frequency caps","tags":["calling hours"],"description":"Times are IST in 30-minute steps inside 09:00–21:00. Send only the fields you change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"window_start":{"type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"window_end":{"type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"quiet_days":{"maxItems":7,"type":"array","items":{"type":"string","enum":["sun","mon","tue","wed","thu","fri","sat"]}},"caps":{"type":"object","properties":{"per_day":{"type":"integer","minimum":1,"maximum":3},"per_week":{"type":"integer","minimum":1,"maximum":10}}}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"window_start":{"type":"string"},"window_end":{"type":"string"},"quiet_days":{"type":"array","items":{"type":"string","enum":["sun","mon","tue","wed","thu","fri","sat"]}},"caps":{"type":"object","properties":{"per_day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"per_week":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_day","per_week"],"additionalProperties":false},"timezone":{"type":"string","enum":["Asia/Kolkata"]},"legal_window":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false},"next_allowed_at":{"type":"string","description":"The next instant an outbound call may start, given the window, quiet days and holidays"}},"required":["window_start","window_end","quiet_days","caps","timezone","legal_window","next_allowed_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/holidays":{"get":{"summary":"Holidays from today (IST) onwards, earliest first","tags":["calling hours"],"parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"include_past","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"label":{"type":"string"},"scope":{"type":"string","enum":["outbound","inbound","both"]},"created_at":{"type":"string"}},"required":["id","date","label","scope","created_at"],"additionalProperties":false}},"next_cursor":{"type":"string","nullable":true,"enum":[null]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add a holiday (no outbound calls, no inbound business hours, or both)","tags":["calling hours"],"description":"Send an Idempotency-Key to make retries safe (a replay returns the first answer instead of 409 holiday_exists).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80},"scope":{"default":"both","type":"string","enum":["outbound","inbound","both"]}},"required":["date","label"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"label":{"type":"string"},"scope":{"type":"string","enum":["outbound","inbound","both"]},"created_at":{"type":"string"}},"required":["id","date","label","scope","created_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/holidays/{id}":{"delete":{"summary":"Remove a holiday","tags":["calling hours"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog/voices/{id}/preview":{"get":{"summary":"Hear a voice: its stored preview recording, made once","tags":["catalog"],"description":"Every voice reads the same ~1,000-character service script in its own language. The first time anyone asks for a voice we record it and keep the audio, so a voice is only ever recorded once; after that this answers with the link to that same recording. The link is immutable and can be cached for good. The speaking pace is not part of the recording: play it faster or slower in the player. Making a new recording needs a verified email and counts towards a small daily limit per account; playing one that already exists does neither.","parameters":[{"schema":{"type":"string","enum":["hi-IN","en-IN","mr-IN","gu-IN","bn-IN","ta-IN","te-IN","kn-IN","ml-IN","pa-IN","od-IN"]},"in":"query","name":"language","required":false,"description":"Which of the voice's languages to hear. Defaults to the voice's own language."},{"schema":{"type":"string","minLength":1,"maxLength":60},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"voice_id":{"type":"string"},"language":{"type":"string"},"language_name":{"type":"string"},"script_version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"script":{"type":"string"},"url":{"type":"string"},"mime":{"type":"string"},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"characters":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"synthesised":{"type":"boolean"}},"required":["voice_id","language","language_name","script_version","script","url","mime","duration_ms","size_bytes","characters","created_at","synthesised"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog/models":{"get":{"summary":"GPT models for agents, with per-minute prices","tags":["catalog"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"badge":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"supports_fast":{"type":"boolean"},"price_per_min":{"type":"object","properties":{"standard":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"fast":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["standard","fast"],"additionalProperties":false},"model_add_on_per_min":{"type":"object","properties":{"standard":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"fast":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["standard","fast"],"additionalProperties":false},"long_instructions_per_1k":{"type":"object","properties":{"standard":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"fast":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["standard","fast"],"additionalProperties":false}},"required":["id","label","badge","description","default","supports_fast","price_per_min","model_add_on_per_min","long_instructions_per_1k"],"additionalProperties":false}},"included_prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","included_prompt_tokens"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog/voices":{"get":{"summary":"Voices, optionally for one language","tags":["catalog"],"parameters":[{"schema":{"type":"string","enum":["hi-IN","en-IN","mr-IN","gu-IN","bn-IN","ta-IN","te-IN","kn-IN","ml-IN","pa-IN","od-IN"]},"in":"query","name":"language","required":false},{"schema":{"type":"string","enum":["standard","premium","natural"]},"in":"query","name":"tier","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"gender":{"type":"string","enum":["female","male"]},"style":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}},"tier":{"type":"string","enum":["standard","premium","natural"]},"recommended_for":{"type":"array","items":{"type":"string"}},"price_add_on_per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["id","name","gender","style","languages","tier","recommended_for","price_add_on_per_min"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/catalog/languages":{"get":{"summary":"Call languages","tags":["catalog"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"default":{"type":"boolean"},"default_voice_id":{"type":"string"}},"required":["code","name","default","default_voice_id"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes":{"post":{"summary":"Per-minute price of an unsaved agent config or message call","tags":["catalog"],"description":"type \"agent\": send the agent config as for POST /agents; the answer is the per-minute price with a line-by-line breakdown. Fields that don't change the price are not validated. type \"message\": a recorded or text-to-speech message call. Nothing is saved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"config":{"default":{},"type":"object","additionalProperties":{}},"agent_id":{"description":"The saved agent being edited, if any: the voice it already has is accepted even when that voice is no longer offered (as PATCH /agents accepts it).","type":"string","minLength":1,"maxLength":40}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"kind":{"type":"string","enum":["recorded","tts"]},"voice_id":{"type":"string","minLength":1,"maxLength":60},"language":{"type":"string","enum":["hi-IN","en-IN","mr-IN","gu-IN","bn-IN","ta-IN","te-IN","kn-IN","ml-IN","pa-IN","od-IN"]}},"required":["type","kind"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["agent","message"]},"per_minute":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"model":{"nullable":true,"type":"string"},"speed":{"nullable":true,"type":"string","enum":["standard","fast"]},"voice_tier":{"nullable":true,"type":"string","enum":["standard","premium","natural"]},"prompt_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included_prompt_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"price_list_id":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","per_minute","parts","model","speed","voice_tier","prompt_tokens","included_prompt_tokens","price_list_id"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents":{"get":{"summary":"List agents, newest first","tags":["agents"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"is_active","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"external_ref","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"is_active":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"config":{"type":"object","properties":{"language":{"type":"string"},"voice":{"type":"object","properties":{"id":{"type":"string"},"pace":{"type":"number"}},"required":["id","pace"],"additionalProperties":false},"model":{"type":"string"},"speed":{"type":"string","enum":["standard","fast"]},"persona":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string"},"tone":{"type":"string"}},"required":["name","role","tone"],"additionalProperties":false},"greeting":{"type":"string"},"instructions":{"type":"string"},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["key","label","type","required","options","description"],"additionalProperties":false}},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"numbers":{"type":"array","items":{"type":"string"},"description":"Rung together. Also the fallback for a hand-over no team matched."},"departments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"numbers":{"type":"array","items":{"type":"string"}},"whisper_text":{"type":"string"}},"required":["key","label","description","numbers","whisper_text"],"additionalProperties":false},"description":"Teams the agent picks between. Empty = one list for everything."},"default_key":{"type":"string","description":"The team that takes a hand-over the agent could not place. Empty = the numbers above, or the first team."},"message":{"type":"string"},"whisper_text":{"type":"string"},"time_limit_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","numbers","departments","default_key","message","whisper_text","time_limit_s"],"additionalProperties":false},"on_call_start":{"type":"object","properties":{"tool_id":{"nullable":true,"description":"An HTTP tool run once before the agent speaks; its JSON answer fills {{context.…}}.","type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tool_id","timeout_ms"],"additionalProperties":false,"description":"A lookup before the greeting. A failure or a slow answer is never fatal: the call goes ahead with an empty context."},"limits":{"type":"object","properties":{"max_call_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"silence_reprompt_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_reprompts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_call_seconds","silence_reprompt_s","max_reprompts"],"additionalProperties":false},"tool_ids":{"type":"array","items":{"type":"string"}},"knowledge_source_ids":{"type":"array","items":{"type":"string"},"description":"Reference material this agent may search mid-call with search_knowledge. It is never put in the prompt, so it does not change the per-minute price."},"websites":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"instruction":{"type":"string","description":"When the agent should look at this page. This one line travels with the prompt; the page itself never does."},"status":{"type":"string","enum":["pending","ok","failed"],"description":"pending = not read yet · ok = read · failed = we could not read it."},"title":{"nullable":true,"description":"The page's own title, once we have read it.","type":"string"},"words":{"nullable":true,"description":"Roughly how many words we took from the page.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read_at":{"nullable":true,"type":"string"},"error":{"nullable":true,"description":"Why we could not read it, in words the owner can act on.","type":"string"}},"required":["url","instruction","status","title","words","read_at","error"],"additionalProperties":false},"description":"Pages on the business's own site the agent can answer from. Read in the background and again every day, never during a call."},"builtins":{"type":"object","properties":{"request_callback":{"type":"boolean"},"opt_out_of_calls":{"type":"object","properties":{"outbound":{"type":"boolean","enum":[true]},"inbound":{"type":"boolean"}},"required":["outbound","inbound"],"additionalProperties":false}},"required":["request_callback","opt_out_of_calls"],"additionalProperties":false}},"required":["language","voice","model","speed","persona","greeting","instructions","outcomes","fields","handover","on_call_start","limits","tool_ids","knowledge_source_ids","websites","builtins"],"additionalProperties":false},"rate":{"type":"object","properties":{"per_minute":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"voice_tier":{"type":"string","enum":["standard","premium","natural"]},"prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included_prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_minute","parts","voice_tier","prompt_tokens","included_prompt_tokens"],"additionalProperties":false},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","is_active","version","config","rate","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create an agent","tags":["agents"],"description":"Every config field is optional; missing ones take their defaults (Hindi, the recommended voice, GPT-6 Luna at Fast). The answer carries the live per-minute `rate`. Send an Idempotency-Key to make retries safe.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500},"is_active":{"type":"boolean"},"config":{"type":"object","properties":{"language":{"type":"string","enum":["hi-IN","en-IN","mr-IN","gu-IN","bn-IN","ta-IN","te-IN","kn-IN","ml-IN","pa-IN","od-IN"]},"voice":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":60},"pace":{"type":"number","minimum":0.5,"maximum":2}},"additionalProperties":false},"model":{"type":"string","minLength":1,"maxLength":40},"speed":{"type":"string","enum":["standard","fast"]},"persona":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"role":{"type":"string","maxLength":160},"tone":{"type":"string","maxLength":160}},"additionalProperties":false},"greeting":{"type":"string","maxLength":500},"instructions":{"type":"string","maxLength":20000},"outcomes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":300}},"required":["key","label"],"additionalProperties":false}},"fields":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"required":{"type":"boolean"},"options":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"description":{"type":"string","maxLength":300}},"required":["key","label","type"],"additionalProperties":false}},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"numbers":{"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":32}},"departments":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":200},"numbers":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":32}},"whisper_text":{"type":"string","maxLength":300}},"required":["key","label","numbers"],"additionalProperties":false}},"default_key":{"anyOf":[{"type":"string","enum":[""]},{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}]},"message":{"type":"string","maxLength":300},"whisper_text":{"type":"string","maxLength":300},"time_limit_s":{"type":"integer","minimum":30,"maximum":3600}},"additionalProperties":false},"on_call_start":{"type":"object","properties":{"tool_id":{"nullable":true,"type":"string","maxLength":40},"timeout_ms":{"type":"integer","minimum":500,"maximum":2500}},"additionalProperties":false},"limits":{"type":"object","properties":{"max_call_seconds":{"type":"integer","minimum":60,"maximum":1800},"silence_reprompt_s":{"type":"integer","minimum":4,"maximum":30},"max_reprompts":{"type":"integer","minimum":0,"maximum":3}},"additionalProperties":false},"tool_ids":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^tol_[0-9A-HJKMNP-TV-Z]{26}$"}},"knowledge_source_ids":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^kns_[0-9A-HJKMNP-TV-Z]{26}$"}},"websites":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":500},"instruction":{"type":"string","maxLength":160}},"required":["url"],"additionalProperties":false}},"builtins":{"type":"object","properties":{"request_callback":{"type":"boolean"},"opt_out_of_calls":{"type":"object","properties":{"outbound":{"type":"boolean","enum":[true]},"inbound":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"is_active":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"config":{"type":"object","properties":{"language":{"type":"string"},"voice":{"type":"object","properties":{"id":{"type":"string"},"pace":{"type":"number"}},"required":["id","pace"],"additionalProperties":false},"model":{"type":"string"},"speed":{"type":"string","enum":["standard","fast"]},"persona":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string"},"tone":{"type":"string"}},"required":["name","role","tone"],"additionalProperties":false},"greeting":{"type":"string"},"instructions":{"type":"string"},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["key","label","type","required","options","description"],"additionalProperties":false}},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"numbers":{"type":"array","items":{"type":"string"},"description":"Rung together. Also the fallback for a hand-over no team matched."},"departments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"numbers":{"type":"array","items":{"type":"string"}},"whisper_text":{"type":"string"}},"required":["key","label","description","numbers","whisper_text"],"additionalProperties":false},"description":"Teams the agent picks between. Empty = one list for everything."},"default_key":{"type":"string","description":"The team that takes a hand-over the agent could not place. Empty = the numbers above, or the first team."},"message":{"type":"string"},"whisper_text":{"type":"string"},"time_limit_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","numbers","departments","default_key","message","whisper_text","time_limit_s"],"additionalProperties":false},"on_call_start":{"type":"object","properties":{"tool_id":{"nullable":true,"description":"An HTTP tool run once before the agent speaks; its JSON answer fills {{context.…}}.","type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tool_id","timeout_ms"],"additionalProperties":false,"description":"A lookup before the greeting. A failure or a slow answer is never fatal: the call goes ahead with an empty context."},"limits":{"type":"object","properties":{"max_call_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"silence_reprompt_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_reprompts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_call_seconds","silence_reprompt_s","max_reprompts"],"additionalProperties":false},"tool_ids":{"type":"array","items":{"type":"string"}},"knowledge_source_ids":{"type":"array","items":{"type":"string"},"description":"Reference material this agent may search mid-call with search_knowledge. It is never put in the prompt, so it does not change the per-minute price."},"websites":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"instruction":{"type":"string","description":"When the agent should look at this page. This one line travels with the prompt; the page itself never does."},"status":{"type":"string","enum":["pending","ok","failed"],"description":"pending = not read yet · ok = read · failed = we could not read it."},"title":{"nullable":true,"description":"The page's own title, once we have read it.","type":"string"},"words":{"nullable":true,"description":"Roughly how many words we took from the page.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read_at":{"nullable":true,"type":"string"},"error":{"nullable":true,"description":"Why we could not read it, in words the owner can act on.","type":"string"}},"required":["url","instruction","status","title","words","read_at","error"],"additionalProperties":false},"description":"Pages on the business's own site the agent can answer from. Read in the background and again every day, never during a call."},"builtins":{"type":"object","properties":{"request_callback":{"type":"boolean"},"opt_out_of_calls":{"type":"object","properties":{"outbound":{"type":"boolean","enum":[true]},"inbound":{"type":"boolean"}},"required":["outbound","inbound"],"additionalProperties":false}},"required":["request_callback","opt_out_of_calls"],"additionalProperties":false}},"required":["language","voice","model","speed","persona","greeting","instructions","outcomes","fields","handover","on_call_start","limits","tool_ids","knowledge_source_ids","websites","builtins"],"additionalProperties":false},"rate":{"type":"object","properties":{"per_minute":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"voice_tier":{"type":"string","enum":["standard","premium","natural"]},"prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included_prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_minute","parts","voice_tier","prompt_tokens","included_prompt_tokens"],"additionalProperties":false},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","is_active","version","config","rate","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{id}":{"get":{"summary":"Get an agent","tags":["agents"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"is_active":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"config":{"type":"object","properties":{"language":{"type":"string"},"voice":{"type":"object","properties":{"id":{"type":"string"},"pace":{"type":"number"}},"required":["id","pace"],"additionalProperties":false},"model":{"type":"string"},"speed":{"type":"string","enum":["standard","fast"]},"persona":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string"},"tone":{"type":"string"}},"required":["name","role","tone"],"additionalProperties":false},"greeting":{"type":"string"},"instructions":{"type":"string"},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["key","label","type","required","options","description"],"additionalProperties":false}},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"numbers":{"type":"array","items":{"type":"string"},"description":"Rung together. Also the fallback for a hand-over no team matched."},"departments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"numbers":{"type":"array","items":{"type":"string"}},"whisper_text":{"type":"string"}},"required":["key","label","description","numbers","whisper_text"],"additionalProperties":false},"description":"Teams the agent picks between. Empty = one list for everything."},"default_key":{"type":"string","description":"The team that takes a hand-over the agent could not place. Empty = the numbers above, or the first team."},"message":{"type":"string"},"whisper_text":{"type":"string"},"time_limit_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","numbers","departments","default_key","message","whisper_text","time_limit_s"],"additionalProperties":false},"on_call_start":{"type":"object","properties":{"tool_id":{"nullable":true,"description":"An HTTP tool run once before the agent speaks; its JSON answer fills {{context.…}}.","type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tool_id","timeout_ms"],"additionalProperties":false,"description":"A lookup before the greeting. A failure or a slow answer is never fatal: the call goes ahead with an empty context."},"limits":{"type":"object","properties":{"max_call_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"silence_reprompt_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_reprompts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_call_seconds","silence_reprompt_s","max_reprompts"],"additionalProperties":false},"tool_ids":{"type":"array","items":{"type":"string"}},"knowledge_source_ids":{"type":"array","items":{"type":"string"},"description":"Reference material this agent may search mid-call with search_knowledge. It is never put in the prompt, so it does not change the per-minute price."},"websites":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"instruction":{"type":"string","description":"When the agent should look at this page. This one line travels with the prompt; the page itself never does."},"status":{"type":"string","enum":["pending","ok","failed"],"description":"pending = not read yet · ok = read · failed = we could not read it."},"title":{"nullable":true,"description":"The page's own title, once we have read it.","type":"string"},"words":{"nullable":true,"description":"Roughly how many words we took from the page.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read_at":{"nullable":true,"type":"string"},"error":{"nullable":true,"description":"Why we could not read it, in words the owner can act on.","type":"string"}},"required":["url","instruction","status","title","words","read_at","error"],"additionalProperties":false},"description":"Pages on the business's own site the agent can answer from. Read in the background and again every day, never during a call."},"builtins":{"type":"object","properties":{"request_callback":{"type":"boolean"},"opt_out_of_calls":{"type":"object","properties":{"outbound":{"type":"boolean","enum":[true]},"inbound":{"type":"boolean"}},"required":["outbound","inbound"],"additionalProperties":false}},"required":["request_callback","opt_out_of_calls"],"additionalProperties":false}},"required":["language","voice","model","speed","persona","greeting","instructions","outcomes","fields","handover","on_call_start","limits","tool_ids","knowledge_source_ids","websites","builtins"],"additionalProperties":false},"rate":{"type":"object","properties":{"per_minute":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"voice_tier":{"type":"string","enum":["standard","premium","natural"]},"prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included_prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_minute","parts","voice_tier","prompt_tokens","included_prompt_tokens"],"additionalProperties":false},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","is_active","version","config","rate","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change an agent","tags":["agents"],"description":"Top-level fields replace; the config sections voice, persona, handover, limits and builtins merge one level deep; lists (outcomes, fields, tool_ids, handover.numbers) replace. Send `version` to refuse the change if someone saved in between (409 version_conflict). The version goes up by one on every real change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":500},"is_active":{"type":"boolean"},"config":{"type":"object","properties":{"language":{"type":"string","enum":["hi-IN","en-IN","mr-IN","gu-IN","bn-IN","ta-IN","te-IN","kn-IN","ml-IN","pa-IN","od-IN"]},"voice":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":60},"pace":{"type":"number","minimum":0.5,"maximum":2}},"additionalProperties":false},"model":{"type":"string","minLength":1,"maxLength":40},"speed":{"type":"string","enum":["standard","fast"]},"persona":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"role":{"type":"string","maxLength":160},"tone":{"type":"string","maxLength":160}},"additionalProperties":false},"greeting":{"type":"string","maxLength":500},"instructions":{"type":"string","maxLength":20000},"outcomes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":300}},"required":["key","label"],"additionalProperties":false}},"fields":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"required":{"type":"boolean"},"options":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":60}},"description":{"type":"string","maxLength":300}},"required":["key","label","type"],"additionalProperties":false}},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"numbers":{"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":32}},"departments":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"label":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":200},"numbers":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":32}},"whisper_text":{"type":"string","maxLength":300}},"required":["key","label","numbers"],"additionalProperties":false}},"default_key":{"anyOf":[{"type":"string","enum":[""]},{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}]},"message":{"type":"string","maxLength":300},"whisper_text":{"type":"string","maxLength":300},"time_limit_s":{"type":"integer","minimum":30,"maximum":3600}},"additionalProperties":false},"on_call_start":{"type":"object","properties":{"tool_id":{"nullable":true,"type":"string","maxLength":40},"timeout_ms":{"type":"integer","minimum":500,"maximum":2500}},"additionalProperties":false},"limits":{"type":"object","properties":{"max_call_seconds":{"type":"integer","minimum":60,"maximum":1800},"silence_reprompt_s":{"type":"integer","minimum":4,"maximum":30},"max_reprompts":{"type":"integer","minimum":0,"maximum":3}},"additionalProperties":false},"tool_ids":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^tol_[0-9A-HJKMNP-TV-Z]{26}$"}},"knowledge_source_ids":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^kns_[0-9A-HJKMNP-TV-Z]{26}$"}},"websites":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":500},"instruction":{"type":"string","maxLength":160}},"required":["url"],"additionalProperties":false}},"builtins":{"type":"object","properties":{"request_callback":{"type":"boolean"},"opt_out_of_calls":{"type":"object","properties":{"outbound":{"type":"boolean","enum":[true]},"inbound":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"version":{"type":"integer","minimum":1,"maximum":9007199254740991}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"is_active":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"config":{"type":"object","properties":{"language":{"type":"string"},"voice":{"type":"object","properties":{"id":{"type":"string"},"pace":{"type":"number"}},"required":["id","pace"],"additionalProperties":false},"model":{"type":"string"},"speed":{"type":"string","enum":["standard","fast"]},"persona":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string"},"tone":{"type":"string"}},"required":["name","role","tone"],"additionalProperties":false},"greeting":{"type":"string"},"instructions":{"type":"string"},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["key","label","type","required","options","description"],"additionalProperties":false}},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"numbers":{"type":"array","items":{"type":"string"},"description":"Rung together. Also the fallback for a hand-over no team matched."},"departments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"numbers":{"type":"array","items":{"type":"string"}},"whisper_text":{"type":"string"}},"required":["key","label","description","numbers","whisper_text"],"additionalProperties":false},"description":"Teams the agent picks between. Empty = one list for everything."},"default_key":{"type":"string","description":"The team that takes a hand-over the agent could not place. Empty = the numbers above, or the first team."},"message":{"type":"string"},"whisper_text":{"type":"string"},"time_limit_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","numbers","departments","default_key","message","whisper_text","time_limit_s"],"additionalProperties":false},"on_call_start":{"type":"object","properties":{"tool_id":{"nullable":true,"description":"An HTTP tool run once before the agent speaks; its JSON answer fills {{context.…}}.","type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tool_id","timeout_ms"],"additionalProperties":false,"description":"A lookup before the greeting. A failure or a slow answer is never fatal: the call goes ahead with an empty context."},"limits":{"type":"object","properties":{"max_call_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"silence_reprompt_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_reprompts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_call_seconds","silence_reprompt_s","max_reprompts"],"additionalProperties":false},"tool_ids":{"type":"array","items":{"type":"string"}},"knowledge_source_ids":{"type":"array","items":{"type":"string"},"description":"Reference material this agent may search mid-call with search_knowledge. It is never put in the prompt, so it does not change the per-minute price."},"websites":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"instruction":{"type":"string","description":"When the agent should look at this page. This one line travels with the prompt; the page itself never does."},"status":{"type":"string","enum":["pending","ok","failed"],"description":"pending = not read yet · ok = read · failed = we could not read it."},"title":{"nullable":true,"description":"The page's own title, once we have read it.","type":"string"},"words":{"nullable":true,"description":"Roughly how many words we took from the page.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read_at":{"nullable":true,"type":"string"},"error":{"nullable":true,"description":"Why we could not read it, in words the owner can act on.","type":"string"}},"required":["url","instruction","status","title","words","read_at","error"],"additionalProperties":false},"description":"Pages on the business's own site the agent can answer from. Read in the background and again every day, never during a call."},"builtins":{"type":"object","properties":{"request_callback":{"type":"boolean"},"opt_out_of_calls":{"type":"object","properties":{"outbound":{"type":"boolean","enum":[true]},"inbound":{"type":"boolean"}},"required":["outbound","inbound"],"additionalProperties":false}},"required":["request_callback","opt_out_of_calls"],"additionalProperties":false}},"required":["language","voice","model","speed","persona","greeting","instructions","outcomes","fields","handover","on_call_start","limits","tool_ids","knowledge_source_ids","websites","builtins"],"additionalProperties":false},"rate":{"type":"object","properties":{"per_minute":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"voice_tier":{"type":"string","enum":["standard","premium","natural"]},"prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included_prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_minute","parts","voice_tier","prompt_tokens","included_prompt_tokens"],"additionalProperties":false},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","is_active","version","config","rate","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete an agent","tags":["agents"],"description":"Soft delete, 204. Refused with 409 agent_in_use while a number answers incoming calls with it or a running/scheduled/paused campaign, a switched-on trigger or a call waiting to be placed uses it (details.numbers, details.campaigns, details.triggers, details.pending_calls).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{id}/duplicate":{"post":{"summary":"Copy an agent","tags":["agents"],"description":"Creates \"<name> (copy)\" with the same config and tools (never the external_ref). Send an Idempotency-Key to make retries safe.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"is_active":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"config":{"type":"object","properties":{"language":{"type":"string"},"voice":{"type":"object","properties":{"id":{"type":"string"},"pace":{"type":"number"}},"required":["id","pace"],"additionalProperties":false},"model":{"type":"string"},"speed":{"type":"string","enum":["standard","fast"]},"persona":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string"},"tone":{"type":"string"}},"required":["name","role","tone"],"additionalProperties":false},"greeting":{"type":"string"},"instructions":{"type":"string"},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"],"additionalProperties":false}},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","date","boolean","enum"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["key","label","type","required","options","description"],"additionalProperties":false}},"handover":{"type":"object","properties":{"enabled":{"type":"boolean"},"numbers":{"type":"array","items":{"type":"string"},"description":"Rung together. Also the fallback for a hand-over no team matched."},"departments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"numbers":{"type":"array","items":{"type":"string"}},"whisper_text":{"type":"string"}},"required":["key","label","description","numbers","whisper_text"],"additionalProperties":false},"description":"Teams the agent picks between. Empty = one list for everything."},"default_key":{"type":"string","description":"The team that takes a hand-over the agent could not place. Empty = the numbers above, or the first team."},"message":{"type":"string"},"whisper_text":{"type":"string"},"time_limit_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["enabled","numbers","departments","default_key","message","whisper_text","time_limit_s"],"additionalProperties":false},"on_call_start":{"type":"object","properties":{"tool_id":{"nullable":true,"description":"An HTTP tool run once before the agent speaks; its JSON answer fills {{context.…}}.","type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["tool_id","timeout_ms"],"additionalProperties":false,"description":"A lookup before the greeting. A failure or a slow answer is never fatal: the call goes ahead with an empty context."},"limits":{"type":"object","properties":{"max_call_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"silence_reprompt_s":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_reprompts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_call_seconds","silence_reprompt_s","max_reprompts"],"additionalProperties":false},"tool_ids":{"type":"array","items":{"type":"string"}},"knowledge_source_ids":{"type":"array","items":{"type":"string"},"description":"Reference material this agent may search mid-call with search_knowledge. It is never put in the prompt, so it does not change the per-minute price."},"websites":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"instruction":{"type":"string","description":"When the agent should look at this page. This one line travels with the prompt; the page itself never does."},"status":{"type":"string","enum":["pending","ok","failed"],"description":"pending = not read yet · ok = read · failed = we could not read it."},"title":{"nullable":true,"description":"The page's own title, once we have read it.","type":"string"},"words":{"nullable":true,"description":"Roughly how many words we took from the page.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"read_at":{"nullable":true,"type":"string"},"error":{"nullable":true,"description":"Why we could not read it, in words the owner can act on.","type":"string"}},"required":["url","instruction","status","title","words","read_at","error"],"additionalProperties":false},"description":"Pages on the business's own site the agent can answer from. Read in the background and again every day, never during a call."},"builtins":{"type":"object","properties":{"request_callback":{"type":"boolean"},"opt_out_of_calls":{"type":"object","properties":{"outbound":{"type":"boolean","enum":[true]},"inbound":{"type":"boolean"}},"required":["outbound","inbound"],"additionalProperties":false}},"required":["request_callback","opt_out_of_calls"],"additionalProperties":false}},"required":["language","voice","model","speed","persona","greeting","instructions","outcomes","fields","handover","on_call_start","limits","tool_ids","knowledge_source_ids","websites","builtins"],"additionalProperties":false},"rate":{"type":"object","properties":{"per_minute":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"voice_tier":{"type":"string","enum":["standard","premium","natural"]},"prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"included_prompt_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_minute","parts","voice_tier","prompt_tokens","included_prompt_tokens"],"additionalProperties":false},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","is_active","version","config","rate","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/tools":{"get":{"summary":"List HTTP tools, newest first","tags":["http tools"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"model_name":{"type":"string"},"description":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"url_template":{"type":"string"},"headers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"secret":{"type":"boolean"},"value":{"nullable":true,"type":"string"},"is_set":{"type":"boolean"}},"required":["name","secret","value","is_set"],"additionalProperties":false}},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","integer","boolean"]},"description":{"type":"string"},"required":{"type":"boolean"},"enum":{"type":"array","items":{"type":"string"}}},"required":["name","type","description","required","enum"],"additionalProperties":false}},"body_template":{"nullable":true,"type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"response_pick":{"nullable":true,"type":"string"},"response_template":{"nullable":true,"description":"One sentence filled from the answer, e.g. “Order {{data.id}} is {{data.status}}.”. The agent reads this instead of the raw answer.","type":"string"},"auth":{"nullable":true,"description":"Credentials that expire. The client secret is never returned.","type":"object","properties":{"kind":{"type":"string","enum":["none","oauth2_client_credentials"]},"token_url":{"type":"string"},"client_id":{"type":"string"},"scope":{"type":"string"},"header":{"type":"string"},"prefix":{"type":"string"},"secret_is_set":{"type":"boolean"}},"required":["kind","token_url","client_id","scope","header","prefix","secret_is_set"],"additionalProperties":false},"filler_line":{"nullable":true,"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","model_name","description","method","url_template","headers","params","body_template","timeout_ms","response_pick","response_template","auth","filler_line","version","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create an HTTP tool","tags":["http tools"],"description":"A tool an agent may call during a call (the model sees it as custom_<name>). Secret header values are encrypted and never returned. Send an Idempotency-Key to make retries safe.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"description":{"type":"string","minLength":1,"maxLength":500},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"url_template":{"type":"string","minLength":1,"maxLength":2000},"headers":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,64}$"},"value":{"nullable":true,"type":"string","maxLength":2000},"secret":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"params":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["string","number","integer","boolean"]},"description":{"type":"string","maxLength":300},"required":{"type":"boolean"},"enum":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["name","type"],"additionalProperties":false}},"body_template":{"nullable":true,"type":"string","maxLength":8000},"timeout_ms":{"type":"integer","minimum":500,"maximum":8000},"response_pick":{"nullable":true,"type":"string","maxLength":200},"response_template":{"nullable":true,"type":"string","maxLength":500},"auth":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["none","oauth2_client_credentials"]},"token_url":{"type":"string","maxLength":2000},"client_id":{"type":"string","maxLength":300},"client_secret":{"nullable":true,"type":"string","maxLength":2000},"scope":{"type":"string","maxLength":300},"header":{"type":"string","pattern":"^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,64}$"},"prefix":{"type":"string","maxLength":40}},"required":["kind"],"additionalProperties":false},"filler_line":{"nullable":true,"type":"string","maxLength":200},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"required":["name","description","url_template"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"model_name":{"type":"string"},"description":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"url_template":{"type":"string"},"headers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"secret":{"type":"boolean"},"value":{"nullable":true,"type":"string"},"is_set":{"type":"boolean"}},"required":["name","secret","value","is_set"],"additionalProperties":false}},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","integer","boolean"]},"description":{"type":"string"},"required":{"type":"boolean"},"enum":{"type":"array","items":{"type":"string"}}},"required":["name","type","description","required","enum"],"additionalProperties":false}},"body_template":{"nullable":true,"type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"response_pick":{"nullable":true,"type":"string"},"response_template":{"nullable":true,"description":"One sentence filled from the answer, e.g. “Order {{data.id}} is {{data.status}}.”. The agent reads this instead of the raw answer.","type":"string"},"auth":{"nullable":true,"description":"Credentials that expire. The client secret is never returned.","type":"object","properties":{"kind":{"type":"string","enum":["none","oauth2_client_credentials"]},"token_url":{"type":"string"},"client_id":{"type":"string"},"scope":{"type":"string"},"header":{"type":"string"},"prefix":{"type":"string"},"secret_is_set":{"type":"boolean"}},"required":["kind","token_url","client_id","scope","header","prefix","secret_is_set"],"additionalProperties":false},"filler_line":{"nullable":true,"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","model_name","description","method","url_template","headers","params","body_template","timeout_ms","response_pick","response_template","auth","filler_line","version","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/tools/{id}":{"get":{"summary":"Get an HTTP tool","tags":["http tools"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"model_name":{"type":"string"},"description":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"url_template":{"type":"string"},"headers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"secret":{"type":"boolean"},"value":{"nullable":true,"type":"string"},"is_set":{"type":"boolean"}},"required":["name","secret","value","is_set"],"additionalProperties":false}},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","integer","boolean"]},"description":{"type":"string"},"required":{"type":"boolean"},"enum":{"type":"array","items":{"type":"string"}}},"required":["name","type","description","required","enum"],"additionalProperties":false}},"body_template":{"nullable":true,"type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"response_pick":{"nullable":true,"type":"string"},"response_template":{"nullable":true,"description":"One sentence filled from the answer, e.g. “Order {{data.id}} is {{data.status}}.”. The agent reads this instead of the raw answer.","type":"string"},"auth":{"nullable":true,"description":"Credentials that expire. The client secret is never returned.","type":"object","properties":{"kind":{"type":"string","enum":["none","oauth2_client_credentials"]},"token_url":{"type":"string"},"client_id":{"type":"string"},"scope":{"type":"string"},"header":{"type":"string"},"prefix":{"type":"string"},"secret_is_set":{"type":"boolean"}},"required":["kind","token_url","client_id","scope","header","prefix","secret_is_set"],"additionalProperties":false},"filler_line":{"nullable":true,"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","model_name","description","method","url_template","headers","params","body_template","timeout_ms","response_pick","response_template","auth","filler_line","version","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change an HTTP tool","tags":["http tools"],"description":"Fields sent replace the saved ones. A secret header sent with `value: null` keeps its saved value. Every agent using the tool gets a new version.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"description":{"type":"string","minLength":1,"maxLength":500},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"url_template":{"type":"string","minLength":1,"maxLength":2000},"headers":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,64}$"},"value":{"nullable":true,"type":"string","maxLength":2000},"secret":{"type":"boolean"}},"required":["name"],"additionalProperties":false}},"params":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"type":{"type":"string","enum":["string","number","integer","boolean"]},"description":{"type":"string","maxLength":300},"required":{"type":"boolean"},"enum":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["name","type"],"additionalProperties":false}},"body_template":{"nullable":true,"type":"string","maxLength":8000},"timeout_ms":{"type":"integer","minimum":500,"maximum":8000},"response_pick":{"nullable":true,"type":"string","maxLength":200},"response_template":{"nullable":true,"type":"string","maxLength":500},"auth":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["none","oauth2_client_credentials"]},"token_url":{"type":"string","maxLength":2000},"client_id":{"type":"string","maxLength":300},"client_secret":{"nullable":true,"type":"string","maxLength":2000},"scope":{"type":"string","maxLength":300},"header":{"type":"string","pattern":"^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,64}$"},"prefix":{"type":"string","maxLength":40}},"required":["kind"],"additionalProperties":false},"filler_line":{"nullable":true,"type":"string","maxLength":200},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"model_name":{"type":"string"},"description":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"url_template":{"type":"string"},"headers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"secret":{"type":"boolean"},"value":{"nullable":true,"type":"string"},"is_set":{"type":"boolean"}},"required":["name","secret","value","is_set"],"additionalProperties":false}},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","integer","boolean"]},"description":{"type":"string"},"required":{"type":"boolean"},"enum":{"type":"array","items":{"type":"string"}}},"required":["name","type","description","required","enum"],"additionalProperties":false}},"body_template":{"nullable":true,"type":"string"},"timeout_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"response_pick":{"nullable":true,"type":"string"},"response_template":{"nullable":true,"description":"One sentence filled from the answer, e.g. “Order {{data.id}} is {{data.status}}.”. The agent reads this instead of the raw answer.","type":"string"},"auth":{"nullable":true,"description":"Credentials that expire. The client secret is never returned.","type":"object","properties":{"kind":{"type":"string","enum":["none","oauth2_client_credentials"]},"token_url":{"type":"string"},"client_id":{"type":"string"},"scope":{"type":"string"},"header":{"type":"string"},"prefix":{"type":"string"},"secret_is_set":{"type":"boolean"}},"required":["kind","token_url","client_id","scope","header","prefix","secret_is_set"],"additionalProperties":false},"filler_line":{"nullable":true,"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","model_name","description","method","url_template","headers","params","body_template","timeout_ms","response_pick","response_template","auth","filler_line","version","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete an HTTP tool","tags":["http tools"],"description":"Refused with 409 tool_in_use (details.agents lists them) while an agent uses it.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/tools/{id}/test":{"post":{"summary":"Run an HTTP tool once with test arguments","tags":["http tools"],"description":"Calls the tool exactly as an agent would (same checks, timeout and size cap) and returns the status, time, the start of the answer and what the agent would read. A call that fails is still a 200 with ok:false and an error code; arguments that don't fit the parameters are a 400 with details.fields `args.<name>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"type":"object","additionalProperties":{}},"contact":{"description":"Stand-in values for the {{contact.…}} variables in the URL or body, keyed without the prefix, e.g. {\"city\": \"Pune\"}.","type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"truncated":{"type":"boolean"},"shortened":{"type":"boolean","description":"The answer did not fit and was cut. The agent is told so in `result`."},"missing":{"type":"array","items":{"type":"string"},"description":"Answer-template paths the answer did not have. They came out as empty text."},"response_excerpt":{"type":"string"},"result":{"type":"string"},"error":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"request":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"url":{"type":"string"}},"required":["method","url"],"additionalProperties":false},"args":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"contact_variables":{"type":"array","items":{"type":"string"},"description":"The {{contact.…}} variables this tool uses. On a real call they come from the contact."}},"required":["ok","status","ms","truncated","shortened","missing","response_excerpt","result","error","request","args","contact_variables"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/knowledge":{"get":{"summary":"List knowledge sources, newest first","tags":["knowledge"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["file","text"]},"file_id":{"nullable":true,"type":"string"},"chars":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chunk_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Passages it was split into. Each one is searched on its own."},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","kind","file_id","chars","chunk_count","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add reference material an agent can search during a call","tags":["knowledge"],"description":"Send `text`, or the `file_id` of a plain-text or Markdown file uploaded with PUT /files?purpose=knowledge. It is split into passages at once; the agent reads only the passage a caller asks about, through its search_knowledge tool. Nothing here is ever added to the prompt, so it does not change an agent's per-minute price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","maxLength":200000},"file_id":{"type":"string","maxLength":40},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"required":["title"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["file","text"]},"file_id":{"nullable":true,"type":"string"},"chars":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chunk_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Passages it was split into. Each one is searched on its own."},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","kind","file_id","chars","chunk_count","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/knowledge/{id}":{"get":{"summary":"One knowledge source","tags":["knowledge"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["file","text"]},"file_id":{"nullable":true,"type":"string"},"chars":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chunk_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Passages it was split into. Each one is searched on its own."},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","kind","file_id","chars","chunk_count","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Rename a knowledge source","tags":["knowledge"],"description":"The text itself can't be edited: add a new source and remove the old one, so no call is ever answered from half-replaced material.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string","enum":["file","text"]},"file_id":{"nullable":true,"type":"string"},"chars":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chunk_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Passages it was split into. Each one is searched on its own."},"agents_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","kind","file_id","chars","chunk_count","agents_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a knowledge source","tags":["knowledge"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{id}/knowledge-search":{"post":{"summary":"Try a search the way the agent would make it on a call","tags":["knowledge"],"description":"Runs the agent's own search_knowledge over the sources it is given, and shows both the passages found and the exact text the agent would read back.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":300}},"required":["query"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"passages":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"heading":{"type":"string"},"body":{"type":"string"}},"required":["title","heading","body"],"additionalProperties":false}},"result":{"type":"string","description":"Exactly what the agent reads back."}},"required":["passages","result"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/cities":{"get":{"summary":"Cities you can search for local numbers, with their area (STD) codes","tags":["numbers"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"state":{"type":"string"},"area_code":{"type":"string"}},"required":["id","name","state","area_code"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/available":{"get":{"summary":"Search numbers you can rent, by city, area code and digits","tags":["numbers"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"query","name":"city","required":false},{"schema":{"type":"string","pattern":"^[1-9]\\d{1,3}$"},"in":"query","name":"area_code","required":false},{"schema":{"type":"string","pattern":"^\\d{1,8}$"},"in":"query","name":"contains","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":20},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"e164":{"type":"string"},"city":{"nullable":true,"type":"string"},"city_name":{"nullable":true,"type":"string"},"area_code":{"nullable":true,"type":"string"}},"required":["e164","city","city_name","area_code"],"additionalProperties":false}},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"lines_included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"renews_at":{"type":"string"}},"required":["data","monthly_rent","lines_included","renews_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers":{"get":{"summary":"Your numbers, newest first (active and held by default)","tags":["numbers"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["active","held","released"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"external_ref","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"e164":{"type":"string"},"city":{"nullable":true,"type":"string"},"city_name":{"nullable":true,"type":"string"},"area_code":{"nullable":true,"type":"string"},"label":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["active","held","released"]},"inbound_agent_id":{"nullable":true,"type":"string"},"mode":{"type":"string","enum":["ai","forward"]},"forward_to":{"nullable":true,"type":"string"},"recording":{"type":"boolean"},"recording_notice":{"nullable":true,"type":"string"},"transcription":{"type":"boolean"},"business_hours":{"nullable":true,"type":"object","properties":{"mon":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"tue":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"wed":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"thu":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"fri":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sat":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sun":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"after_hours":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["message_hangup"]},"message":{"type":"string"}},"required":["action","message"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["forward"]},"forward_to":{"type":"string"}},"required":["action","forward_to"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["ai"]}},"required":["action"],"additionalProperties":false}]},"lines_included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"release_after":{"nullable":true,"type":"string"},"released_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"no_agent, agent_inactive, agent_deleted or kyc_suspended (more may be added)"},"when":{"type":"string","enum":["always","after_hours"]},"message":{"type":"string"}},"required":["code","when","message"],"additionalProperties":false},"description":"Why this number would refuse calls right now (e.g. AI mode without an active agent). Empty when it answers normally."}},"required":["id","e164","city","city_name","area_code","label","status","inbound_agent_id","mode","forward_to","recording","recording_notice","transcription","business_hours","after_hours","lines_included","monthly_rent","rent_next_at","held_at","release_after","released_at","external_ref","metadata","created_at","updated_at","warnings"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Rent a number: the first month's rent is taken from your Prepaid Balance now (Idempotency-Key required)","tags":["numbers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"e164":{"type":"string","minLength":1,"maxLength":32},"label":{"nullable":true,"type":"string","maxLength":60},"inbound_agent_id":{"nullable":true,"type":"string","maxLength":40},"mode":{"type":"string","enum":["ai","forward"]},"forward_to":{"nullable":true,"type":"string","minLength":1,"maxLength":32},"recording":{"type":"boolean"},"recording_notice":{"nullable":true,"type":"string","maxLength":300},"transcription":{"type":"boolean"},"business_hours":{"nullable":true,"type":"object","properties":{"mon":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"tue":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"wed":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"thu":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"fri":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"sat":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"sun":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}}},"additionalProperties":false},"after_hours":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["message_hangup"]},"message":{"type":"string","minLength":1,"maxLength":300}},"required":["action","message"]},{"type":"object","properties":{"action":{"type":"string","enum":["forward"]},"forward_to":{"type":"string","minLength":1,"maxLength":32}},"required":["action","forward_to"]},{"type":"object","properties":{"action":{"type":"string","enum":["ai"]}},"required":["action"]}]},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"required":["e164"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"e164":{"type":"string"},"city":{"nullable":true,"type":"string"},"city_name":{"nullable":true,"type":"string"},"area_code":{"nullable":true,"type":"string"},"label":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["active","held","released"]},"inbound_agent_id":{"nullable":true,"type":"string"},"mode":{"type":"string","enum":["ai","forward"]},"forward_to":{"nullable":true,"type":"string"},"recording":{"type":"boolean"},"recording_notice":{"nullable":true,"type":"string"},"transcription":{"type":"boolean"},"business_hours":{"nullable":true,"type":"object","properties":{"mon":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"tue":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"wed":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"thu":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"fri":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sat":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sun":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"after_hours":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["message_hangup"]},"message":{"type":"string"}},"required":["action","message"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["forward"]},"forward_to":{"type":"string"}},"required":["action","forward_to"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["ai"]}},"required":["action"],"additionalProperties":false}]},"lines_included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"release_after":{"nullable":true,"type":"string"},"released_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"no_agent, agent_inactive, agent_deleted or kyc_suspended (more may be added)"},"when":{"type":"string","enum":["always","after_hours"]},"message":{"type":"string"}},"required":["code","when","message"],"additionalProperties":false},"description":"Why this number would refuse calls right now (e.g. AI mode without an active agent). Empty when it answers normally."}},"required":["id","e164","city","city_name","area_code","label","status","inbound_agent_id","mode","forward_to","recording","recording_notice","transcription","business_hours","after_hours","lines_included","monthly_rent","rent_next_at","held_at","release_after","released_at","external_ref","metadata","created_at","updated_at","warnings"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/numbers/{id}":{"get":{"summary":"One number","tags":["numbers"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"e164":{"type":"string"},"city":{"nullable":true,"type":"string"},"city_name":{"nullable":true,"type":"string"},"area_code":{"nullable":true,"type":"string"},"label":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["active","held","released"]},"inbound_agent_id":{"nullable":true,"type":"string"},"mode":{"type":"string","enum":["ai","forward"]},"forward_to":{"nullable":true,"type":"string"},"recording":{"type":"boolean"},"recording_notice":{"nullable":true,"type":"string"},"transcription":{"type":"boolean"},"business_hours":{"nullable":true,"type":"object","properties":{"mon":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"tue":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"wed":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"thu":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"fri":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sat":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sun":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"after_hours":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["message_hangup"]},"message":{"type":"string"}},"required":["action","message"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["forward"]},"forward_to":{"type":"string"}},"required":["action","forward_to"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["ai"]}},"required":["action"],"additionalProperties":false}]},"lines_included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"release_after":{"nullable":true,"type":"string"},"released_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"no_agent, agent_inactive, agent_deleted or kyc_suspended (more may be added)"},"when":{"type":"string","enum":["always","after_hours"]},"message":{"type":"string"}},"required":["code","when","message"],"additionalProperties":false},"description":"Why this number would refuse calls right now (e.g. AI mode without an active agent). Empty when it answers normally."}},"required":["id","e164","city","city_name","area_code","label","status","inbound_agent_id","mode","forward_to","recording","recording_notice","transcription","business_hours","after_hours","lines_included","monthly_rent","rent_next_at","held_at","release_after","released_at","external_ref","metadata","created_at","updated_at","warnings"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change a number's settings: agent, mode, forwarding, recording, business hours, after-hours action","tags":["numbers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"nullable":true,"type":"string","maxLength":60},"inbound_agent_id":{"nullable":true,"type":"string","maxLength":40},"mode":{"type":"string","enum":["ai","forward"]},"forward_to":{"nullable":true,"type":"string","minLength":1,"maxLength":32},"recording":{"type":"boolean"},"recording_notice":{"nullable":true,"type":"string","maxLength":300},"transcription":{"type":"boolean"},"business_hours":{"nullable":true,"type":"object","properties":{"mon":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"tue":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"wed":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"thu":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"fri":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"sat":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}},"sun":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"end":{"type":"string"}},"required":["start","end"]}}},"additionalProperties":false},"after_hours":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["message_hangup"]},"message":{"type":"string","minLength":1,"maxLength":300}},"required":["action","message"]},{"type":"object","properties":{"action":{"type":"string","enum":["forward"]},"forward_to":{"type":"string","minLength":1,"maxLength":32}},"required":["action","forward_to"]},{"type":"object","properties":{"action":{"type":"string","enum":["ai"]}},"required":["action"]}]},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"e164":{"type":"string"},"city":{"nullable":true,"type":"string"},"city_name":{"nullable":true,"type":"string"},"area_code":{"nullable":true,"type":"string"},"label":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["active","held","released"]},"inbound_agent_id":{"nullable":true,"type":"string"},"mode":{"type":"string","enum":["ai","forward"]},"forward_to":{"nullable":true,"type":"string"},"recording":{"type":"boolean"},"recording_notice":{"nullable":true,"type":"string"},"transcription":{"type":"boolean"},"business_hours":{"nullable":true,"type":"object","properties":{"mon":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"tue":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"wed":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"thu":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"fri":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sat":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sun":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"after_hours":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["message_hangup"]},"message":{"type":"string"}},"required":["action","message"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["forward"]},"forward_to":{"type":"string"}},"required":["action","forward_to"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["ai"]}},"required":["action"],"additionalProperties":false}]},"lines_included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"release_after":{"nullable":true,"type":"string"},"released_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"no_agent, agent_inactive, agent_deleted or kyc_suspended (more may be added)"},"when":{"type":"string","enum":["always","after_hours"]},"message":{"type":"string"}},"required":["code","when","message"],"additionalProperties":false},"description":"Why this number would refuse calls right now (e.g. AI mode without an active agent). Empty when it answers normally."}},"required":["id","e164","city","city_name","area_code","label","status","inbound_agent_id","mode","forward_to","recording","recording_notice","transcription","business_hours","after_hours","lines_included","monthly_rent","rent_next_at","held_at","release_after","released_at","external_ref","metadata","created_at","updated_at","warnings"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Release and delete a number now. Permanent; rent stops; the current month is not refunded","tags":["numbers"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"e164":{"type":"string"},"city":{"nullable":true,"type":"string"},"city_name":{"nullable":true,"type":"string"},"area_code":{"nullable":true,"type":"string"},"label":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["active","held","released"]},"inbound_agent_id":{"nullable":true,"type":"string"},"mode":{"type":"string","enum":["ai","forward"]},"forward_to":{"nullable":true,"type":"string"},"recording":{"type":"boolean"},"recording_notice":{"nullable":true,"type":"string"},"transcription":{"type":"boolean"},"business_hours":{"nullable":true,"type":"object","properties":{"mon":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"tue":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"wed":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"thu":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"fri":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sat":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}},"sun":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"],"additionalProperties":false}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"after_hours":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["message_hangup"]},"message":{"type":"string"}},"required":["action","message"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["forward"]},"forward_to":{"type":"string"}},"required":["action","forward_to"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["ai"]}},"required":["action"],"additionalProperties":false}]},"lines_included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"release_after":{"nullable":true,"type":"string"},"released_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"no_agent, agent_inactive, agent_deleted or kyc_suspended (more may be added)"},"when":{"type":"string","enum":["always","after_hours"]},"message":{"type":"string"}},"required":["code","when","message"],"additionalProperties":false},"description":"Why this number would refuse calls right now (e.g. AI mode without an active agent). Empty when it answers normally."}},"required":["id","e164","city","city_name","area_code","label","status","inbound_agent_id","mode","forward_to","recording","recording_notice","transcription","business_hours","after_hours","lines_included","monthly_rent","rent_next_at","held_at","release_after","released_at","external_ref","metadata","created_at","updated_at","warnings"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/lines":{"get":{"summary":"Concurrent call lines: included with numbers, plus extra lines","tags":["numbers"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"extra":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"line_price":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"max_extra":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","held","cancelled"]},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"cancel_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"cancelled_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","status","monthly_rent","rent_next_at","cancel_at","held_at","cancelled_at","created_at"],"additionalProperties":false}}},"required":["included","extra","limit","line_price","max_extra","data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Buy extra lines: each line's first month is taken from your Prepaid Balance now (Idempotency-Key required)","tags":["numbers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer","minimum":1,"maximum":20}},"required":["quantity"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","held","cancelled"]},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"cancel_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"cancelled_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","status","monthly_rent","rent_next_at","cancel_at","held_at","cancelled_at","created_at"],"additionalProperties":false}},"charged":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["data","charged"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/lines/{id}":{"delete":{"summary":"Remove an extra line. It stays until the end of the month already paid (a held line goes at once)","tags":["numbers"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","held","cancelled"]},"monthly_rent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"rent_next_at":{"nullable":true,"type":"string"},"cancel_at":{"nullable":true,"type":"string"},"held_at":{"nullable":true,"type":"string"},"cancelled_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","status","monthly_rent","rent_next_at","cancel_at","held_at","cancelled_at","created_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/kyc":{"get":{"summary":"Your business verification (status draft until submitted)","tags":["kyc"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["draft","submitted","approved","rejected","suspended","expired"]},"can_submit":{"type":"boolean"},"rejection_reason":{"nullable":true,"type":"string"},"legal_name":{"nullable":true,"type":"string"},"registration_type":{"nullable":true,"type":"string"},"registration_number":{"nullable":true,"type":"string"},"gstin":{"nullable":true,"type":"string"},"address":{"nullable":true,"type":"object","properties":{"line1":{"type":"string"},"line2":{"nullable":true,"type":"string"},"city":{"type":"string"},"state_code":{"type":"string"},"pincode":{"type":"string"}},"required":["line1","line2","city","state_code","pincode"],"additionalProperties":false},"authorised_person":{"nullable":true,"type":"object","properties":{"name":{"type":"string"},"designation":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name","designation","email","phone"],"additionalProperties":false},"documents":{"type":"object","properties":{"registration_certificate":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"purpose":{"type":"string"},"filename":{"type":"string"},"mime":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"created_at":{"type":"string"}},"required":["id","purpose","filename","mime","size_bytes","sha256","created_at"],"additionalProperties":false},"gst_certificate":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"purpose":{"type":"string"},"filename":{"type":"string"},"mime":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"created_at":{"type":"string"}},"required":["id","purpose","filename","mime","size_bytes","sha256","created_at"],"additionalProperties":false}},"required":["registration_certificate","gst_certificate"],"additionalProperties":false},"submitted_at":{"nullable":true,"type":"string"},"decided_at":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"}},"required":["id","status","can_submit","rejection_reason","legal_name","registration_type","registration_number","gstin","address","authorised_person","documents","submitted_at","decided_at","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Submit business verification (or correct and resubmit a rejected one). Upload the two documents with PUT /v1/files first","tags":["kyc"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"legal_name":{"type":"string","minLength":2,"maxLength":200},"registration_type":{"type":"string","enum":["private_limited","public_limited","one_person_company","llp","partnership","proprietorship","trust_or_society","government","other"]},"registration_number":{"type":"string"},"gstin":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":3,"maxLength":200},"line2":{"type":"string","maxLength":200},"city":{"type":"string","minLength":2,"maxLength":100},"state_code":{"type":"string"},"pincode":{"type":"string","pattern":"^[1-9]\\d{5}$"}},"required":["line1","city","state_code","pincode"]},"authorised_person":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":100},"designation":{"type":"string","minLength":2,"maxLength":60},"email":{"type":"string"},"phone":{"type":"string","minLength":1,"maxLength":32}},"required":["name","designation","email","phone"]},"registration_certificate_file_id":{"type":"string","minLength":1,"maxLength":40},"gst_certificate_file_id":{"type":"string","minLength":1,"maxLength":40}},"required":["legal_name","registration_type","registration_number","gstin","address","authorised_person","registration_certificate_file_id","gst_certificate_file_id"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["draft","submitted","approved","rejected","suspended","expired"]},"can_submit":{"type":"boolean"},"rejection_reason":{"nullable":true,"type":"string"},"legal_name":{"nullable":true,"type":"string"},"registration_type":{"nullable":true,"type":"string"},"registration_number":{"nullable":true,"type":"string"},"gstin":{"nullable":true,"type":"string"},"address":{"nullable":true,"type":"object","properties":{"line1":{"type":"string"},"line2":{"nullable":true,"type":"string"},"city":{"type":"string"},"state_code":{"type":"string"},"pincode":{"type":"string"}},"required":["line1","line2","city","state_code","pincode"],"additionalProperties":false},"authorised_person":{"nullable":true,"type":"object","properties":{"name":{"type":"string"},"designation":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name","designation","email","phone"],"additionalProperties":false},"documents":{"type":"object","properties":{"registration_certificate":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"purpose":{"type":"string"},"filename":{"type":"string"},"mime":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"created_at":{"type":"string"}},"required":["id","purpose","filename","mime","size_bytes","sha256","created_at"],"additionalProperties":false},"gst_certificate":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"purpose":{"type":"string"},"filename":{"type":"string"},"mime":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"created_at":{"type":"string"}},"required":["id","purpose","filename","mime","size_bytes","sha256","created_at"],"additionalProperties":false}},"required":["registration_certificate","gst_certificate"],"additionalProperties":false},"submitted_at":{"nullable":true,"type":"string"},"decided_at":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"}},"required":["id","status","can_submit","rejection_reason","legal_name","registration_type","registration_number","gstin","address","authorised_person","documents","submitted_at","decided_at","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/files":{"put":{"summary":"Upload a file as the raw request body (kyc: PDF/PNG/JPEG ≤ 5 MB; audio: MP3/WAV ≤ 10 MB)","tags":["files"],"description":"Send the file's bytes as the body with its Content-Type (application/pdf, image/png, image/jpeg, audio/mpeg or audio/wav). The type is checked against the file's content. Returns the file id to use elsewhere (e.g. POST /v1/kyc).","parameters":[{"schema":{"type":"string","enum":["kyc","audio","knowledge"]},"in":"query","name":"purpose","required":true},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"query","name":"filename","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"purpose":{"type":"string"},"filename":{"type":"string"},"mime":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sha256":{"type":"string"},"created_at":{"type":"string"}},"required":["id","purpose","filename","mime","size_bytes","sha256","created_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/files/{id}":{"get":{"summary":"Download one of your files","tags":["files"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/webhook-endpoints":{"get":{"summary":"List webhook endpoints (at most 10 per account), with the event types you can subscribe to","tags":["webhooks"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"nullable":true,"type":"string"},"events":{"type":"array","items":{"type":"string"}},"number_ids":{"type":"array","items":{"type":"string"},"description":"Empty = every event of the account; otherwise only events about these numbers."},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"secret_rotated_at":{"nullable":true,"type":"string"},"last_attempt":{"nullable":true,"type":"object","properties":{"delivery_id":{"type":"string"},"at":{"type":"string"},"succeeded":{"type":"boolean"},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["delivery_id","at","succeeded","status_code","error"],"additionalProperties":false},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","url","description","events","number_ids","enabled","metadata","external_ref","secret_rotated_at","last_attempt","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"event_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"subscribable":{"type":"boolean"}},"required":["type","description","subscribable"],"additionalProperties":false}}},"required":["data","next_cursor","event_types"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add a webhook endpoint. The response holds the signing secret; it is never shown again","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"nullable":true,"type":"string","maxLength":200},"events":{"minItems":1,"maxItems":14,"type":"array","items":{"type":"string","enum":["*","call.started","call.ended","call.analyzed","call.transcribed","campaign.started","campaign.completed","number.held","number.released","kyc.updated","balance.low","recharge.succeeded","contact.opted_out","import.completed"]}},"number_ids":{"description":"Limit this endpoint to these numbers. Empty = every event of the account. A number-scoped endpoint never receives the account-wide events (balance, recharges, KYC, imports).","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100}},"required":["url","events"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"nullable":true,"type":"string"},"events":{"type":"array","items":{"type":"string"}},"number_ids":{"type":"array","items":{"type":"string"},"description":"Empty = every event of the account; otherwise only events about these numbers."},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"secret_rotated_at":{"nullable":true,"type":"string"},"last_attempt":{"nullable":true,"type":"object","properties":{"delivery_id":{"type":"string"},"at":{"type":"string"},"succeeded":{"type":"boolean"},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["delivery_id","at","succeeded","status_code","error"],"additionalProperties":false},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string","description":"The signing secret (whsec_…). Shown only in this response; store it now."}},"required":["id","url","description","events","number_ids","enabled","metadata","external_ref","secret_rotated_at","last_attempt","created_at","updated_at","secret"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}":{"get":{"summary":"One webhook endpoint","tags":["webhooks"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"nullable":true,"type":"string"},"events":{"type":"array","items":{"type":"string"}},"number_ids":{"type":"array","items":{"type":"string"},"description":"Empty = every event of the account; otherwise only events about these numbers."},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"secret_rotated_at":{"nullable":true,"type":"string"},"last_attempt":{"nullable":true,"type":"object","properties":{"delivery_id":{"type":"string"},"at":{"type":"string"},"succeeded":{"type":"boolean"},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["delivery_id","at","succeeded","status_code","error"],"additionalProperties":false},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","url","description","events","number_ids","enabled","metadata","external_ref","secret_rotated_at","last_attempt","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change a webhook endpoint (URL, events, numbers, description, enabled, metadata, external_ref)","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"nullable":true,"type":"string","maxLength":200},"events":{"minItems":1,"maxItems":14,"type":"array","items":{"type":"string","enum":["*","call.started","call.ended","call.analyzed","call.transcribed","campaign.started","campaign.completed","number.held","number.released","kyc.updated","balance.low","recharge.succeeded","contact.opted_out","import.completed"]}},"number_ids":{"description":"Limit this endpoint to these numbers. Empty = every event of the account. A number-scoped endpoint never receives the account-wide events (balance, recharges, KYC, imports).","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100}}}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"nullable":true,"type":"string"},"events":{"type":"array","items":{"type":"string"}},"number_ids":{"type":"array","items":{"type":"string"},"description":"Empty = every event of the account; otherwise only events about these numbers."},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"secret_rotated_at":{"nullable":true,"type":"string"},"last_attempt":{"nullable":true,"type":"object","properties":{"delivery_id":{"type":"string"},"at":{"type":"string"},"succeeded":{"type":"boolean"},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["delivery_id","at","succeeded","status_code","error"],"additionalProperties":false},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","url","description","events","number_ids","enabled","metadata","external_ref","secret_rotated_at","last_attempt","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a webhook endpoint. Its pending deliveries stop; the delivery log is kept","tags":["webhooks"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}/rotate-secret":{"post":{"summary":"Replace the signing secret. The new secret is shown only in this response and signs every attempt from now on","tags":["webhooks"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"nullable":true,"type":"string"},"events":{"type":"array","items":{"type":"string"}},"number_ids":{"type":"array","items":{"type":"string"},"description":"Empty = every event of the account; otherwise only events about these numbers."},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"secret_rotated_at":{"nullable":true,"type":"string"},"last_attempt":{"nullable":true,"type":"object","properties":{"delivery_id":{"type":"string"},"at":{"type":"string"},"succeeded":{"type":"boolean"},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["delivery_id","at","succeeded","status_code","error"],"additionalProperties":false},"created_at":{"type":"string"},"updated_at":{"type":"string"},"secret":{"type":"string","description":"The signing secret (whsec_…). Shown only in this response; store it now."}},"required":["id","url","description","events","number_ids","enabled","metadata","external_ref","secret_rotated_at","last_attempt","created_at","updated_at","secret"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}/test":{"post":{"summary":"Send a webhook.test event to this endpoint only, now, and return the delivery with the attempt's result","tags":["webhooks"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"endpoint_id":{"type":"string"},"endpoint_url":{"type":"string"},"endpoint_deleted":{"type":"boolean"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"nullable":true,"type":"string"},"in_progress":{"type":"boolean"},"last_attempt_at":{"nullable":true,"type":"string"},"last_status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"request":{"type":"object","properties":{"method":{"type":"string","enum":["POST"]},"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":"string","description":"The exact bytes sent (and signed) on every attempt."}},"required":["method","url","headers","body"],"additionalProperties":false},"attempt_log":{"type":"array","items":{"type":"object","properties":{"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger":{"type":"string","enum":["scheduled","replay","test"]},"url":{"type":"string"},"at":{"type":"string"},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded":{"type":"boolean"},"error":{"nullable":true,"type":"string"},"response_excerpt":{"nullable":true,"type":"string"}},"required":["attempt","trigger","url","at","duration_ms","status_code","succeeded","error","response_excerpt"],"additionalProperties":false}}},"required":["id","event_id","event_type","endpoint_id","endpoint_url","endpoint_deleted","status","attempts","next_attempt_at","in_progress","last_attempt_at","last_status_code","last_error","created_at","request","attempt_log"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-deliveries":{"get":{"summary":"The delivery log, newest first","tags":["webhooks"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"query","name":"endpoint_id","required":false},{"schema":{"type":"string","enum":["pending","succeeded","failed"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["call.started","call.ended","call.analyzed","call.transcribed","campaign.started","campaign.completed","number.held","number.released","kyc.updated","balance.low","recharge.succeeded","contact.opted_out","import.completed","webhook.test"]},"in":"query","name":"type","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"endpoint_id":{"type":"string"},"endpoint_url":{"type":"string"},"endpoint_deleted":{"type":"boolean"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"nullable":true,"type":"string"},"in_progress":{"type":"boolean"},"last_attempt_at":{"nullable":true,"type":"string"},"last_status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","event_id","event_type","endpoint_id","endpoint_url","endpoint_deleted","status","attempts","next_attempt_at","in_progress","last_attempt_at","last_status_code","last_error","created_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-deliveries/{id}":{"get":{"summary":"One delivery: the exact body sent and every attempt (time, status code, error, response excerpt, duration)","tags":["webhooks"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"endpoint_id":{"type":"string"},"endpoint_url":{"type":"string"},"endpoint_deleted":{"type":"boolean"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"nullable":true,"type":"string"},"in_progress":{"type":"boolean"},"last_attempt_at":{"nullable":true,"type":"string"},"last_status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"request":{"type":"object","properties":{"method":{"type":"string","enum":["POST"]},"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":"string","description":"The exact bytes sent (and signed) on every attempt."}},"required":["method","url","headers","body"],"additionalProperties":false},"attempt_log":{"type":"array","items":{"type":"object","properties":{"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger":{"type":"string","enum":["scheduled","replay","test"]},"url":{"type":"string"},"at":{"type":"string"},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded":{"type":"boolean"},"error":{"nullable":true,"type":"string"},"response_excerpt":{"nullable":true,"type":"string"}},"required":["attempt","trigger","url","at","duration_ms","status_code","succeeded","error","response_excerpt"],"additionalProperties":false}}},"required":["id","event_id","event_type","endpoint_id","endpoint_url","endpoint_deleted","status","attempts","next_attempt_at","in_progress","last_attempt_at","last_status_code","last_error","created_at","request","attempt_log"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-deliveries/{id}/replay":{"post":{"summary":"Send this delivery again now (also when it failed or already succeeded) and return the result","tags":["webhooks"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"endpoint_id":{"type":"string"},"endpoint_url":{"type":"string"},"endpoint_deleted":{"type":"boolean"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"nullable":true,"type":"string"},"in_progress":{"type":"boolean"},"last_attempt_at":{"nullable":true,"type":"string"},"last_status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_error":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"request":{"type":"object","properties":{"method":{"type":"string","enum":["POST"]},"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":"string","description":"The exact bytes sent (and signed) on every attempt."}},"required":["method","url","headers","body"],"additionalProperties":false},"attempt_log":{"type":"array","items":{"type":"object","properties":{"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"trigger":{"type":"string","enum":["scheduled","replay","test"]},"url":{"type":"string"},"at":{"type":"string"},"duration_ms":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status_code":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded":{"type":"boolean"},"error":{"nullable":true,"type":"string"},"response_excerpt":{"nullable":true,"type":"string"}},"required":["attempt","trigger","url","at","duration_ms","status_code","succeeded","error","response_excerpt"],"additionalProperties":false}}},"required":["id","event_id","event_type","endpoint_id","endpoint_url","endpoint_deleted","status","attempts","next_attempt_at","in_progress","last_attempt_at","last_status_code","last_error","created_at","request","attempt_log"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team":{"get":{"summary":"Team members and pending invites","tags":["team (dashboard)"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"email_verified":{"type":"boolean"},"last_login_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","name","email","role","email_verified","last_login_at","created_at"],"additionalProperties":false}},"invites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","member","viewer"]},"invited_by":{"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"}},"required":["id","name"],"additionalProperties":false},"expires_at":{"type":"string"},"expired":{"type":"boolean"},"sent_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_sent_at":{"type":"string"},"created_at":{"type":"string"}},"required":["id","email","role","invited_by","expires_at","expired","sent_count","last_sent_at","created_at"],"additionalProperties":false}}},"required":["members","invites"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team/invites":{"post":{"summary":"Invite a person by email (an owner may invite admins; an admin may invite members and viewers)","tags":["team (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["admin","member","viewer"]}},"required":["email","role"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","member","viewer"]},"invited_by":{"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"}},"required":["id","name"],"additionalProperties":false},"expires_at":{"type":"string"},"expired":{"type":"boolean"},"sent_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_sent_at":{"type":"string"},"created_at":{"type":"string"},"email_sent":{"type":"boolean","description":"False when the email could not be sent; resend the invite later."}},"required":["id","email","role","invited_by","expires_at","expired","sent_count","last_sent_at","created_at","email_sent"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team/invites/{id}/resend":{"post":{"summary":"Send the invite again with a new link (the old link stops working) and 7 more days","tags":["team (dashboard)"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["admin","member","viewer"]},"invited_by":{"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"}},"required":["id","name"],"additionalProperties":false},"expires_at":{"type":"string"},"expired":{"type":"boolean"},"sent_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_sent_at":{"type":"string"},"created_at":{"type":"string"},"email_sent":{"type":"boolean","description":"False when the email could not be sent; resend the invite later."}},"required":["id","email","role","invited_by","expires_at","expired","sent_count","last_sent_at","created_at","email_sent"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team/invites/{id}":{"delete":{"summary":"Cancel a pending invite","tags":["team (dashboard)"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team/members/{userId}":{"patch":{"summary":"Change a member's role","tags":["team (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","member","viewer"]}},"required":["role"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"email_verified":{"type":"boolean"},"last_login_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","name","email","role","email_verified","last_login_at","created_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Remove a member: their login is disabled and every session ends","tags":["team (dashboard)"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40},"in":"path","name":"userId","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/invites/{token}":{"get":{"summary":"Preview an invite: account, inviter, email and role. 400 token_invalid / token_expired / token_used","tags":["auth (dashboard)"],"parameters":[{"schema":{"type":"string","minLength":10,"maxLength":200},"in":"path","name":"token","required":true}],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"inviter":{"nullable":true,"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"email":{"type":"string"},"role":{"type":"string","enum":["admin","member","viewer"]},"expires_at":{"type":"string"}},"required":["account","inviter","email","role","expires_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/auth/accept-invite":{"post":{"summary":"Accept an invite: creates your login in that account (email already verified) and signs you in","tags":["auth (dashboard)"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":10,"maxLength":200},"name":{"type":"string","minLength":1,"maxLength":100},"password":{"type":"string","minLength":10,"maxLength":200},"accept_terms":{"type":"boolean","enum":[true]}},"required":["token","name","password","accept_terms"]}}}},"security":[],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","member","viewer"]},"email_verified":{"type":"boolean"}},"required":["id","email","name","role","email_verified"],"additionalProperties":false},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"additionalProperties":false}},"required":["user","account"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/auto-recharge":{"get":{"summary":"Auto-recharge settings, mandate, the debit in progress and this month's total","tags":["billing"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean","description":"False while online payments are not configured on this server"},"settings":{"nullable":true,"type":"object","properties":{"enabled":{"type":"boolean","description":"True only while the mandate is active and Auto-recharge is switched on"},"threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Recharge when the Prepaid Balance falls below this"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Value each recharge adds, before GST"},"monthly_cap":{"nullable":true,"description":"Most value auto-recharged per IST calendar month","type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"value + 18% GST: the amount debited"},"tier":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","label","discount_bp"],"additionalProperties":false,"description":"The lot each recharge becomes (normal lot rules)"},"failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_after":{"nullable":true,"type":"string"},"stopped_reason":{"nullable":true,"type":"string"}},"required":["enabled","threshold","value","monthly_cap","total","tier","failures","retry_after","stopped_reason"],"additionalProperties":false},"mandate":{"nullable":true,"description":"The approved mandate in use","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"setup":{"nullable":true,"description":"A newer approval in progress (or one that was not approved)","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"in_flight":{"nullable":true,"description":"A debit the bank has not decided yet. UPI and card debits land 1–3 days after the request","type":"object","properties":{"recharge_id":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"state":{"type":"string","enum":["requesting","pending","paid","failed"]},"requested_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["recharge_id","value","total","state","requested_at","created_at"],"additionalProperties":false},"last":{"nullable":true,"type":"object","properties":{"recharge_id":{"type":"string"},"status":{"type":"string","enum":["paid","failed"]},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"at":{"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"invoice_id":{"nullable":true,"type":"string"}},"required":["recharge_id","status","value","total","at","failure_reason","invoice_id"],"additionalProperties":false},"month":{"type":"object","properties":{"used":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"cap":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["used","cap"],"additionalProperties":false},"limits":{"type":"object","properties":{"min_threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"min_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"max_value":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false},"max_charge":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false}},"required":["min_threshold","min_value","max_value","max_charge"],"additionalProperties":false},"terms":{"type":"object","properties":{"acknowledgement_version":{"type":"string"},"consent_version":{"type":"string"}},"required":["acknowledgement_version","consent_version"],"additionalProperties":false}},"required":["available","settings","mandate","setup","in_flight","last","month","limits","terms"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Change the trigger, value or monthly cap, or switch Auto-recharge on/off (dashboard; owner or admin)","tags":["billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold_paise":{"type":"integer","minimum":0,"maximum":1000000000},"value_paise":{"type":"integer","minimum":0,"maximum":1000000000},"monthly_cap_paise":{"nullable":true,"type":"integer","minimum":0,"maximum":10000000000}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean","description":"False while online payments are not configured on this server"},"settings":{"nullable":true,"type":"object","properties":{"enabled":{"type":"boolean","description":"True only while the mandate is active and Auto-recharge is switched on"},"threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Recharge when the Prepaid Balance falls below this"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Value each recharge adds, before GST"},"monthly_cap":{"nullable":true,"description":"Most value auto-recharged per IST calendar month","type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"value + 18% GST: the amount debited"},"tier":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","label","discount_bp"],"additionalProperties":false,"description":"The lot each recharge becomes (normal lot rules)"},"failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_after":{"nullable":true,"type":"string"},"stopped_reason":{"nullable":true,"type":"string"}},"required":["enabled","threshold","value","monthly_cap","total","tier","failures","retry_after","stopped_reason"],"additionalProperties":false},"mandate":{"nullable":true,"description":"The approved mandate in use","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"setup":{"nullable":true,"description":"A newer approval in progress (or one that was not approved)","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"in_flight":{"nullable":true,"description":"A debit the bank has not decided yet. UPI and card debits land 1–3 days after the request","type":"object","properties":{"recharge_id":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"state":{"type":"string","enum":["requesting","pending","paid","failed"]},"requested_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["recharge_id","value","total","state","requested_at","created_at"],"additionalProperties":false},"last":{"nullable":true,"type":"object","properties":{"recharge_id":{"type":"string"},"status":{"type":"string","enum":["paid","failed"]},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"at":{"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"invoice_id":{"nullable":true,"type":"string"}},"required":["recharge_id","status","value","total","at","failure_reason","invoice_id"],"additionalProperties":false},"month":{"type":"object","properties":{"used":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"cap":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["used","cap"],"additionalProperties":false},"limits":{"type":"object","properties":{"min_threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"min_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"max_value":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false},"max_charge":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false}},"required":["min_threshold","min_value","max_value","max_charge"],"additionalProperties":false},"terms":{"type":"object","properties":{"acknowledgement_version":{"type":"string"},"consent_version":{"type":"string"}},"required":["acknowledgement_version","consent_version"],"additionalProperties":false}},"required":["available","settings","mandate","setup","in_flight","last","month","limits","terms"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/auto-recharge/terms":{"get":{"summary":"The recharge acknowledgement and the autopay consent ticked when setting up Auto-recharge","tags":["billing"],"security":[],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"acknowledgement":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"}},"required":["version","text"],"additionalProperties":false},"mandate_consent":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"}},"required":["version","text"],"additionalProperties":false}},"required":["acknowledgement","mandate_consent"],"additionalProperties":false}}}}}}},"/v1/billing/auto-recharge/mandate":{"post":{"summary":"Set up the autopay mandate: returns Razorpay Checkout options for the approval (dashboard; owner or admin)","tags":["billing"],"description":"The approval is ₹1 for UPI and card (refunded automatically) or ₹0 for netbanking eMandate. The mandate's maximum per debit is the chosen recharge value + GST. Settings take effect when the bank confirms the mandate. Supports Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["upi","card","emandate"]},"threshold_paise":{"type":"integer","minimum":0,"maximum":1000000000},"value_paise":{"type":"integer","minimum":0,"maximum":1000000000},"monthly_cap_paise":{"nullable":true,"type":"integer","minimum":0,"maximum":10000000000},"contact":{"description":"Mobile number for the bank's pre-debit notices (Indian numbers only)","type":"string","minLength":1,"maxLength":32},"acknowledgement":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"version":{"type":"string","maxLength":40}},"required":["accepted","version"]},"mandate_consent":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"version":{"type":"string","maxLength":40}},"required":["accepted","version"]}},"required":["method","threshold_paise","value_paise","contact","acknowledgement","mandate_consent"]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"mandate":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"checkout":{"type":"object","properties":{"key_id":{"type":"string"},"order_id":{"type":"string"},"customer_id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"recurring":{"anyOf":[{"type":"string","enum":["1"]},{"type":"boolean","enum":[true]}]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","enum":["INR"]},"name":{"type":"string"},"description":{"type":"string"},"prefill":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"contact":{"type":"string"}},"required":["name","email","contact"],"additionalProperties":false}},"required":["key_id","order_id","customer_id","method","recurring","amount","currency","name","description","prefill"],"additionalProperties":false}},"required":["mandate","checkout"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Cancel the autopay mandate here and at Razorpay, and switch Auto-recharge off (dashboard; owner or admin)","tags":["billing"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"array","items":{"type":"string"}},"debit_in_progress":{"type":"boolean","description":"A debit already requested may still complete; it is added to the balance if it does"},"auto_recharge":{"type":"object","properties":{"available":{"type":"boolean","description":"False while online payments are not configured on this server"},"settings":{"nullable":true,"type":"object","properties":{"enabled":{"type":"boolean","description":"True only while the mandate is active and Auto-recharge is switched on"},"threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Recharge when the Prepaid Balance falls below this"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Value each recharge adds, before GST"},"monthly_cap":{"nullable":true,"description":"Most value auto-recharged per IST calendar month","type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"value + 18% GST: the amount debited"},"tier":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","label","discount_bp"],"additionalProperties":false,"description":"The lot each recharge becomes (normal lot rules)"},"failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_after":{"nullable":true,"type":"string"},"stopped_reason":{"nullable":true,"type":"string"}},"required":["enabled","threshold","value","monthly_cap","total","tier","failures","retry_after","stopped_reason"],"additionalProperties":false},"mandate":{"nullable":true,"description":"The approved mandate in use","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"setup":{"nullable":true,"description":"A newer approval in progress (or one that was not approved)","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"in_flight":{"nullable":true,"description":"A debit the bank has not decided yet. UPI and card debits land 1–3 days after the request","type":"object","properties":{"recharge_id":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"state":{"type":"string","enum":["requesting","pending","paid","failed"]},"requested_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["recharge_id","value","total","state","requested_at","created_at"],"additionalProperties":false},"last":{"nullable":true,"type":"object","properties":{"recharge_id":{"type":"string"},"status":{"type":"string","enum":["paid","failed"]},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"at":{"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"invoice_id":{"nullable":true,"type":"string"}},"required":["recharge_id","status","value","total","at","failure_reason","invoice_id"],"additionalProperties":false},"month":{"type":"object","properties":{"used":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"cap":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["used","cap"],"additionalProperties":false},"limits":{"type":"object","properties":{"min_threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"min_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"max_value":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false},"max_charge":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false}},"required":["min_threshold","min_value","max_value","max_charge"],"additionalProperties":false},"terms":{"type":"object","properties":{"acknowledgement_version":{"type":"string"},"consent_version":{"type":"string"}},"required":["acknowledgement_version","consent_version"],"additionalProperties":false}},"required":["available","settings","mandate","setup","in_flight","last","month","limits","terms"],"additionalProperties":false}},"required":["cancelled","debit_in_progress","auto_recharge"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/auto-recharge/mandate/verify":{"post":{"summary":"Confirm the autopay approval after Checkout (dashboard). The mandate's state is read from Razorpay","tags":["billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"razorpay_order_id":{"type":"string","maxLength":60},"razorpay_payment_id":{"type":"string","maxLength":60},"razorpay_signature":{"type":"string","maxLength":200}},"required":["razorpay_order_id","razorpay_payment_id","razorpay_signature"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean","description":"False while online payments are not configured on this server"},"settings":{"nullable":true,"type":"object","properties":{"enabled":{"type":"boolean","description":"True only while the mandate is active and Auto-recharge is switched on"},"threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Recharge when the Prepaid Balance falls below this"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Value each recharge adds, before GST"},"monthly_cap":{"nullable":true,"description":"Most value auto-recharged per IST calendar month","type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"value + 18% GST: the amount debited"},"tier":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","label","discount_bp"],"additionalProperties":false,"description":"The lot each recharge becomes (normal lot rules)"},"failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_after":{"nullable":true,"type":"string"},"stopped_reason":{"nullable":true,"type":"string"}},"required":["enabled","threshold","value","monthly_cap","total","tier","failures","retry_after","stopped_reason"],"additionalProperties":false},"mandate":{"nullable":true,"description":"The approved mandate in use","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"setup":{"nullable":true,"description":"A newer approval in progress (or one that was not approved)","type":"object","properties":{"id":{"type":"string"},"method":{"type":"string","enum":["upi","card","emandate"]},"method_label":{"type":"string"},"status":{"type":"string","enum":["created","pending","active","paused","rejected","cancelled","expired","abandoned"]},"instrument":{"nullable":true,"type":"string"},"max_amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest single debit the bank approved, incl. GST"},"max_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"Largest recharge value (before GST) that fits under max_amount"},"confirmed_at":{"nullable":true,"type":"string"},"expires_at":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","method","method_label","status","instrument","max_amount","max_value","confirmed_at","expires_at","failure_reason","created_at"],"additionalProperties":false},"in_flight":{"nullable":true,"description":"A debit the bank has not decided yet. UPI and card debits land 1–3 days after the request","type":"object","properties":{"recharge_id":{"type":"string"},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"state":{"type":"string","enum":["requesting","pending","paid","failed"]},"requested_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["recharge_id","value","total","state","requested_at","created_at"],"additionalProperties":false},"last":{"nullable":true,"type":"object","properties":{"recharge_id":{"type":"string"},"status":{"type":"string","enum":["paid","failed"]},"value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"total":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"at":{"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"invoice_id":{"nullable":true,"type":"string"}},"required":["recharge_id","status","value","total","at","failure_reason","invoice_id"],"additionalProperties":false},"month":{"type":"object","properties":{"used":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"cap":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["used","cap"],"additionalProperties":false},"limits":{"type":"object","properties":{"min_threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"min_value":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"max_value":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false},"max_charge":{"type":"object","properties":{"upi":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"card":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emandate":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["upi","card","emandate"],"additionalProperties":false}},"required":["min_threshold","min_value","max_value","max_charge"],"additionalProperties":false},"terms":{"type":"object","properties":{"acknowledgement_version":{"type":"string"},"consent_version":{"type":"string"}},"required":["acknowledgement_version","consent_version"],"additionalProperties":false}},"required":["available","settings","mandate","setup","in_flight","last","month","limits","terms"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/billing/alerts":{"get":{"summary":"Low-balance alert settings","tags":["billing"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emails":{"type":"array","items":{"type":"string"},"description":"Empty = the account's owners and admins"},"alert_active":{"type":"boolean","description":"True after an alert was sent, until the balance rises above the threshold again"},"last_alerted_at":{"nullable":true,"type":"string"}},"required":["enabled","threshold","emails","alert_active","last_alerted_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Change the low-balance alert (owner/admin, or an API key with settings:write)","tags":["billing"],"description":"One email and one balance.low event when the Prepaid Balance falls below the threshold; again only after it has risen above it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold_paise":{"type":"integer","minimum":0,"maximum":1000000000},"emails":{"maxItems":5,"type":"array","items":{"type":"string","maxLength":254}}},"required":["enabled","threshold_paise","emails"]}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"emails":{"type":"array","items":{"type":"string"},"description":"Empty = the account's owners and admins"},"alert_active":{"type":"boolean","description":"True after an alert was sent, until the balance rises above the threshold again"},"last_alerted_at":{"nullable":true,"type":"string"}},"required":["enabled","threshold","emails","alert_active","last_alerted_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/usage":{"get":{"summary":"Usage totals by IST day, month or charge kind (list price, discount, paid)","tags":["billing"],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false,"description":"First IST date, included (default: 29 days before `to`)"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false,"description":"Last IST date, included (default: today in IST)"},{"schema":{"default":"day","type":"string","enum":["day","month","kind"]},"in":"query","name":"group","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"group":{"type":"string","enum":["day","month","kind"]},"timezone":{"type":"string","enum":["Asia/Kolkata"]},"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"YYYY-MM-DD (day), YYYY-MM (month) or the charge kind (usage | fixed)"},"label":{"type":"string"},"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"paid":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"list − discount, including any shortfall still owed"},"charges":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","list","discount","paid","charges"],"additionalProperties":false}},"totals":{"type":"object","properties":{"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"paid":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"charges":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["list","discount","paid","charges"],"additionalProperties":false}},"required":["from","to","group","timezone","data","totals"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/statement.csv":{"get":{"summary":"The statement as CSV: every ledger line with list, discount, amount, lot and balance after","tags":["billing"],"description":"IST dates, both included (default: the last 30 days); at most 366 days. Amounts are rupees with 2 decimals (no ₹, no grouping). UTF-8 with a BOM.","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false}],"responses":{"200":{"description":"The statement (CSV, UTF-8 with BOM)","content":{"text/csv":{"schema":{"type":"string","description":"CSV file"}}}},"400":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/calls":{"get":{"summary":"List calls, newest first","tags":["calls"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["inbound","outbound"]},"in":"query","name":"direction","required":false},{"schema":{"type":"string","enum":["queued","dialing","ringing","in_progress","completed","no_answer","busy","failed","canceled","rejected"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["ai","recorded","tts","forward"]},"in":"query","name":"kind","required":false},{"schema":{"type":"string","enum":["inbound","api","campaign","trigger","callback","test"]},"in":"query","name":"source","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"agent_id","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"number_id","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"campaign_id","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"contact_id","required":false},{"schema":{"type":"string","maxLength":60},"in":"query","name":"outcome","required":false},{"schema":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"in":"query","name":"analysis_status","required":false},{"schema":{"type":"string","enum":["attempted","connected","refused"]},"in":"query","name":"handover","required":false,"description":"attempted = the AI asked for a person; connected = a colleague picked up; refused = we could not allow it."},{"schema":{"type":"string","maxLength":40},"in":"query","name":"handover_department","required":false,"description":"The team key from the agent's hand-over settings."},{"schema":{"type":"string","maxLength":100},"in":"query","name":"external_ref","required":false},{"schema":{"type":"string","maxLength":40},"in":"query","name":"from","required":false,"description":"Calls created on/after this IST date (YYYY-MM-DD) or ISO time."},{"schema":{"type":"string","maxLength":40},"in":"query","name":"to","required":false,"description":"Calls created up to and including this IST date, or before this ISO time."},{"schema":{"type":"string","maxLength":32},"in":"query","name":"phone","required":false,"description":"Either party's number, any Indian format."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["queued","dialing","ringing","in_progress","completed","no_answer","busy","failed","canceled","rejected"]},"kind":{"type":"string","enum":["ai","recorded","tts","forward"]},"source":{"type":"string","enum":["inbound","api","campaign","trigger","callback","test"]},"number_id":{"nullable":true,"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"contact_id":{"nullable":true,"type":"string"},"agent_id":{"nullable":true,"type":"string"},"campaign_id":{"nullable":true,"type":"string"},"job_id":{"nullable":true,"type":"string"},"trigger_id":{"nullable":true,"type":"string"},"attempt":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"boolean"},"queued_at":{"nullable":true,"type":"string"},"dialed_at":{"nullable":true,"type":"string"},"answered_at":{"nullable":true,"type":"string"},"ended_at":{"nullable":true,"type":"string"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billable_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_reason":{"nullable":true,"type":"string"},"voicemail":{"type":"boolean"},"summary":{"nullable":true,"type":"string"},"outcome":{"nullable":true,"type":"string"},"fields":{"type":"object","additionalProperties":{}},"sentiment":{"nullable":true,"type":"string","enum":["positive","neutral","negative"]},"callback_at":{"nullable":true,"type":"string"},"recording":{"nullable":true,"type":"object","properties":{"available":{"type":"boolean"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"nullable":true,"type":"string"}},"required":["available","duration_s","expires_at"],"additionalProperties":false},"handover":{"nullable":true,"description":"Present once the AI has asked to hand the call to a person.","type":"object","properties":{"at":{"type":"string","description":"When the AI asked for a person."},"department":{"nullable":true,"description":"The team whose numbers rang. null = the agent's own hand-over list.","type":"string"},"department_label":{"nullable":true,"description":"That team's name as it was on the agent when the call came in.","type":"string"},"reason":{"nullable":true,"description":"The reason the AI gave, as the colleague heard it.","type":"string"},"refused":{"nullable":true,"description":"Set when we did not allow it: handover_off, no_number, in_debt, low_balance, call_ended, error. The AI then promised a call-back.","type":"string"},"connected":{"nullable":true,"description":"Did a person pick up? null until the carrier reports.","type":"boolean"}},"required":["at","department","department_label","reason","refused","connected"],"additionalProperties":false},"rate":{"nullable":true,"type":"object","properties":{"per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"handover_per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["per_min","parts","handover_per_min"],"additionalProperties":false},"analysis_status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"context":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost":{"type":"object","properties":{"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"charged":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["list","discount","charged"],"additionalProperties":false}},"required":["id","direction","status","kind","source","number_id","from","to","contact_id","agent_id","campaign_id","job_id","trigger_id","attempt","answered","queued_at","dialed_at","answered_at","ended_at","duration_s","billable_s","end_reason","voicemail","summary","outcome","fields","sentiment","callback_at","recording","handover","rate","analysis_status","context","external_ref","metadata","created_at","updated_at","cost"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Queue one outbound call","tags":["calls"],"description":"An AI conversation (agent_id) or a one-way message (message). The call is placed by the dialer inside your calling hours, after the compliance checks (DNC, platform blocklist, frequency caps, balance). Numbers that can never be called are refused now (422). Supports Idempotency-Key. Answers with the call (status queued).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"description":"The person to call: any Indian format (+91…, 0…, 10 digits).","type":"string","minLength":1,"maxLength":32},"agent_id":{"description":"An AI conversation by this agent …","type":"string","minLength":1,"maxLength":40},"message":{"description":"… or a one-way message: a recording (audio_file_id) or a script read aloud (text).","type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"required":["kind"],"additionalProperties":false},"from_number_id":{"description":"Caller id; default: your first active number.","type":"string","minLength":1,"maxLength":40},"contact":{"description":"Saved on the contact for this phone (created if new, source api).","type":"object","properties":{"name":{"nullable":true,"type":"string","maxLength":120},"attributes":{"type":"object","additionalProperties":{}}},"additionalProperties":false},"context":{"description":"Values for {{context.<key>}} in the agent's prompt or the script (≤ 50 keys).","type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"scheduled_at":{"description":"Earliest time to call (now … +30 days). Calls outside your calling hours wait for the next allowed time.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"max_attempts":{"default":1,"type":"integer","minimum":1,"maximum":5},"retry_gap_minutes":{"default":60,"type":"integer","minimum":15,"maximum":1440},"external_ref":{"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"required":["to"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["queued","dialing","ringing","in_progress","completed","no_answer","busy","failed","canceled","rejected"]},"kind":{"type":"string","enum":["ai","recorded","tts","forward"]},"source":{"type":"string","enum":["inbound","api","campaign","trigger","callback","test"]},"number_id":{"nullable":true,"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"contact_id":{"nullable":true,"type":"string"},"agent_id":{"nullable":true,"type":"string"},"campaign_id":{"nullable":true,"type":"string"},"job_id":{"nullable":true,"type":"string"},"trigger_id":{"nullable":true,"type":"string"},"attempt":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"boolean"},"queued_at":{"nullable":true,"type":"string"},"dialed_at":{"nullable":true,"type":"string"},"answered_at":{"nullable":true,"type":"string"},"ended_at":{"nullable":true,"type":"string"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billable_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_reason":{"nullable":true,"type":"string"},"voicemail":{"type":"boolean"},"summary":{"nullable":true,"type":"string"},"outcome":{"nullable":true,"type":"string"},"fields":{"type":"object","additionalProperties":{}},"sentiment":{"nullable":true,"type":"string","enum":["positive","neutral","negative"]},"callback_at":{"nullable":true,"type":"string"},"recording":{"nullable":true,"type":"object","properties":{"available":{"type":"boolean"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"nullable":true,"type":"string"}},"required":["available","duration_s","expires_at"],"additionalProperties":false},"handover":{"nullable":true,"description":"Present once the AI has asked to hand the call to a person.","type":"object","properties":{"at":{"type":"string","description":"When the AI asked for a person."},"department":{"nullable":true,"description":"The team whose numbers rang. null = the agent's own hand-over list.","type":"string"},"department_label":{"nullable":true,"description":"That team's name as it was on the agent when the call came in.","type":"string"},"reason":{"nullable":true,"description":"The reason the AI gave, as the colleague heard it.","type":"string"},"refused":{"nullable":true,"description":"Set when we did not allow it: handover_off, no_number, in_debt, low_balance, call_ended, error. The AI then promised a call-back.","type":"string"},"connected":{"nullable":true,"description":"Did a person pick up? null until the carrier reports.","type":"boolean"}},"required":["at","department","department_label","reason","refused","connected"],"additionalProperties":false},"rate":{"nullable":true,"type":"object","properties":{"per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"handover_per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["per_min","parts","handover_per_min"],"additionalProperties":false},"analysis_status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"context":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"transcript":{"nullable":true,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","caller"]},"text":{"type":"string"},"speaker":{"nullable":true,"type":"string"}},"required":["role","text"],"additionalProperties":false}},"transcription":{"type":"object","properties":{"status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"seconds":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["status","per_min","seconds","error"],"additionalProperties":false},"cost":{"type":"object","properties":{"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"charged":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"part":{"type":"string","enum":["minutes","handover","transcription"]},"lot_id":{"nullable":true,"type":"string"},"lot_tier":{"nullable":true,"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"paid":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"debt":{"type":"boolean"}},"required":["part","lot_id","lot_tier","discount_bp","list","discount","paid","debt"],"additionalProperties":false}}},"required":["list","discount","charged","lines"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"at":{"type":"string"}},"required":["event","at"],"additionalProperties":false}}},"required":["id","direction","status","kind","source","number_id","from","to","contact_id","agent_id","campaign_id","job_id","trigger_id","attempt","answered","queued_at","dialed_at","answered_at","ended_at","duration_s","billable_s","end_reason","voicemail","summary","outcome","fields","sentiment","callback_at","recording","handover","rate","analysis_status","context","external_ref","metadata","created_at","updated_at","transcript","transcription","cost","events"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/calls/live":{"get":{"summary":"Calls on the line now (dialing, ringing or in progress) and the account's lines","tags":["calls"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["queued","dialing","ringing","in_progress","completed","no_answer","busy","failed","canceled","rejected"]},"kind":{"type":"string","enum":["ai","recorded","tts","forward"]},"source":{"type":"string","enum":["inbound","api","campaign","trigger","callback","test"]},"number_id":{"nullable":true,"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"contact_id":{"nullable":true,"type":"string"},"agent_id":{"nullable":true,"type":"string"},"campaign_id":{"nullable":true,"type":"string"},"job_id":{"nullable":true,"type":"string"},"trigger_id":{"nullable":true,"type":"string"},"attempt":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"boolean"},"queued_at":{"nullable":true,"type":"string"},"dialed_at":{"nullable":true,"type":"string"},"answered_at":{"nullable":true,"type":"string"},"ended_at":{"nullable":true,"type":"string"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billable_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_reason":{"nullable":true,"type":"string"},"voicemail":{"type":"boolean"},"summary":{"nullable":true,"type":"string"},"outcome":{"nullable":true,"type":"string"},"fields":{"type":"object","additionalProperties":{}},"sentiment":{"nullable":true,"type":"string","enum":["positive","neutral","negative"]},"callback_at":{"nullable":true,"type":"string"},"recording":{"nullable":true,"type":"object","properties":{"available":{"type":"boolean"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"nullable":true,"type":"string"}},"required":["available","duration_s","expires_at"],"additionalProperties":false},"handover":{"nullable":true,"description":"Present once the AI has asked to hand the call to a person.","type":"object","properties":{"at":{"type":"string","description":"When the AI asked for a person."},"department":{"nullable":true,"description":"The team whose numbers rang. null = the agent's own hand-over list.","type":"string"},"department_label":{"nullable":true,"description":"That team's name as it was on the agent when the call came in.","type":"string"},"reason":{"nullable":true,"description":"The reason the AI gave, as the colleague heard it.","type":"string"},"refused":{"nullable":true,"description":"Set when we did not allow it: handover_off, no_number, in_debt, low_balance, call_ended, error. The AI then promised a call-back.","type":"string"},"connected":{"nullable":true,"description":"Did a person pick up? null until the carrier reports.","type":"boolean"}},"required":["at","department","department_label","reason","refused","connected"],"additionalProperties":false},"rate":{"nullable":true,"type":"object","properties":{"per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"handover_per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["per_min","parts","handover_per_min"],"additionalProperties":false},"analysis_status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"context":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost":{"type":"object","properties":{"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"charged":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["list","discount","charged"],"additionalProperties":false}},"required":["id","direction","status","kind","source","number_id","from","to","contact_id","agent_id","campaign_id","job_id","trigger_id","attempt","answered","queued_at","dialed_at","answered_at","ended_at","duration_s","billable_s","end_reason","voicemail","summary","outcome","fields","sentiment","callback_at","recording","handover","rate","analysis_status","context","external_ref","metadata","created_at","updated_at","cost"],"additionalProperties":false}},"lines":{"type":"object","properties":{"in_use":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["in_use","total"],"additionalProperties":false}},"required":["data","lines"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/calls/stats":{"get":{"summary":"Call KPIs for today and this month (IST): calls, answered, minutes billed, spend; plus the last 14 IST days","tags":["calls"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"today":{"type":"object","properties":{"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered_rate":{"nullable":true,"type":"number"},"billable_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes":{"type":"number"},"spend":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"handovers":{"type":"object","properties":{"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls where the AI asked for a person."},"connected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones where a colleague picked up (the carrier's own report)."},"refused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Asked for, but not allowed — no number, or the Prepaid Balance could not pay for it."},"by_department":{"type":"array","items":{"type":"object","properties":{"department":{"type":"string","description":"The team key."},"label":{"nullable":true,"description":"The team's name as it was on the agent when the call came in.","type":"string"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Hand-overs meant for this team, including any we refused."},"connected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones a colleague answered."},"refused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones we could not allow."}},"required":["department","label","calls","connected","refused"],"additionalProperties":false},"description":"Busiest team first. A hand-over that rang the agent's own list has no team and is not listed here."}},"required":["attempted","connected","refused","by_department"],"additionalProperties":false,"description":"Who the agent handed callers to."}},"required":["calls","answered","answered_rate","billable_seconds","minutes","spend","handovers"],"additionalProperties":false},"month":{"type":"object","properties":{"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered_rate":{"nullable":true,"type":"number"},"billable_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes":{"type":"number"},"spend":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"handovers":{"type":"object","properties":{"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls where the AI asked for a person."},"connected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones where a colleague picked up (the carrier's own report)."},"refused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Asked for, but not allowed — no number, or the Prepaid Balance could not pay for it."},"by_department":{"type":"array","items":{"type":"object","properties":{"department":{"type":"string","description":"The team key."},"label":{"nullable":true,"description":"The team's name as it was on the agent when the call came in.","type":"string"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Hand-overs meant for this team, including any we refused."},"connected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones a colleague answered."},"refused":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones we could not allow."}},"required":["department","label","calls","connected","refused"],"additionalProperties":false},"description":"Busiest team first. A hand-over that rang the agent's own list has no team and is not listed here."}},"required":["attempted","connected","refused","by_department"],"additionalProperties":false,"description":"Who the agent handed callers to."}},"required":["calls","answered","answered_rate","billable_seconds","minutes","spend","handovers"],"additionalProperties":false},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"IST day, YYYY-MM-DD"},"calls":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"minutes":{"type":"number"},"spend":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["date","calls","answered","minutes","spend"],"additionalProperties":false}},"as_of":{"type":"string"}},"required":["today","month","daily","as_of"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/calls/{id}":{"get":{"summary":"One call: transcript, analysis, recording, exact cost and timeline","tags":["calls"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["queued","dialing","ringing","in_progress","completed","no_answer","busy","failed","canceled","rejected"]},"kind":{"type":"string","enum":["ai","recorded","tts","forward"]},"source":{"type":"string","enum":["inbound","api","campaign","trigger","callback","test"]},"number_id":{"nullable":true,"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"contact_id":{"nullable":true,"type":"string"},"agent_id":{"nullable":true,"type":"string"},"campaign_id":{"nullable":true,"type":"string"},"job_id":{"nullable":true,"type":"string"},"trigger_id":{"nullable":true,"type":"string"},"attempt":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"boolean"},"queued_at":{"nullable":true,"type":"string"},"dialed_at":{"nullable":true,"type":"string"},"answered_at":{"nullable":true,"type":"string"},"ended_at":{"nullable":true,"type":"string"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billable_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_reason":{"nullable":true,"type":"string"},"voicemail":{"type":"boolean"},"summary":{"nullable":true,"type":"string"},"outcome":{"nullable":true,"type":"string"},"fields":{"type":"object","additionalProperties":{}},"sentiment":{"nullable":true,"type":"string","enum":["positive","neutral","negative"]},"callback_at":{"nullable":true,"type":"string"},"recording":{"nullable":true,"type":"object","properties":{"available":{"type":"boolean"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"nullable":true,"type":"string"}},"required":["available","duration_s","expires_at"],"additionalProperties":false},"handover":{"nullable":true,"description":"Present once the AI has asked to hand the call to a person.","type":"object","properties":{"at":{"type":"string","description":"When the AI asked for a person."},"department":{"nullable":true,"description":"The team whose numbers rang. null = the agent's own hand-over list.","type":"string"},"department_label":{"nullable":true,"description":"That team's name as it was on the agent when the call came in.","type":"string"},"reason":{"nullable":true,"description":"The reason the AI gave, as the colleague heard it.","type":"string"},"refused":{"nullable":true,"description":"Set when we did not allow it: handover_off, no_number, in_debt, low_balance, call_ended, error. The AI then promised a call-back.","type":"string"},"connected":{"nullable":true,"description":"Did a person pick up? null until the carrier reports.","type":"boolean"}},"required":["at","department","department_label","reason","refused","connected"],"additionalProperties":false},"rate":{"nullable":true,"type":"object","properties":{"per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"handover_per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["per_min","parts","handover_per_min"],"additionalProperties":false},"analysis_status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"context":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"transcript":{"nullable":true,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","caller"]},"text":{"type":"string"},"speaker":{"nullable":true,"type":"string"}},"required":["role","text"],"additionalProperties":false}},"transcription":{"type":"object","properties":{"status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"seconds":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["status","per_min","seconds","error"],"additionalProperties":false},"cost":{"type":"object","properties":{"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"charged":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"part":{"type":"string","enum":["minutes","handover","transcription"]},"lot_id":{"nullable":true,"type":"string"},"lot_tier":{"nullable":true,"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"paid":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"debt":{"type":"boolean"}},"required":["part","lot_id","lot_tier","discount_bp","list","discount","paid","debt"],"additionalProperties":false}}},"required":["list","discount","charged","lines"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"at":{"type":"string"}},"required":["event","at"],"additionalProperties":false}}},"required":["id","direction","status","kind","source","number_id","from","to","contact_id","agent_id","campaign_id","job_id","trigger_id","attempt","answered","queued_at","dialed_at","answered_at","ended_at","duration_s","billable_s","end_reason","voicemail","summary","outcome","fields","sentiment","callback_at","recording","handover","rate","analysis_status","context","external_ref","metadata","created_at","updated_at","transcript","transcription","cost","events"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Cancel a call that is still waiting to be placed","tags":["calls"],"description":"Works while the call is queued or waiting for a retry. 409 once it is being placed or has finished.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["queued","dialing","ringing","in_progress","completed","no_answer","busy","failed","canceled","rejected"]},"kind":{"type":"string","enum":["ai","recorded","tts","forward"]},"source":{"type":"string","enum":["inbound","api","campaign","trigger","callback","test"]},"number_id":{"nullable":true,"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"contact_id":{"nullable":true,"type":"string"},"agent_id":{"nullable":true,"type":"string"},"campaign_id":{"nullable":true,"type":"string"},"job_id":{"nullable":true,"type":"string"},"trigger_id":{"nullable":true,"type":"string"},"attempt":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"boolean"},"queued_at":{"nullable":true,"type":"string"},"dialed_at":{"nullable":true,"type":"string"},"answered_at":{"nullable":true,"type":"string"},"ended_at":{"nullable":true,"type":"string"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billable_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_reason":{"nullable":true,"type":"string"},"voicemail":{"type":"boolean"},"summary":{"nullable":true,"type":"string"},"outcome":{"nullable":true,"type":"string"},"fields":{"type":"object","additionalProperties":{}},"sentiment":{"nullable":true,"type":"string","enum":["positive","neutral","negative"]},"callback_at":{"nullable":true,"type":"string"},"recording":{"nullable":true,"type":"object","properties":{"available":{"type":"boolean"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"nullable":true,"type":"string"}},"required":["available","duration_s","expires_at"],"additionalProperties":false},"handover":{"nullable":true,"description":"Present once the AI has asked to hand the call to a person.","type":"object","properties":{"at":{"type":"string","description":"When the AI asked for a person."},"department":{"nullable":true,"description":"The team whose numbers rang. null = the agent's own hand-over list.","type":"string"},"department_label":{"nullable":true,"description":"That team's name as it was on the agent when the call came in.","type":"string"},"reason":{"nullable":true,"description":"The reason the AI gave, as the colleague heard it.","type":"string"},"refused":{"nullable":true,"description":"Set when we did not allow it: handover_off, no_number, in_debt, low_balance, call_ended, error. The AI then promised a call-back.","type":"string"},"connected":{"nullable":true,"description":"Did a person pick up? null until the carrier reports.","type":"boolean"}},"required":["at","department","department_label","reason","refused","connected"],"additionalProperties":false},"rate":{"nullable":true,"type":"object","properties":{"per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"handover_per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["per_min","parts","handover_per_min"],"additionalProperties":false},"analysis_status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"context":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"transcript":{"nullable":true,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","caller"]},"text":{"type":"string"},"speaker":{"nullable":true,"type":"string"}},"required":["role","text"],"additionalProperties":false}},"transcription":{"type":"object","properties":{"status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"seconds":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["status","per_min","seconds","error"],"additionalProperties":false},"cost":{"type":"object","properties":{"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"charged":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"part":{"type":"string","enum":["minutes","handover","transcription"]},"lot_id":{"nullable":true,"type":"string"},"lot_tier":{"nullable":true,"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"paid":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"debt":{"type":"boolean"}},"required":["part","lot_id","lot_tier","discount_bp","list","discount","paid","debt"],"additionalProperties":false}}},"required":["list","discount","charged","lines"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"at":{"type":"string"}},"required":["event","at"],"additionalProperties":false}}},"required":["id","direction","status","kind","source","number_id","from","to","contact_id","agent_id","campaign_id","job_id","trigger_id","attempt","answered","queued_at","dialed_at","answered_at","ended_at","duration_s","billable_s","end_reason","voicemail","summary","outcome","fields","sentiment","callback_at","recording","handover","rate","analysis_status","context","external_ref","metadata","created_at","updated_at","transcript","transcription","cost","events"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/calls/{id}/recording":{"get":{"summary":"A short-lived link to the call's recording","tags":["calls"],"description":"The link works without a login for 5 minutes. Ask again for a new one.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","expires_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{id}/test-call":{"post":{"summary":"Test call: the agent rings a number you choose (dashboard session)","tags":["agents"],"description":"Places a real call from one of the account's numbers to the number you give, through the same compliance gate as every call (Indian numbers only, 09:00–21:00 IST, do-not-call list, platform blocklist, balance). Billed at the agent's rate. The number is not stored on your profile. Idempotency-Key supported.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","minLength":1,"maxLength":32},"number_id":{"type":"string","maxLength":40}},"required":["to"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"status":{"type":"string","enum":["queued","dialing","ringing","in_progress","completed","no_answer","busy","failed","canceled","rejected"]},"kind":{"type":"string","enum":["ai","recorded","tts","forward"]},"source":{"type":"string","enum":["inbound","api","campaign","trigger","callback","test"]},"number_id":{"nullable":true,"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"contact_id":{"nullable":true,"type":"string"},"agent_id":{"nullable":true,"type":"string"},"campaign_id":{"nullable":true,"type":"string"},"job_id":{"nullable":true,"type":"string"},"trigger_id":{"nullable":true,"type":"string"},"attempt":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"boolean"},"queued_at":{"nullable":true,"type":"string"},"dialed_at":{"nullable":true,"type":"string"},"answered_at":{"nullable":true,"type":"string"},"ended_at":{"nullable":true,"type":"string"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"billable_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"end_reason":{"nullable":true,"type":"string"},"voicemail":{"type":"boolean"},"summary":{"nullable":true,"type":"string"},"outcome":{"nullable":true,"type":"string"},"fields":{"type":"object","additionalProperties":{}},"sentiment":{"nullable":true,"type":"string","enum":["positive","neutral","negative"]},"callback_at":{"nullable":true,"type":"string"},"recording":{"nullable":true,"type":"object","properties":{"available":{"type":"boolean"},"duration_s":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expires_at":{"nullable":true,"type":"string"}},"required":["available","duration_s","expires_at"],"additionalProperties":false},"handover":{"nullable":true,"description":"Present once the AI has asked to hand the call to a person.","type":"object","properties":{"at":{"type":"string","description":"When the AI asked for a person."},"department":{"nullable":true,"description":"The team whose numbers rang. null = the agent's own hand-over list.","type":"string"},"department_label":{"nullable":true,"description":"That team's name as it was on the agent when the call came in.","type":"string"},"reason":{"nullable":true,"description":"The reason the AI gave, as the colleague heard it.","type":"string"},"refused":{"nullable":true,"description":"Set when we did not allow it: handover_off, no_number, in_debt, low_balance, call_ended, error. The AI then promised a call-back.","type":"string"},"connected":{"nullable":true,"description":"Did a person pick up? null until the carrier reports.","type":"boolean"}},"required":["at","department","department_label","reason","refused","connected"],"additionalProperties":false},"rate":{"nullable":true,"type":"object","properties":{"per_min":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"parts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"label":{"type":"string"},"amount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["code","label","amount"],"additionalProperties":false}},"handover_per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false}},"required":["per_min","parts","handover_per_min"],"additionalProperties":false},"analysis_status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"context":{"type":"object","additionalProperties":{}},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"transcript":{"nullable":true,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["agent","caller"]},"text":{"type":"string"},"speaker":{"nullable":true,"type":"string"}},"required":["role","text"],"additionalProperties":false}},"transcription":{"type":"object","properties":{"status":{"type":"string","enum":["none","pending","running","done","failed","skipped"]},"per_min":{"nullable":true,"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"seconds":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"nullable":true,"type":"string"}},"required":["status","per_min","seconds","error"],"additionalProperties":false},"cost":{"type":"object","properties":{"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"charged":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"part":{"type":"string","enum":["minutes","handover","transcription"]},"lot_id":{"nullable":true,"type":"string"},"lot_tier":{"nullable":true,"type":"string"},"discount_bp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"list":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"discount":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"paid":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"debt":{"type":"boolean"}},"required":["part","lot_id","lot_tier","discount_bp","list","discount","paid","debt"],"additionalProperties":false}}},"required":["list","discount","charged","lines"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"at":{"type":"string"}},"required":["event","at"],"additionalProperties":false}}},"required":["id","direction","status","kind","source","number_id","from","to","contact_id","agent_id","campaign_id","job_id","trigger_id","attempt","answered","queued_at","dialed_at","answered_at","ended_at","duration_s","billable_s","end_reason","voicemail","summary","outcome","fields","sentiment","callback_at","recording","handover","rate","analysis_status","context","external_ref","metadata","created_at","updated_at","transcript","transcription","cost","events"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/attestation":{"get":{"summary":"The service/transactional attestation every campaign stores (show it, then send its version)","tags":["campaigns"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"text":{"type":"string"}},"required":["version","text"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns":{"get":{"summary":"List campaigns (newest first) with live counters","tags":["campaigns"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["ai","recorded","tts"]},"in":"query","name":"type","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"external_ref","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a campaign (draft)","tags":["campaigns"],"description":"Service and transactional calls only: send the ticked attestation with the version from GET /v1/campaigns/attestation. Marketing is refused (422 marketing_not_allowed). Start it with POST /v1/campaigns/{id}/start. Supports Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","minLength":1,"maxLength":40,"description":"service | transactional. Marketing is refused."},"agent_id":{"description":"type ai: the agent that makes the calls.","nullable":true,"type":"string","minLength":1,"maxLength":40},"ab_test":{"description":"type ai: a second agent and the share of calls it makes.","nullable":true,"type":"object","properties":{"agent_id":{"type":"string","minLength":1,"maxLength":40},"split_percent":{"type":"integer","minimum":1,"maximum":99}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"description":"type recorded: {audio_file_id}; type tts: {text, voice_id?, language}.","nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"additionalProperties":false},"context":{"description":"{{context.<key>}} values for every call.","type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"from_number_id":{"description":"The caller id; null = your first active number when the campaign starts.","nullable":true,"type":"string","minLength":1,"maxLength":40},"audience":{"type":"object","properties":{"list_ids":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"tags":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"contact_ids":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"phones":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","maxLength":32}}},"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"description":"When calling may begin; null = as soon as the campaign is started.","nullable":true,"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"stop_at":{"description":"Nobody new is called after this; unfinished people are canceled.","nullable":true,"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"window_start":{"description":"Daily start, HH:MM IST, inside the account's calling hours. null = the account's.","nullable":true,"type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"window_end":{"nullable":true,"type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"days":{"description":"Weekdays to call on; null = every calling day of the account.","nullable":true,"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["sun","mon","tue","wed","thu","fri","sat"]}},"max_concurrent":{"type":"integer","minimum":1,"maximum":50},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_gap_minutes":{"type":"integer","minimum":15,"maximum":10080},"retry_on":{"description":"Results that get another attempt.","maxItems":3,"type":"array","items":{"type":"string","enum":["no_answer","busy","failed"]}}},"additionalProperties":false},"attestation":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"version":{"type":"string","minLength":1,"maxLength":40}},"required":["accepted","version"],"additionalProperties":false},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"required":["name","type","call_purpose","audience","attestation"],"additionalProperties":false}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/preview":{"post":{"summary":"Who would be called and what it may cost (nothing is saved)","tags":["campaigns"],"description":"Audience counts after removing repeats, invalid numbers, the do-not-call list and the platform blocklist; an estimate range from the per-minute rate; problems that would stop a start.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["ai","recorded","tts"]},"agent_id":{"description":"type ai: the agent that makes the calls.","nullable":true,"type":"string","minLength":1,"maxLength":40},"ab_test":{"description":"type ai: a second agent and the share of calls it makes.","nullable":true,"type":"object","properties":{"agent_id":{"type":"string","minLength":1,"maxLength":40},"split_percent":{"type":"integer","minimum":1,"maximum":99}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"description":"type recorded: {audio_file_id}; type tts: {text, voice_id?, language}.","nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"additionalProperties":false},"audience":{"type":"object","properties":{"list_ids":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"tags":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"contact_ids":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"phones":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","maxLength":32}}},"additionalProperties":false},"schedule":{"type":"object","properties":{"max_concurrent":{"type":"integer","minimum":1,"maximum":50}},"additionalProperties":false}},"required":["type","audience"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"missing_list_ids":{"type":"array","items":{"type":"string"}},"too_large":{"type":"boolean"},"limit":{"type":"object","properties":{"max_recipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"new_account_cap":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_recipients","new_account_cap"],"additionalProperties":false},"estimate":{"nullable":true,"type":"object","properties":{"rate_per_minute":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"low":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"high":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"assumptions":{"type":"string"}},"required":["rate_per_minute","low","high","assumptions"],"additionalProperties":false},"balance":{"type":"object","properties":{"available":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"debt":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"covers_low":{"type":"boolean"},"covers_high":{"type":"boolean"},"minimum":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"The balance a campaign with this audience needs before it can be created (the low estimate)."},"covers_minimum":{"type":"boolean","description":"False: POST /v1/campaigns refuses with 409 balance_too_low_for_campaign."},"shortfall":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false,"description":"How much to recharge to reach the minimum (₹0 when it is covered)."}},"required":["available","debt","covers_low","covers_high","minimum","covers_minimum","shortfall"],"additionalProperties":false},"problems":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"nullable":true,"type":"string"}},"required":["code","message","field"],"additionalProperties":false}}},"required":["counts","missing_list_ids","too_large","limit","estimate","balance","problems"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}":{"get":{"summary":"Get a campaign with live counters","tags":["campaigns"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change a campaign","tags":["campaigns"],"description":"Everything can change while it is a draft or scheduled. A paused campaign that already started calling may change its name, agent, A/B agent, number, context, schedule (not start_at) and metadata; people still waiting follow the change. 409 campaign_locked otherwise.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","minLength":1,"maxLength":40},"agent_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string","minLength":1,"maxLength":40},"split_percent":{"type":"integer","minimum":1,"maximum":99}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"additionalProperties":false},"context":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"from_number_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"audience":{"type":"object","properties":{"list_ids":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"tags":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"contact_ids":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"phones":{"default":[],"maxItems":1000,"type":"array","items":{"type":"string","maxLength":32}}},"additionalProperties":false},"schedule":{"description":"Merged field by field.","type":"object","properties":{"start_at":{"description":"When calling may begin; null = as soon as the campaign is started.","nullable":true,"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"stop_at":{"description":"Nobody new is called after this; unfinished people are canceled.","nullable":true,"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"window_start":{"description":"Daily start, HH:MM IST, inside the account's calling hours. null = the account's.","nullable":true,"type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"window_end":{"nullable":true,"type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"days":{"description":"Weekdays to call on; null = every calling day of the account.","nullable":true,"minItems":1,"maxItems":7,"type":"array","items":{"type":"string","enum":["sun","mon","tue","wed","thu","fri","sat"]}},"max_concurrent":{"type":"integer","minimum":1,"maximum":50},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"retry_gap_minutes":{"type":"integer","minimum":15,"maximum":10080},"retry_on":{"description":"Results that get another attempt.","maxItems":3,"type":"array","items":{"type":"string","enum":["no_answer","busy","failed"]}}},"additionalProperties":false},"attestation":{"description":"Tick again (e.g. after the text changed).","type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"version":{"type":"string","minLength":1,"maxLength":40}},"required":["accepted","version"],"additionalProperties":false},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}/start":{"post":{"summary":"Start a draft campaign","tags":["campaigns"],"description":"Checks the agent or message, the number, the calling hours, the audience (422 list_not_found, audience_empty, recipient_cap, audience_too_large) and the balance for the first calls (409 balance_too_low / in_debt). Starts calling now, or at schedule.start_at.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}/pause":{"post":{"summary":"Pause a running or scheduled campaign","tags":["campaigns"],"description":"Calls already ringing finish; nobody new is called. A campaign you pause never resumes on its own.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}/resume":{"post":{"summary":"Resume a paused campaign","tags":["campaigns"],"description":"Checks again that it can call (agent, number, hours, balance). A campaign paused because the Prepaid Balance ran out resumes by itself after a recharge.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}/cancel":{"post":{"summary":"Cancel a campaign","tags":["campaigns"],"description":"People not yet called are canceled; calls already ringing finish. Final.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ai","recorded","tts"]},"call_purpose":{"type":"string","enum":["service","transactional"]},"status":{"type":"string","enum":["draft","scheduled","running","paused","completed","canceled"]},"pause":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"resumes_automatically":{"type":"boolean","description":"True when it paused itself for lack of balance: a recharge starts it again on its own."},"resume_hint":{"type":"string","description":"What will bring it back, in plain words."}},"required":["code","message","resumes_automatically","resume_hint"],"additionalProperties":false},"agent_id":{"nullable":true,"type":"string"},"ab_test":{"nullable":true,"type":"object","properties":{"agent_id":{"type":"string"},"split_percent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","split_percent"],"additionalProperties":false},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"context":{"type":"object","additionalProperties":{}},"from_number_id":{"nullable":true,"type":"string"},"audience":{"type":"object","properties":{"list_ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"contact_ids":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}}},"required":["list_ids","tags","contact_ids","phones"],"additionalProperties":false},"schedule":{"type":"object","properties":{"start_at":{"nullable":true,"type":"string"},"stop_at":{"nullable":true,"type":"string"},"window_start":{"nullable":true,"type":"string"},"window_end":{"nullable":true,"type":"string"},"days":{"nullable":true,"type":"array","items":{"type":"string"}},"max_concurrent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_gap_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"retry_on":{"type":"array","items":{"type":"string"}}},"required":["start_at","stop_at","window_start","window_end","days","max_concurrent","max_attempts","retry_gap_minutes","retry_on"],"additionalProperties":false},"attestation":{"type":"object","properties":{"version":{"type":"string"},"accepted_at":{"type":"string"},"accepted_by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false}},"required":["version","accepted_at","accepted_by"],"additionalProperties":false},"counters":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Waiting for their first call or a retry (includes waiting_retry)."},"dialing":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Finished, whatever the result (the progress)."},"no_answer":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: no answer (or voicemail) on the last attempt, no attempts left."},"busy":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: busy on the last attempt, no attempts left."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Final: failed, or could not be placed."},"opted_out":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"spent":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"waiting_retry":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Called, not reached yet, and waiting for their next attempt (part of queued)."},"attempted":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"People called at least once."},"by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agent_id","total","answered"],"additionalProperties":false}}},"required":["total","queued","dialing","answered","completed","no_answer","busy","failed","opted_out","blocked","canceled","spent","waiting_retry","attempted","by_agent"],"additionalProperties":false},"snapshot":{"nullable":true,"description":"Audience counts when calling began.","type":"object","properties":{"selected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"callable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missing_contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["selected","duplicates","invalid","dnc","blocked","callable","missing_contacts"],"additionalProperties":false},"launched_at":{"nullable":true,"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"canceled_at":{"nullable":true,"type":"string"},"auto_resumed_at":{"nullable":true,"description":"The last time it started again by itself after a recharge.","type":"string"},"auto_resume_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","call_purpose","status","pause","agent_id","ab_test","message","context","from_number_id","audience","schedule","attestation","counters","snapshot","launched_at","started_at","completed_at","canceled_at","auto_resumed_at","auto_resume_count","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}/history":{"get":{"summary":"What happened to this campaign, newest first (including what the system did on its own)","tags":["campaigns"],"description":"created, started, paused / resumed (by a person), auto_paused / auto_resumed (by the system — for example paused when the Prepaid Balance ran out and started again by itself after a recharge), completed, canceled.","parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["created","started","paused","auto_paused","resumed","auto_resumed","completed","canceled"],"description":"auto_paused / auto_resumed: the system did it, not a person."},"code":{"nullable":true,"description":"The reason code (the pause code, for example).","type":"string"},"message":{"nullable":true,"type":"string"},"by":{"type":"object","properties":{"type":{"type":"string"},"id":{"nullable":true,"type":"string"}},"required":["type","id"],"additionalProperties":false},"data":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"}},"required":["id","kind","code","message","by","data","created_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}/recipients":{"get":{"summary":"The campaign's people, in dialling order","tags":["campaigns"],"description":"Cursor page ordered by id ascending (the order they are called in).","parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["queued","waiting_retry","dialing","answered","no_answer","busy","failed","blocked","canceled"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"phone":{"type":"string"},"contact_id":{"nullable":true,"type":"string"},"name":{"nullable":true,"type":"string"},"status":{"type":"string","enum":["queued","waiting_retry","dialing","answered","no_answer","busy","failed","blocked","canceled"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"next_attempt_at":{"nullable":true,"type":"string"},"last_result":{"nullable":true,"type":"string"},"reason":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"nullable":true,"type":"string"}},"required":["code","message"],"additionalProperties":false},"outcome":{"nullable":true,"type":"string"},"fields":{"nullable":true,"type":"object","additionalProperties":{}},"opted_out":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string"},"variant":{"nullable":true,"type":"string"},"call_id":{"nullable":true,"type":"string"},"cost":{"type":"object","properties":{"paise":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"display":{"type":"string"}},"required":["paise","display"],"additionalProperties":false},"updated_at":{"type":"string"},"finished_at":{"nullable":true,"type":"string"}},"required":["id","phone","contact_id","name","status","attempts","max_attempts","next_attempt_at","last_result","reason","outcome","fields","opted_out","agent_id","variant","call_id","cost","updated_at","finished_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/campaigns/{id}/export.csv":{"get":{"summary":"Download the campaign's results as CSV","tags":["campaigns"],"description":"text/csv, UTF-8 with a byte-order mark. One row per person: status, attempts, result, outcome, captured fields (one column each), cost.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"CSV text","content":{"text/csv":{"schema":{"type":"string","description":"CSV text"}}}},"400":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"text/csv":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/triggers":{"get":{"summary":"List triggers (newest first) with today's fires","tags":["triggers"],"parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["webhook","missed_call","date_field","outcome_retry"]},"in":"query","name":"type","required":false},{"schema":{"type":"string","minLength":1,"maxLength":100},"in":"query","name":"external_ref","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["webhook","missed_call","date_field","outcome_retry"]},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string"},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string"},"daily_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_busy":{"type":"string","enum":["skip","retry"],"description":"What happens when every one of your lines is busy."},"retry_after_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"on_busy \"retry\": minutes before the next try."},"config":{"type":"object","additionalProperties":{}},"webhook":{"nullable":true,"type":"object","properties":{"token_prefix":{"type":"string"},"url_prefix":{"type":"string"},"token_rotated_at":{"nullable":true,"type":"string"}},"required":["token_prefix","url_prefix","token_rotated_at"],"additionalProperties":false},"today":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls put off today because every line was busy."}},"required":["queued","skipped","rejected","delayed"],"additionalProperties":false},"last_fired_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","enabled","agent_id","message","from_number_id","daily_limit","max_attempts","on_busy","retry_after_minutes","config","webhook","today","last_fired_at","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a trigger","tags":["triggers"],"description":"webhook: POST JSON to the returned url (shown once) to queue a call. missed_call: call back callers nobody answered. date_field: call when a contact's date attribute comes. outcome_retry: call again after a chosen outcome or when the AI recorded a time. Supports Idempotency-Key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"required":["kind"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"daily_limit":{"type":"integer","minimum":1,"maximum":10000},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"on_busy":{"description":"When every one of your lines is busy: skip this call, or try again after retry_after_minutes (the default).","type":"string","enum":["skip","retry"]},"retry_after_minutes":{"description":"on_busy \"retry\": minutes before the next try, at most 3 tries (then the call is given up).","type":"integer","minimum":1,"maximum":180},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"config":{"type":"object","properties":{"phone_path":{"type":"string","maxLength":300,"description":"Where the phone number is in the posted JSON, e.g. lead.phone."},"name_path":{"nullable":true,"type":"string","maxLength":300},"external_ref_path":{"description":"A value that identifies the event (e.g. the lead id): the same value is called once.","nullable":true,"type":"string","maxLength":300},"context_paths":{"description":"{{context.<name>}} → dot path.","type":"object","additionalProperties":{"type":"string","maxLength":300}},"attribute_paths":{"description":"Contact attribute → dot path (saved on the contact).","type":"object","additionalProperties":{"type":"string","maxLength":300}},"delay_minutes":{"default":0,"type":"integer","minimum":0,"maximum":10080}},"required":["phone_path"],"additionalProperties":false}},"required":["type","name","config"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["missed_call"]},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"required":["kind"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"daily_limit":{"type":"integer","minimum":1,"maximum":10000},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"on_busy":{"description":"When every one of your lines is busy: skip this call, or try again after retry_after_minutes (the default).","type":"string","enum":["skip","retry"]},"retry_after_minutes":{"description":"on_busy \"retry\": minutes before the next try, at most 3 tries (then the call is given up).","type":"integer","minimum":1,"maximum":180},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"config":{"default":{"delay_minutes":5,"once_per_hours":24,"number_ids":[]},"type":"object","properties":{"delay_minutes":{"default":5,"description":"Call back this many minutes after the missed call (inside your calling hours).","type":"integer","minimum":1,"maximum":1440},"once_per_hours":{"default":24,"description":"Call back the same caller at most once in this many hours.","type":"integer","minimum":1,"maximum":168},"number_ids":{"default":[],"description":"Only missed calls to these numbers; empty = all numbers.","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"additionalProperties":false}},"required":["type","name"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["date_field"]},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"required":["kind"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"daily_limit":{"type":"integer","minimum":1,"maximum":10000},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"on_busy":{"description":"When every one of your lines is busy: skip this call, or try again after retry_after_minutes (the default).","type":"string","enum":["skip","retry"]},"retry_after_minutes":{"description":"on_busy \"retry\": minutes before the next try, at most 3 tries (then the call is given up).","type":"integer","minimum":1,"maximum":180},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"config":{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"offset_minutes":{"default":0,"description":"Negative = before the date, positive = after.","type":"integer","minimum":-43200,"maximum":43200},"time_of_day":{"default":"10:00","description":"For _date attributes: the IST time the date counts from.","type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"lookback_hours":{"default":6,"description":"Never call for a time older than this (e.g. after the trigger was off).","type":"integer","minimum":1,"maximum":72}},"required":["attribute"],"additionalProperties":false}},"required":["type","name","config"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["outcome_retry"]},"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"required":["kind"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"daily_limit":{"type":"integer","minimum":1,"maximum":10000},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"on_busy":{"description":"When every one of your lines is busy: skip this call, or try again after retry_after_minutes (the default).","type":"string","enum":["skip","retry"]},"retry_after_minutes":{"description":"on_busy \"retry\": minutes before the next try, at most 3 tries (then the call is given up).","type":"integer","minimum":1,"maximum":180},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"config":{"type":"object","properties":{"outcomes":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"}},"use_callback_at":{"default":true,"description":"Call again at the time the AI recorded (callback_at).","type":"boolean"},"delay_hours":{"default":24,"description":"Otherwise call again this many hours later.","type":"integer","minimum":1,"maximum":168},"max_retries":{"default":2,"description":"At most this many calls from this trigger to one person in 30 days.","type":"integer","minimum":1,"maximum":5}},"additionalProperties":false}},"required":["type","name","config"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["webhook","missed_call","date_field","outcome_retry"]},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string"},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string"},"daily_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_busy":{"type":"string","enum":["skip","retry"],"description":"What happens when every one of your lines is busy."},"retry_after_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"on_busy \"retry\": minutes before the next try."},"config":{"type":"object","additionalProperties":{}},"webhook":{"nullable":true,"type":"object","properties":{"token_prefix":{"type":"string"},"url_prefix":{"type":"string"},"token_rotated_at":{"nullable":true,"type":"string"}},"required":["token_prefix","url_prefix","token_rotated_at"],"additionalProperties":false},"today":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls put off today because every line was busy."}},"required":["queued","skipped","rejected","delayed"],"additionalProperties":false},"last_fired_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"token":{"description":"Webhook triggers: shown only now. Keep it secret.","type":"string"},"url":{"description":"Webhook triggers: POST JSON here. Shown only now.","type":"string"}},"required":["id","name","type","enabled","agent_id","message","from_number_id","daily_limit","max_attempts","on_busy","retry_after_minutes","config","webhook","today","last_fired_at","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/triggers/preview":{"post":{"summary":"Who a date-field trigger would call in the next 24 hours (nothing is saved)","tags":["triggers"],"description":"Counts the contacts whose date attribute (± the offset) is due now (inside the look-back) or comes due in the next 24 hours, without the do-not-call list and the platform blocklist, and shows the first five with the time each call would really go.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["date_field"]},"config":{"type":"object","properties":{"attribute":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"offset_minutes":{"default":0,"description":"Negative = before the date, positive = after.","type":"integer","minimum":-43200,"maximum":43200},"time_of_day":{"default":"10:00","description":"For _date attributes: the IST time the date counts from.","type":"string","pattern":"^([01]\\d|2[0-3]):(00|30)$"},"lookback_hours":{"default":6,"description":"Never call for a time older than this (e.g. after the trigger was off).","type":"integer","minimum":1,"maximum":72}},"required":["attribute"],"additionalProperties":false},"daily_limit":{"description":"Shows whether the next 24 hours fit in it.","type":"integer","minimum":1,"maximum":10000},"trigger_id":{"description":"A saved trigger: people it already called for the same date are left out, and today's calls count against the daily limit.","type":"string","minLength":1,"maxLength":40}},"required":["type","config"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"as_of":{"type":"string"},"until":{"type":"string","description":"as_of + 24 hours."},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Contacts that would be called: due now (inside the look-back) or coming due before `until`."},"due_now":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"upcoming":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_dnc":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Left out: on your do-not-call list."},"blocked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Left out: on the platform blocklist."},"daily_limit":{"nullable":true,"description":"The calls left today under the daily limit (the limit itself for an unsaved trigger).","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"over_daily_limit":{"type":"boolean"},"first_at":{"nullable":true,"type":"string"},"next":{"type":"array","items":{"type":"object","properties":{"contact_id":{"type":"string"},"name":{"nullable":true,"type":"string"},"phone":{"type":"string"},"due_at":{"type":"string"},"call_at":{"type":"string","description":"When the call would really go (inside your calling hours)."}},"required":["contact_id","name","phone","due_at","call_at"],"additionalProperties":false},"description":"The first five."}},"required":["as_of","until","count","due_now","upcoming","on_dnc","blocked","daily_limit","over_daily_limit","first_at","next"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/triggers/{id}":{"get":{"summary":"Get a trigger","tags":["triggers"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["webhook","missed_call","date_field","outcome_retry"]},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string"},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string"},"daily_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_busy":{"type":"string","enum":["skip","retry"],"description":"What happens when every one of your lines is busy."},"retry_after_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"on_busy \"retry\": minutes before the next try."},"config":{"type":"object","additionalProperties":{}},"webhook":{"nullable":true,"type":"object","properties":{"token_prefix":{"type":"string"},"url_prefix":{"type":"string"},"token_rotated_at":{"nullable":true,"type":"string"}},"required":["token_prefix","url_prefix","token_rotated_at"],"additionalProperties":false},"today":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls put off today because every line was busy."}},"required":["queued","skipped","rejected","delayed"],"additionalProperties":false},"last_fired_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","enabled","agent_id","message","from_number_id","daily_limit","max_attempts","on_busy","retry_after_minutes","config","webhook","today","last_fired_at","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Change a trigger","tags":["triggers"],"description":"Fields replace; config is merged key by key and checked against the trigger's type (the type can't change). Calls already queued keep their settings.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"type":"string","maxLength":1000},"audio_file_id":{"type":"string","maxLength":40},"voice_id":{"type":"string","maxLength":60},"language":{"type":"string","maxLength":10}},"required":["kind"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string","minLength":1,"maxLength":40},"daily_limit":{"type":"integer","minimum":1,"maximum":10000},"max_attempts":{"type":"integer","minimum":1,"maximum":5},"on_busy":{"description":"When every one of your lines is busy: skip this call, or try again after retry_after_minutes (the default).","type":"string","enum":["skip","retry"]},"retry_after_minutes":{"description":"on_busy \"retry\": minutes before the next try, at most 3 tries (then the call is given up).","type":"integer","minimum":1,"maximum":180},"external_ref":{"nullable":true,"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"number"},{"type":"boolean"}],"nullable":true}},"config":{"description":"Merged key by key, then checked against the trigger's type.","type":"object","additionalProperties":{}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["webhook","missed_call","date_field","outcome_retry"]},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string"},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string"},"daily_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_busy":{"type":"string","enum":["skip","retry"],"description":"What happens when every one of your lines is busy."},"retry_after_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"on_busy \"retry\": minutes before the next try."},"config":{"type":"object","additionalProperties":{}},"webhook":{"nullable":true,"type":"object","properties":{"token_prefix":{"type":"string"},"url_prefix":{"type":"string"},"token_rotated_at":{"nullable":true,"type":"string"}},"required":["token_prefix","url_prefix","token_rotated_at"],"additionalProperties":false},"today":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls put off today because every line was busy."}},"required":["queued","skipped","rejected","delayed"],"additionalProperties":false},"last_fired_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","type","enabled","agent_id","message","from_number_id","daily_limit","max_attempts","on_busy","retry_after_minutes","config","webhook","today","last_fired_at","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a trigger","tags":["triggers"],"description":"Its hook URL stops at once; calls it queued that are still waiting are canceled. 204.","parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"204":{"description":"Default Response","content":{"application/json":{"schema":{"type":"string","nullable":true,"enum":[null]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/triggers/{id}/rotate-token":{"post":{"summary":"Replace a webhook trigger's token (the old URL stops at once)","tags":["triggers"],"parameters":[{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["webhook","missed_call","date_field","outcome_retry"]},"enabled":{"type":"boolean"},"agent_id":{"nullable":true,"type":"string"},"message":{"nullable":true,"type":"object","properties":{"kind":{"type":"string","enum":["recorded","tts"]},"text":{"nullable":true,"type":"string"},"audio_file_id":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"language":{"type":"string"}},"required":["kind","text","audio_file_id","voice_id","language"],"additionalProperties":false},"from_number_id":{"nullable":true,"type":"string"},"daily_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"on_busy":{"type":"string","enum":["skip","retry"],"description":"What happens when every one of your lines is busy."},"retry_after_minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"on_busy \"retry\": minutes before the next try."},"config":{"type":"object","additionalProperties":{}},"webhook":{"nullable":true,"type":"object","properties":{"token_prefix":{"type":"string"},"url_prefix":{"type":"string"},"token_rotated_at":{"nullable":true,"type":"string"}},"required":["token_prefix","url_prefix","token_rotated_at"],"additionalProperties":false},"today":{"type":"object","properties":{"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delayed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Calls put off today because every line was busy."}},"required":["queued","skipped","rejected","delayed"],"additionalProperties":false},"last_fired_at":{"nullable":true,"type":"string"},"external_ref":{"nullable":true,"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"token":{"description":"Webhook triggers: shown only now. Keep it secret.","type":"string"},"url":{"description":"Webhook triggers: POST JSON here. Shown only now.","type":"string"}},"required":["id","name","type","enabled","agent_id","message","from_number_id","daily_limit","max_attempts","on_busy","retry_after_minutes","config","webhook","today","last_fired_at","external_ref","metadata","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/triggers/{id}/fires":{"get":{"summary":"What the trigger did, newest first: the call it queued, or why it didn't","tags":["triggers"],"description":"result: queued (a call was queued), delayed (put off because every one of your lines was busy), skipped, rejected.","parameters":[{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"cursor","required":false},{"schema":{"type":"string","enum":["queued","skipped","rejected","delayed"]},"in":"query","name":"result","required":false},{"schema":{"type":"string","maxLength":40},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string","enum":["queued","skipped","rejected","delayed"],"description":"delayed: the call was put off because every line was busy."},"reason":{"nullable":true,"type":"object","properties":{"code":{"type":"string"},"message":{"nullable":true,"type":"string"}},"required":["code","message"],"additionalProperties":false},"phone":{"nullable":true,"type":"string"},"contact_id":{"nullable":true,"type":"string"},"call_id":{"nullable":true,"description":"The call placed for this fire (the latest attempt), once there is one.","type":"string"},"call_state":{"nullable":true,"description":"queued, waiting_retry, dialing, answered, no_answer, busy, failed, blocked or canceled.","type":"string"},"scheduled_at":{"nullable":true,"type":"string"},"source_call_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","result","reason","phone","contact_id","call_id","call_state","scheduled_at","source_call_id","created_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/hooks/{token}":{"post":{"summary":"The incoming URL of a webhook trigger (no API key: the token in the URL is the credential)","tags":["triggers"],"description":"POST any JSON (≤ 64 KB). The trigger's mapping finds the phone (and name, context, attributes, external ref) by dot path. 202 with the queued call's id; the same external ref is called once (202 duplicate: true). 422 with a reason (invalid_phone, missing_phone, on_dnc, platform_blocked, trigger_disabled, daily_limit_reached, no_number, agent_unavailable). 404 for an unknown token. 60 requests a minute per token; after 30 unknown tokens in a minute from one address, 429 for every hook request from it until the minute ends.","requestBody":{"required":true,"content":{"application/json":{"schema":{}}}},"parameters":[{"schema":{"type":"string","maxLength":200},"in":"path","name":"token","required":true}],"security":[],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"call_id":{"nullable":true,"type":"string"},"scheduled_at":{"type":"string"},"duplicate":{"type":"boolean"}},"required":["accepted","call_id","scheduled_at","duplicate"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","details","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}}}}},"servers":[{"url":"https://api.call2all.in"}],"security":[{"apiKey":[]}]}