{"openapi":"3.1.0","info":{"title":"wapi","version":"0.1.0","description":"A WhatsApp REST API, wire-compatible with WasenderAPI.\n\n**Two credential types.** A *Personal Access Token* is account-scoped and required for\nsession management. A *Session API Key* is issued per session and used for everything\nelse — it identifies the session, which is why endpoints like `GET /api/status` take no\nsession id. Send either as `Authorization: Bearer <token>`.\n\n**Response envelopes are deliberately inconsistent**, because the interface being cloned\nis inconsistent. Most successes are `{success, data}`, but `regenerate-key` returns\n`api_key` at the top level, `restart` returns `message`, upload and decrypt-media return\n`publicUrl`, and `GET /api/status` returns a bare `{status}` with no envelope. Failures\nfrom route handlers use `error`; failures from middleware use `message`."},"servers":[{"url":"https://api.wapi.crafter.run"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"PAT or Session API Key"}},"schemas":{"Failure":{"type":"object","properties":{"success":{"type":"boolean","const":false},"error":{"type":"string"}},"required":["success","error"],"description":"Failure decided by a route handler."},"FrameworkFailure":{"type":"object","properties":{"success":{"type":"boolean","const":false},"message":{"type":"string"},"errors":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["success","message"],"description":"Failure decided by middleware: authentication, subscription gating."},"ValidationFailure":{"type":"object","properties":{"success":{"type":"boolean","const":false},"message":{"type":"string"},"errors":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["success","message"],"description":"Validation failure. `errors` maps each rejected field to its messages."},"ThrottleFailure":{"type":"object","properties":{"message":{"type":"string"},"retry_after":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["message","retry_after"],"description":"Rate limited. Deliberately carries no `success` key."}}},"tags":[{"name":"Sessions","description":"Create, connect and manage WhatsApp sessions"},{"name":"Messages","description":"Send, read and inspect messages; upload and decrypt media"},{"name":"Contacts","description":"Contact lookup and LID resolution"},{"name":"Groups","description":"Group metadata and participant management"}],"paths":{"/api/whatsapp-sessions/{whatsappSession}":{"delete":{"operationId":"deleteApiWhatsappSessionsWhatsappSession","summary":"Delete a session and revoke its API key","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted. No content."},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]},"get":{"operationId":"getApiWhatsappSessionsWhatsappSession","summary":"Fetch one session, including its API key and webhook secret","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"phone_number":{"type":"string"},"status":{"type":"string"},"account_protection":{"type":"boolean"},"log_messages":{"type":"boolean"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_enabled":{"type":"boolean"},"webhook_events":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","phone_number","status","account_protection","log_messages","webhook_url","webhook_enabled","webhook_events","created_at","updated_at","api_key","webhook_secret"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]},"put":{"operationId":"putApiWhatsappSessionsWhatsappSession","summary":"Update a session's settings, webhook config or proxy","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"phone_number":{"type":"string"},"account_protection":{"type":"boolean"},"log_messages":{"type":"boolean"},"webhook_url":{"type":"string"},"webhook_enabled":{"type":"boolean"},"webhook_events":{"type":"array","items":{}},"read_incoming_messages":{"type":"boolean"},"auto_reject_calls":{"type":"boolean"},"ignore_groups":{"type":"boolean"},"ignore_channels":{"type":"boolean"},"ignore_broadcasts":{"type":"boolean"},"proxy_url":{"type":"string"},"always_online":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"phone_number":{"type":"string"},"status":{"type":"string"},"account_protection":{"type":"boolean"},"log_messages":{"type":"boolean"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_enabled":{"type":"boolean"},"webhook_events":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","phone_number","status","account_protection","log_messages","webhook_url","webhook_enabled","webhook_events","created_at","updated_at","api_key","webhook_secret"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/contacts":{"get":{"operationId":"getApiContacts","summary":"Contacts known to this session","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Contacts"],"parameters":[{"name":"paginated","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"notify":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifiedName":{"anyOf":[{"type":"string"},{"type":"null"}]},"imgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"lid":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["jid","name","notify","verifiedName","imgUrl","status"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"notify":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifiedName":{"anyOf":[{"type":"string"},{"type":"null"}]},"imgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"lid":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["jid","name","notify","verifiedName","imgUrl","status"]}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"]}},"required":["items","pagination"]}},"required":["success","data"]}]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/contacts/{contactPhoneNumber}":{"get":{"operationId":"getApiContactsContactPhoneNumber","summary":"Fetch one contact","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Contacts"],"parameters":[{"name":"contactPhoneNumber","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"jid":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"notify":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifiedName":{"anyOf":[{"type":"string"},{"type":"null"}]},"imgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"lid":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","notify","verifiedName","imgUrl","status"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/groups":{"get":{"operationId":"getApiGroups","summary":"Groups this session belongs to","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Groups"],"parameters":[{"name":"paginated","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"imgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"owner":{"anyOf":[{"type":"string"},{"type":"null"}]},"creation":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"desc":{"anyOf":[{"type":"string"},{"type":"null"}]},"participants":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"isAdmin":{"type":"boolean"},"isSuperAdmin":{"type":"boolean"},"id":{"type":"string"},"admin":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["jid","isAdmin","isSuperAdmin"]}}},"required":["jid","name","imgUrl"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"imgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"owner":{"anyOf":[{"type":"string"},{"type":"null"}]},"creation":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"desc":{"anyOf":[{"type":"string"},{"type":"null"}]},"participants":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"isAdmin":{"type":"boolean"},"isSuperAdmin":{"type":"boolean"},"id":{"type":"string"},"admin":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["jid","isAdmin","isSuperAdmin"]}},"notify":{"type":"null"},"verifiedName":{"type":"null"}},"required":["jid","name","imgUrl"]}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"]}},"required":["items","pagination"]}},"required":["success","data"]}]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]},"post":{"operationId":"postApiGroups","summary":"Create a group","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Groups"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"participants":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"jid":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"imgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"owner":{"anyOf":[{"type":"string"},{"type":"null"}]},"creation":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"desc":{"anyOf":[{"type":"string"},{"type":"null"}]},"participants":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"isAdmin":{"type":"boolean"},"isSuperAdmin":{"type":"boolean"},"id":{"type":"string"},"admin":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["jid","isAdmin","isSuperAdmin"]}}},"required":["jid","subject","participants"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/groups/{groupJid}/metadata":{"get":{"operationId":"getApiGroupsGroupJidMetadata","summary":"Group subject, description, owner and participants","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Groups"],"parameters":[{"name":"groupJid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"jid":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"imgUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"owner":{"anyOf":[{"type":"string"},{"type":"null"}]},"creation":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"desc":{"anyOf":[{"type":"string"},{"type":"null"}]},"participants":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"isAdmin":{"type":"boolean"},"isSuperAdmin":{"type":"boolean"},"id":{"type":"string"},"admin":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["jid","isAdmin","isSuperAdmin"]}}},"required":["jid","subject","participants"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/groups/{groupJid}/participants":{"get":{"operationId":"getApiGroupsGroupJidParticipants","summary":"Participants of a group","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Groups"],"parameters":[{"name":"groupJid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"jid":{"type":"string"},"isAdmin":{"type":"boolean"},"isSuperAdmin":{"type":"boolean"},"id":{"type":"string"},"admin":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"]}}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/lid-from-pn/{pn}":{"get":{"operationId":"getApiLidFromPnPn","summary":"getApiLidFromPnPn","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Contacts"],"parameters":[{"name":"pn","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"lid":{"type":"string"}},"required":["lid"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/messages/{msgId}/info":{"get":{"operationId":"getApiMessagesMsgIdInfo","summary":"Fetch a sent message by its integer msgId","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"parameters":[{"name":"msgId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"remoteJid":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"msgId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"key":{},"message":{},"messageTimestamp":{"type":"string"},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["remoteJid","id","msgId","key","message","messageTimestamp","status"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/on-whatsapp/{contact_identifier}":{"get":{"operationId":"getApiOnWhatsappContactIdentifier","summary":"Check whether a number is registered on WhatsApp","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Contacts"],"parameters":[{"name":"contact_identifier","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"exists":{"type":"boolean"},"jid":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["exists"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/pn-from-lid/{lid}":{"get":{"operationId":"getApiPnFromLidLid","summary":"getApiPnFromLidLid","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Contacts"],"parameters":[{"name":"lid","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"pn":{"type":"string"}},"required":["pn"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/status":{"get":{"operationId":"getApiStatus","summary":"Connection state of the session the API key belongs to","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Sessions"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/user":{"get":{"operationId":"getApiUser","summary":"WhatsApp identity behind the session key, including its LID","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Sessions"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"lid":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","lid"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/whatsapp-sessions":{"get":{"operationId":"getApiWhatsappSessions","summary":"List every WhatsApp session on the account","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"phone_number":{"type":"string"},"status":{"type":"string"},"account_protection":{"type":"boolean"},"log_messages":{"type":"boolean"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_enabled":{"type":"boolean"},"webhook_events":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","phone_number","status","account_protection","log_messages","webhook_url","webhook_enabled","webhook_events","created_at","updated_at"]}}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]},"post":{"operationId":"postApiWhatsappSessions","summary":"Create a WhatsApp session and issue its API key","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"phone_number":{"type":"string"},"account_protection":{"type":"boolean"},"log_messages":{"type":"boolean"},"webhook_url":{"type":"string"},"webhook_enabled":{"type":"boolean"},"webhook_events":{"type":"array","items":{}},"read_incoming_messages":{"type":"boolean"},"auto_reject_calls":{"type":"boolean"},"ignore_groups":{"type":"boolean"},"ignore_channels":{"type":"boolean"},"ignore_broadcasts":{"type":"boolean"},"proxy_url":{"type":"string"},"always_online":{"type":"boolean"}},"required":["name","phone_number","account_protection","log_messages"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"phone_number":{"type":"string"},"status":{"type":"string"},"account_protection":{"type":"boolean"},"log_messages":{"type":"boolean"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_enabled":{"type":"boolean"},"webhook_events":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","phone_number","status","account_protection","log_messages","webhook_url","webhook_enabled","webhook_events","created_at","updated_at","api_key","webhook_secret"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/whatsapp-sessions/{whatsappSession}/message-logs":{"get":{"operationId":"getApiWhatsappSessionsWhatsappSessionMessageLogs","summary":"Paginated log of messages sent through a session","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"current_page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"whatsapp_session_id":{"type":"string"},"to":{"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"failed_reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","whatsapp_session_id","to","content","status","failed_reason","created_at","updated_at"]}},"first_page_url":{"type":"string"},"from":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_page_url":{"type":"string"},"next_page_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"path":{"type":"string"},"per_page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prev_page_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"to":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["current_page","data","first_page_url","from","last_page","last_page_url","next_page_url","path","per_page","prev_page_url","to","total"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/whatsapp-sessions/{whatsappSession}/qrcode":{"get":{"operationId":"getApiWhatsappSessionsWhatsappSessionQrcode","summary":"Fetch the current QR string for a session awaiting a scan","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"qrCode":{"type":"string"}},"required":["qrCode"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/decrypt-media":{"post":{"operationId":"postApiDecryptMedia","summary":"Decrypt an inbound media node and return a URL valid for one hour","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["data"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"publicUrl":{"type":"string"}},"required":["success","publicUrl"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/groups/{groupJid}/participants/add":{"post":{"operationId":"postApiGroupsGroupJidParticipantsAdd","summary":"Add participants to a group","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Groups"],"parameters":[{"name":"groupJid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"participants":{"type":"array","items":{}}},"required":["participants"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jid":{"type":"string"},"message":{"type":"string"}},"required":["status","jid","message"]}}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/groups/{groupJid}/participants/remove":{"post":{"operationId":"postApiGroupsGroupJidParticipantsRemove","summary":"Remove participants from a group","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Groups"],"parameters":[{"name":"groupJid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"participants":{"type":"array","items":{}}},"required":["participants"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","properties":{"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jid":{"type":"string"},"message":{"type":"string"}},"required":["status","jid","message"]}}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/messages/read":{"post":{"operationId":"postApiMessagesRead","summary":"Mark a received message as read","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/send-message":{"post":{"operationId":"postApiSendMessage","summary":"Send a message. One endpoint for every message type","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string"},"text":{"type":"string"},"imageUrl":{"type":"string"},"videoUrl":{"type":"string"},"documentUrl":{"type":"string"},"audioUrl":{"type":"string"},"stickerUrl":{"type":"string"},"contact":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"location":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"mentions":{"type":"array","items":{}},"fileName":{"type":"string"},"poll":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"replyTo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"viewOnce":{"type":"boolean"}},"required":["to"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"msgId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jid":{"type":"string"},"status":{"type":"string"}},"required":["msgId","jid","status"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/upload":{"post":{"operationId":"postApiUpload","summary":"Upload a file and get a public URL, as raw bytes or base64","description":"Requires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base64":{"type":"string"},"mimetype":{"type":"string"},"Request Body":{}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"publicUrl":{"type":"string"}},"required":["success","publicUrl"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/whatsapp-sessions/{whatsappSession}/connect":{"post":{"operationId":"postApiWhatsappSessionsWhatsappSessionConnect","summary":"Begin linking, returning a QR code when one is ready","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"linkMethod":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"status":{"type":"string"},"qrCode":{"type":"string"},"message":{"type":"string"}},"required":["status"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/whatsapp-sessions/{whatsappSession}/disconnect":{"post":{"operationId":"postApiWhatsappSessionsWhatsappSessionDisconnect","summary":"Close the socket without unlinking the device","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}},"required":["status","message"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/whatsapp-sessions/{whatsappSession}/regenerate-key":{"post":{"operationId":"postApiWhatsappSessionsWhatsappSessionRegenerateKey","summary":"Issue a new API key, invalidating the old one","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"api_key":{"type":"string"}},"required":["success","api_key"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/whatsapp-sessions/{whatsappSession}/restart":{"post":{"operationId":"postApiWhatsappSessionsWhatsappSessionRestart","summary":"Reconnect a live session using its stored credentials","description":"Requires a **Personal Access Token**. Session API keys are rejected.","tags":["Sessions"],"parameters":[{"name":"whatsappSession","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"message":{"type":"string"}},"required":["success","message"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/messages/react":{"post":{"operationId":"postApiMessagesReact","summary":"React to a message, or clear a reaction with an empty emoji","description":"**wapi extension.** Not part of the WasenderAPI interface this server reproduces — their SDK never calls it, and a drop-in client does not need it.\n\nRequires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string","minLength":1},"remoteJid":{"type":"string","minLength":1},"fromMe":{"type":"boolean"},"participant":{"type":"string"}},"required":["id","remoteJid"]},"emoji":{"type":"string","maxLength":16}},"required":["key","emoji"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"emoji":{"type":"string"}},"required":["id","emoji"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/sandbox/sessions":{"post":{"operationId":"postApiSandboxSessions","summary":"Create a sandbox session — a fake number on a fake WhatsApp","description":"**wapi extension.** Not part of the WasenderAPI interface this server reproduces — their SDK never calls it, and a drop-in client does not need it.\n\nRequires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"phone_number":{"type":"string"},"status":{"type":"string"},"account_protection":{"type":"boolean"},"log_messages":{"type":"boolean"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_enabled":{"type":"boolean"},"webhook_events":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","phone_number","status","account_protection","log_messages","webhook_url","webhook_enabled","webhook_events","created_at","updated_at","api_key","webhook_secret"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/sandbox/inbound":{"post":{"operationId":"postApiSandboxInbound","summary":"Fabricate an inbound message on a sandbox session","description":"**wapi extension.** Not part of the WasenderAPI interface this server reproduces — their SDK never calls it, and a drop-in client does not need it.\n\nRequires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","minLength":1},"text":{"type":"string","minLength":1,"maxLength":4096}},"required":["text"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"key":{}},"required":["key"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}},"/api/sandbox/scan":{"post":{"operationId":"postApiSandboxScan","summary":"Complete pairing on a sandbox session awaiting its fake QR","description":"**wapi extension.** Not part of the WasenderAPI interface this server reproduces — their SDK never calls it, and a drop-in client does not need it.\n\nRequires a **Session API Key**. The key identifies the session, so no session id is passed.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}},"required":["success","data"]}}}},"401":{"description":"Missing or invalid credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"403":{"description":"Wrong credential type for this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrameworkFailure"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationFailure"}}}},"429":{"description":"Rate limited. Note this body has no `success` key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThrottleFailure"}}}},"503":{"description":"The WhatsApp service is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}},"security":[{"bearerAuth":[]}]}}}}