{"openapi":"3.1.0","info":{"title":"Message Console API","version":"1.0.0","description":"A tenant-scoped SMS and WhatsApp API for any server application. HTTP Basic customer authentication; no browser CORS. Sends require an active funded account, configured channel, recipient consent and an Idempotency-Key. Amounts are decimal strings. HTTP 202 is not delivery confirmation. Bulk byte limit: 26214400. Documentation is public; all tenant operations remain authenticated."},"servers":[{"url":"https://msgconsole.sportzonatyre.com","description":"This Message Console deployment"}],"security":[{"customerBasic":[]}],"tags":[{"name":"Account"},{"name":"Messages"}],"paths":{"/api/v1/account":{"get":{"operationId":"account","summary":"Retrieve account","description":"Start here. Read your balance, retail pricing, channel, and supported delivery capabilities.","tags":["Account"],"parameters":[],"responses":{"200":{"description":"Successful tenant-scoped response.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Account"}},"required":["data"]},"example":{"data":{"accountSid":"MC0123456789abcdef0123456789abcdef","name":"Example application","status":"active","balance":{"amount":"25.000000","currency":"USD"},"pricing":{"mode":"fixed","unitPrice":"0.020000","prepaidUnitPrice":"0.020000","currency":"USD"},"template":null,"messaging":{"channel":"sms","configured":true,"capabilities":{"statusPolling":true,"deliveryReceipts":true,"readReceipts":false,"maxMessageLength":70}}}}}}},"401":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"See error.code and error.message. Rate limits include Retry-After.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry; currently 60."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/messages":{"post":{"operationId":"send","summary":"Send a message","description":"Queue one SMS or WhatsApp message using your account’s configured sender. A 202 response means queued, not delivered.","tags":["Messages"],"parameters":[{"in":"header","name":"Idempotency-Key","required":true,"description":"Persist once per logical operation. Reuse exactly the same payload/key when reconciling a network timeout. Reused keys replay the original operation; changed payloads are not fingerprint-checked.","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{7,119}$","minLength":8,"maxLength":120}}],"responses":{"202":{"description":"Queued or idempotent replay; not proof of delivery.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Message"}},"required":["data"]},"example":{"data":{"sid":"PM0123456789abcdef0123456789abcdef","to":"+15551234567","status":"queued","price":{"amount":"0.020000","currency":"USD"},"createdAt":"2026-01-15T10:00:00.000Z"}}}}},"401":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"See error.code and error.message. Rate limits include Retry-After.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry; currently 60."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageInput"},"example":{"to":"+15551234567","body":"Hello Maya, your appointment is confirmed."}}}}}},"/api/v1/messages/bulk":{"post":{"operationId":"bulk","summary":"Send a batch","description":"Queue a complete batch atomically. Your balance must cover every message before any message is queued.","tags":["Messages"],"parameters":[{"in":"header","name":"Idempotency-Key","required":true,"description":"Persist once per logical operation. Reuse exactly the same payload/key when reconciling a network timeout. Reused keys replay the original operation; changed payloads are not fingerprint-checked.","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{7,119}$","minLength":8,"maxLength":120}}],"responses":{"202":{"description":"Queued or idempotent replay; not proof of delivery.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"count":{"type":"integer"}},"required":["messages","count"]}},"required":["data"]},"example":{"data":{"messages":[{"sid":"PM0123456789abcdef0123456789abcdef","to":"+15551234567","status":"queued","price":{"amount":"0.020000","currency":"USD"},"createdAt":"2026-01-15T10:00:00.000Z"},{"sid":"PM1123456789abcdef0123456789abcdef","to":"+15557654321","status":"queued","price":{"amount":"0.020000","currency":"USD"},"createdAt":"2026-01-15T10:00:00.000Z"}],"count":2}}}}},"400":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"See error.code and error.message. Rate limits include Retry-After.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry; currently 60."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkInput"},"example":{"messages":[{"to":"+15551234567","body":"Hello Maya, your appointment is confirmed."},{"to":"+15557654321","body":"Hello Maya, your appointment is confirmed."}]}}}}}},"/api/v1/messages/{sid}":{"get":{"operationId":"message","summary":"Retrieve a message","description":"Look up one platform message SID. You can only access messages belonging to your own account.","tags":["Messages"],"parameters":[{"in":"path","name":"sid","required":true,"schema":{"type":"string","pattern":"^PM[a-f0-9]{32}$"}}],"responses":{"200":{"description":"Successful tenant-scoped response.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageDetails"}},"required":["data"]},"example":{"data":{"sid":"PM0123456789abcdef0123456789abcdef","to":"+15551234567","status":"delivered","price":{"amount":"0.020000","currency":"USD"},"createdAt":"2026-01-15T10:00:00.000Z","error":null,"updatedAt":"2026-01-15T10:00:05.000Z"}}}}},"401":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"See error.code and error.message. Rate limits include Retry-After.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry; currently 60."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/messages/statuses":{"post":{"operationId":"statuses","summary":"Poll message statuses","description":"Read up to 100 messages in one request. This POST is read-only: it never queues messages or charges your balance.","tags":["Messages"],"parameters":[],"responses":{"200":{"description":"Successful tenant-scoped response.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/MessageDetails"}}},"required":["messages"]}},"required":["data"]},"example":{"data":{"messages":[{"sid":"PM0123456789abcdef0123456789abcdef","to":"+15551234567","status":"delivered","price":{"amount":"0.020000","currency":"USD"},"createdAt":"2026-01-15T10:00:00.000Z","error":null,"updatedAt":"2026-01-15T10:00:05.000Z"}]}}}}},"401":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"See error.code and error.message. Rate limits include Retry-After.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry; currently 60."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusQuery"},"example":{"sids":["PM0123456789abcdef0123456789abcdef"]}}}}}},"/api/v1/stats":{"get":{"operationId":"stats","summary":"Retrieve usage","description":"Read account-scoped counts, settled retail charges, and the current balance. Counts overlap; they are not exclusive buckets.","tags":["Account"],"parameters":[{"in":"query","name":"from","required":false,"schema":{"type":"string","format":"date-time"},"description":"Inclusive. Defaults to 30 days ago."},{"in":"query","name":"to","required":false,"schema":{"type":"string","format":"date-time"},"description":"Exclusive. Defaults to now; must be later than from."}],"responses":{"200":{"description":"Successful tenant-scoped response.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Usage"}},"required":["data"]},"example":{"data":{"range":{"from":"2026-01-01T00:00:00.000Z","to":"2026-02-01T00:00:00.000Z"},"messages":{"total":100,"accepted":90,"delivered":85,"read":0,"failed":5,"processing":5},"charged":{"amount":"1.800000","currency":"USD"},"balance":{"amount":"25.000000","currency":"USD"}}}}}},"401":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"See error.code and error.message. Rate limits include Retry-After.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until retry; currently 60."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"See error.code and error.message. Rate limits include Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"messageStatus":{"post":{"summary":"Optional signed callback to your configured HTTPS endpoint","description":"Verify HMAC-SHA256(customer auth token, timestamp + \".\" + raw body), timestamp within 300 seconds, constant-time comparison. Return 2xx promptly; handle duplicate/out-of-order callbacks. Configure the destination with the owner; use only the documented customer API.","security":[],"parameters":[{"in":"header","name":"X-Msg-Console-Timestamp","required":true,"schema":{"type":"string","pattern":"^[0-9]+$"},"description":"Unix seconds."},{"in":"header","name":"X-Msg-Console-Signature","required":true,"schema":{"type":"string","pattern":"^v1=[a-f0-9]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Callback"},"example":{"event":"message.status","sid":"PM0123456789abcdef0123456789abcdef","status":"delivered","idempotencyKey":"order-A104-confirmation","to":"+15551234567","price":{"amount":"0.020000","currency":"USD"},"error":null,"occurredAt":"2026-01-15T10:00:05.000Z"}}}},"responses":{"200":{"description":"Event acknowledged."}}}}},"components":{"securitySchemes":{"customerBasic":{"type":"http","scheme":"basic","description":"Username: customer MC account SID. Password: customer Auth Token. Not administrator login or Pingo password."}},"schemas":{"Money":{"type":"object","properties":{"amount":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]{1,6})?$"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},"MessageInput":{"type":"object","required":["to"],"properties":{"to":{"type":"string","pattern":"^\\+[0-9]{8,15}$","description":"E.164, without whatsapp: prefix."},"body":{"type":"string","minLength":1,"maxLength":4096,"description":"Trimmed text. SMS is limited to 70 or 160 UTF-16 code units by account configuration; & and # are restricted. Do not combine with templateId."},"templateId":{"type":"string","pattern":"^MT[a-f0-9]{32}$","description":"Message Console template.id from GET /api/v1/account; scoped to this account, not accepted for SMS."},"contentVariables":{"type":"object","additionalProperties":{"type":"string","maxLength":1024},"description":"Actual placeholder values keyed by variable number, not column names."}},"oneOf":[{"required":["body"],"not":{"required":["templateId"]}},{"required":["templateId"],"not":{"required":["body"]}}]},"Message":{"type":"object","properties":{"sid":{"type":"string","pattern":"^PM[a-f0-9]{32}$"},"to":{"type":"string","pattern":"^\\+[0-9]{8,15}$"},"status":{"type":"string","enum":["queued","processing","retry_wait","accepted","sent","delivered","read","failed","manual_review"]},"price":{"$ref":"#/components/schemas/Money"},"createdAt":{"type":"string","format":"date-time"}},"required":["sid","to","status","price","createdAt"]},"MessageDetails":{"allOf":[{"$ref":"#/components/schemas/Message"},{"type":"object","properties":{"updatedAt":{"type":"string","format":"date-time"},"error":{"anyOf":[{"$ref":"#/components/schemas/DeliveryError"},{"type":"null"}]}},"required":["updatedAt","error"]}]},"DeliveryError":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Account":{"type":"object","properties":{"accountSid":{"type":"string","pattern":"^MC[a-f0-9]{32}$"},"name":{"type":"string"},"status":{"type":"string","enum":["active","deactivated"]},"balance":{"$ref":"#/components/schemas/Money"},"template":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^MT[a-f0-9]{32}$"},"body":{"type":"string"}},"required":["id","body"]},{"type":"null"}]},"pricing":{"oneOf":[{"type":"object","properties":{"mode":{"const":"fixed"},"unitPrice":{"type":"string"},"prepaidUnitPrice":{"type":"string"},"currency":{"type":"string"}},"required":["mode","unitPrice","prepaidUnitPrice","currency"]},{"type":"object","properties":{"mode":{"const":"capped"},"maximumUnitPrice":{"type":"string"},"prepaidUnitPrice":{"type":"string"},"currency":{"type":"string"}},"required":["mode","maximumUnitPrice","prepaidUnitPrice","currency"]}]},"messaging":{"type":"object","properties":{"channel":{"type":"string","enum":["sms","whatsapp"]},"configured":{"type":"boolean"},"capabilities":{"type":"object","properties":{"statusPolling":{"type":"boolean"},"deliveryReceipts":{"type":"boolean"},"readReceipts":{"type":"boolean"},"maxMessageLength":{"type":"integer"}},"required":["statusPolling","deliveryReceipts","readReceipts","maxMessageLength"]}},"required":["channel","configured","capabilities"]}},"required":["accountSid","name","status","balance","template","pricing","messaging"]},"Usage":{"type":"object","properties":{"range":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["from","to"]},"messages":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"accepted":{"type":"integer","minimum":0},"delivered":{"type":"integer","minimum":0},"read":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"processing":{"type":"integer","minimum":0}},"required":["total","accepted","delivered","read","failed","processing"]},"charged":{"$ref":"#/components/schemas/Money"},"balance":{"$ref":"#/components/schemas/Money"}},"required":["range","messages","charged","balance"]},"StatusQuery":{"type":"object","properties":{"sids":{"type":"array","items":{"type":"string","pattern":"^PM[a-f0-9]{32}$"},"minItems":1,"maxItems":100,"uniqueItems":true}},"required":["sids"]},"BulkInput":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/MessageInput"},"minItems":1,"maxItems":5000}},"required":["messages"]},"Callback":{"type":"object","properties":{"event":{"const":"message.status"},"sid":{"type":"string","pattern":"^PM[a-f0-9]{32}$"},"status":{"type":"string"},"idempotencyKey":{"type":"string"},"to":{"type":"string"},"price":{"$ref":"#/components/schemas/Money"},"error":{"anyOf":[{"$ref":"#/components/schemas/DeliveryError"},{"type":"null"}]},"occurredAt":{"type":"string","format":"date-time"}},"required":["event","sid","status","idempotencyKey","to","price","occurredAt"]}}}}