{"openapi":"3.1.0","info":{"title":"Sendlane API","version":"1.0.0","description":"Send WhatsApp messages from an account's own paired number. Uses WhatsApp Web, an unofficial method. Full guide: https:\/\/sendlane.amm-labs.com\/docs.md"},"servers":[{"url":"https:\/\/sendlane.amm-labs.com\/api\/v1"}],"security":[{"bearerAuth":[]}],"paths":{"\/session":{"get":{"operationId":"getSession","summary":"Get the current pairing state","responses":{"200":{"description":"Session state","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Session"}}}},"401":{"$ref":"#\/components\/responses\/Error401"},"503":{"$ref":"#\/components\/responses\/Error503"}}}},"\/session\/start":{"post":{"operationId":"startSession","summary":"Start the session and get a QR code if pairing is needed","description":"Limited to 6 requests per minute.","responses":{"200":{"description":"Session started","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Session"}}}},"401":{"$ref":"#\/components\/responses\/Error401"},"429":{"$ref":"#\/components\/responses\/Error429"},"503":{"$ref":"#\/components\/responses\/Error503"}}}},"\/session\/qr":{"get":{"operationId":"getSessionQr","summary":"Refresh the QR code while pairing","description":"Limited to 12 requests per minute.","responses":{"200":{"description":"QR payload from the session sidecar","content":{"application\/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#\/components\/responses\/Error401"},"429":{"$ref":"#\/components\/responses\/Error429"},"503":{"$ref":"#\/components\/responses\/Error503"}}}},"\/messages":{"post":{"operationId":"sendMessage","summary":"Send a text message from the paired number","description":"Limited to 60 requests per minute. Returns 409 if the session is not ready.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SendMessage"}}}},"responses":{"200":{"description":"Message handed to the session","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"object"}}}}}},"401":{"$ref":"#\/components\/responses\/Error401"},"409":{"$ref":"#\/components\/responses\/Error409"},"429":{"$ref":"#\/components\/responses\/Error429"},"503":{"$ref":"#\/components\/responses\/Error503"}}}},"\/health":{"get":{"operationId":"getHealth","summary":"Shallow check of the database and WhatsApp stack","responses":{"200":{"description":"Healthy"},"401":{"$ref":"#\/components\/responses\/Error401"},"503":{"$ref":"#\/components\/responses\/Error503"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal access token created under API keys in the dashboard. Bound to one account and one session."}},"schemas":{"Session":{"type":"object","properties":{"session_id":{"type":"string","examples":["u42"]},"status":{"type":"string","description":"ready means messages can be sent. qr means a human must scan the code.","examples":["ready"]},"phone_number":{"type":"string"},"push_name":{"type":"string"},"ready_at":{"type":"string","format":"date-time"},"qr":{"type":"string","description":"PNG data URI, present while pairing."}}},"SendMessage":{"type":"object","required":["to","text"],"properties":{"to":{"type":"string","description":"Chat ID such as 966512345678@c.us, or a number the sidecar accepts."},"text":{"type":"string"}}}},"responses":{"Error401":{"description":"Missing or invalid token. Stop and ask a human for a valid token."},"Error409":{"description":"Session not connected. Finish pairing, then retry."},"Error429":{"description":"Rate limited. Wait, then retry with backoff."},"Error503":{"description":"The WhatsApp sidecar is unreachable. Retry later."}}},"webhooks":{"messageReceived":{"post":{"summary":"Sent to your webhook URL when someone messages your number","description":"Header X-Webhook-Signature is sha256= plus the hex HMAC-SHA256 of the raw body using your signing secret. Events: message.received, session.ready, session.disconnected. Return a 2xx quickly. 5 attempts with exponential backoff.","requestBody":{"content":{"application\/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["message.received","session.ready","session.disconnected"]},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Acknowledged"}}}}}}