{"openapi":"3.1.0","info":{"title":"Actionpackd Messaging API","version":"1.0.0","description":"Official programmatic WhatsApp Cloud API service from Actionpackd. Send approved templates, session text within the 24-hour window, inspect delivery status, and configure cryptographically signed inbound webhooks.","contact":{"name":"Actionpackd Support","url":"https://actionpackd.com/contact"}},"servers":[{"url":"https://api.actionpackd.com","description":"Production API Gateway"}],"security":[{"BearerAuth":[]}],"paths":{"/v1/messages":{"post":{"summary":"Send a WhatsApp message","description":"Queues an outbound WhatsApp message. Requires an Idempotency-Key header. Session messages are only permitted inside an active 24-hour customer care window.","operationId":"sendMessage","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique client-generated UUID to ensure idempotent processing.","schema":{"type":"string","format":"uuid","example":"11111111-1111-1111-1111-111111111111"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","type"],"properties":{"to":{"type":"string","description":"Recipient phone number with country code (E.164 digits only, no + or spaces).","example":"919876543210"},"type":{"type":"string","enum":["template","text"],"description":"Message type. Use \"template\" outside the 24h window."},"template":{"type":"object","description":"Required if type is \"template\". Must refer to an approved template.","required":["name","language"],"properties":{"name":{"type":"string","example":"order_confirmation"},"language":{"type":"string","example":"en"},"components":{"type":"array","items":{"type":"object"}}}},"text":{"type":"object","description":"Required if type is \"text\". Customer must have messaged in last 24h.","required":["body"],"properties":{"body":{"type":"string","example":"Hello! How can we help you today?"}}}}}}}},"responses":{"202":{"description":"Message queued for transmission.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"queued"}}}}}},"400":{"description":"Bad request (invalid format or unapproved template)."},"401":{"description":"Unauthorized (invalid or revoked API key)."},"409":{"description":"Conflict (session window closed for text message)."},"429":{"description":"Too many requests / credit limit reached."}}}},"/v1/messages/{id}":{"get":{"summary":"Get message status","description":"Look up current delivery state for a message send.","operationId":"getMessageStatus","parameters":[{"name":"id","in":"path","required":true,"description":"The UUID returned from POST /v1/messages","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Message status details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"to":{"type":"string"},"type":{"type":"string","enum":["template","text"]},"status":{"type":"string","enum":["queued","sent","delivered","read","failed"]},"error":{"type":"string","nullable":true}}}}}},"404":{"description":"Message not found."}}}},"/v1/webhook":{"get":{"summary":"Get customer webhook endpoint","description":"Returns the current registered webhook URL and status.","operationId":"getWebhook","responses":{"200":{"description":"Registered webhook configuration.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","nullable":true},"status":{"type":"string","nullable":true}}}}}}}},"put":{"summary":"Configure customer webhook endpoint","description":"Sets or updates the HTTPS webhook destination URL. Returns the HMAC-SHA256 signing secret ONCE.","operationId":"saveWebhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","example":"https://api.yourdomain.com/webhooks/whatsapp"}}}}}},"responses":{"200":{"description":"Webhook saved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"string"},"secret":{"type":"string","description":"Shared HMAC-SHA256 signing secret (shown only once)."}}}}}}}}},"/v1/webhook/test":{"post":{"summary":"Trigger test webhook event","description":"Dispatches a test event to verify HMAC signature validation on your backend.","operationId":"testWebhook","responses":{"200":{"description":"Sample test event queued for dispatch.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sample_event_id":{"type":"string"}}}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"apk_...","description":"Actionpackd Messaging API Key (e.g. apk_live_... or apk_test_...)"}}}}