{"openapi":"3.1.0","info":{"title":"Sohan Soft Tech — Send Message API","version":"1.1.0","description":"The public customer API contains only message sending. Store keys in your backend. Requires an API-enabled plan, activated Meta sender, existing contact and recorded consent. Only positional text body/header template variables and static URL/phone buttons are supported."},"servers":[{"url":"https://wab.sohansoft.in"}],"paths":{"/api/v1/messages/send":{"post":{"operationId":"sendMessage","summary":"Send a WhatsApp message","x-api-key-scope":"messages.send","security":[{"CustomerKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":120},"description":"Required unless JSON idempotency_key is supplied. Both must match if provided."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"sender_id":{"type":"string","minLength":1,"maxLength":100},"to":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"idempotency_key":{"type":"string","minLength":8,"maxLength":120},"type":{"type":"string","const":"text"},"text":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4096}},"required":["body"],"additionalProperties":false}},"required":["sender_id","to","type","text"],"additionalProperties":false},{"type":"object","properties":{"sender_id":{"type":"string","minLength":1,"maxLength":100},"to":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$"},"idempotency_key":{"type":"string","minLength":8,"maxLength":120},"type":{"type":"string","const":"template"},"template":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9_]+$","maxLength":512},"language":{"type":"string","minLength":2,"maxLength":20},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["header","body"]},"parameters":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["type","text"],"additionalProperties":false},"minItems":1,"maxItems":30}},"required":["type","parameters"],"additionalProperties":false},"maxItems":2,"default":[]}},"required":["name","language"],"additionalProperties":false}},"required":["sender_id","to","type","template"],"additionalProperties":false}]},"examples":{"template":{"value":{"sender_id":"SENDER_ID_FROM_DASHBOARD","to":"+919876543210","type":"template","template":{"name":"order_confirmation","language":"en_US","components":[{"type":"body","parameters":[{"type":"text","text":"Customer name"},{"type":"text","text":"ORD-1001"}]}]},"idempotency_key":"order-1001-confirmation"}},"text":{"value":{"sender_id":"SENDER_ID_FROM_DASHBOARD","to":"+919876543210","type":"text","text":{"body":"Thank you for contacting us. How can we help?"},"idempotency_key":"ticket-1001-reply"}}}}}},"responses":{"202":{"description":"Queued or prior exact-retry message. This is not delivery confirmation.","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["message_id","status","request_id"],"properties":{"message_id":{"type":"string"},"status":{"type":"string","enum":["QUEUED","SENDING","SENT","DELIVERED","READ","FAILED","UNKNOWN"]},"request_id":{"type":"string","format":"uuid"}}}}}},"400":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"401":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"403":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"404":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"409":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"413":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"415":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"429":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"500":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}},"503":{"description":"Request rejected; inspect error.code and request_id","headers":{"X-Request-Id":{"description":"Server-generated request identifier","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string","format":"uuid"}}}}}}}}}},"components":{"securitySchemes":{"CustomerKey":{"type":"http","scheme":"bearer","bearerFormat":"sst_…"}}}}