{"files":{"SKILL.md":"---\nname: whatsapp-business-api\ndescription: \"WhatsApp Business API skill. Use when working with WhatsApp Business for users, settings, account. Covers 55 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# WhatsApp Business API\nAPI version: 1.0\n\n## Auth\nBearer basic | Bearer bearer\n\n## Base URL\nhttp://example.com/v1\n\n## Setup\n1. Set Authorization header with Bearer token\n2. GET /settings/application -- get-application-settings\n3. POST /users/login -- create first login\n\n## Endpoints\n55 endpoints across 12 groups. See references/api-spec.lap for full details.\n\n### Users\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /users/login | Login-User |\n| POST | /users | Create-User |\n| GET | /users/{UserUsername} | Get-User |\n| PUT | /users/{UserUsername} | Update-User |\n| DELETE | /users/{UserUsername} | Delete-User |\n| POST | /users/logout | Logout-User |\n\n### Settings\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /settings/application | Get-Application-Settings |\n| DELETE | /settings/application | Reset-Application-Settings |\n| PATCH | /settings/application | Update-Application-Settings |\n| GET | /settings/application/media/providers | Get-Media-Providers |\n| POST | /settings/application/media/providers | Update-Media-Providers |\n| DELETE | /settings/application/media/providers/{ProviderName} | Delete-Media-Providers |\n| POST | /settings/backup | Backup-Settings |\n| POST | /settings/restore | Restore-Settings |\n| GET | /settings/business/profile | Get-Business-Profile |\n| POST | /settings/business/profile | Update-Business-Profile |\n| GET | /settings/profile/about | Get-Profile-About |\n| PATCH | /settings/profile/about | Update-Profile-About |\n| POST | /settings/account/two-step | Enable-Two-Step |\n| DELETE | /settings/account/two-step | Disable-Two-Step |\n| GET | /settings/profile/photo | Get-Profile-Photo |\n| POST | /settings/profile/photo | Update-Profile-Photo |\n| DELETE | /settings/profile/photo | Delete-Profile-Photo |\n\n### Account\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /account/shards | Set-Shards |\n| POST | /account/verify | Register-Account |\n| POST | /account | Request-Code |\n\n### Contacts\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /contacts | Check-Contact |\n\n### Messages\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /messages | Send-Message |\n| PUT | /messages/{MessageID} | Mark-Message-As-Read |\n\n### Groups\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /groups | Get-All-Groups |\n| POST | /groups | Create-Group |\n| GET | /groups/{GroupId} | Get-Group-Info |\n| PUT | /groups/{GroupId} | Update-Group-Info |\n| GET | /groups/{GroupId}/invite | Get-Group-Invite |\n| DELETE | /groups/{GroupId}/invite | Delete-Group-Invite |\n| DELETE | /groups/{GroupId}/participants | Remove-Group-Participant |\n| POST | /groups/{GroupId}/leave | Leave-Group |\n| GET | /groups/{GroupId}/icon | Get-Group-Icon-Binary |\n| POST | /groups/{GroupId}/icon | Set-Group-Icon |\n| DELETE | /groups/{GroupId}/icon | Delete-Group-Icon |\n| DELETE | /groups/{GroupId}/admins | Demote-Group-Admin |\n| PATCH | /groups/{GroupId}/admins | Promote-To-Group-Admin |\n\n### Health\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /health | Check-Health |\n\n### Media\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /media | Upload-Media |\n| GET | /media/{MediaId} | Download-Media |\n| DELETE | /media/{MediaId} | Delete-Media |\n\n### Stats\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /stats/app | Get-App-Stats |\n| GET | /stats/db | Get-DB-Stats |\n\n### Metrics\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /metrics | Get-Metrics (since v2.21.3) |\n\n### Support\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /support | Get-Support-Info |\n\n### Certificates\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /certificates/external/ca | Download-CA-Certificate |\n| POST | /certificates/external | Upload-Certificate |\n| GET | /certificates/webhooks/ca | Download Webhook CA Certificate |\n| POST | /certificates/webhooks/ca | Upload Webhook CA Certificate |\n| DELETE | /certificates/webhooks/ca | Delete Webhook CA Certificate |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"Create a login?\" -> POST /users/login\n- \"Create a user?\" -> POST /users\n- \"Get user details?\" -> GET /users/{UserUsername}\n- \"Update a user?\" -> PUT /users/{UserUsername}\n- \"Delete a user?\" -> DELETE /users/{UserUsername}\n- \"Create a logout?\" -> POST /users/logout\n- \"List all application?\" -> GET /settings/application\n- \"Create a shard?\" -> POST /account/shards\n- \"List all providers?\" -> GET /settings/application/media/providers\n- \"Create a provider?\" -> POST /settings/application/media/providers\n- \"Delete a provider?\" -> DELETE /settings/application/media/providers/{ProviderName}\n- \"Create a backup?\" -> POST /settings/backup\n- \"Create a restore?\" -> POST /settings/restore\n- \"List all profile?\" -> GET /settings/business/profile\n- \"Create a profile?\" -> POST /settings/business/profile\n- \"List all about?\" -> GET /settings/profile/about\n- \"Create a two-step?\" -> POST /settings/account/two-step\n- \"Create a verify?\" -> POST /account/verify\n- \"Create a contact?\" -> POST /contacts\n- \"Create a message?\" -> POST /messages\n- \"Update a message?\" -> PUT /messages/{MessageID}\n- \"List all groups?\" -> GET /groups\n- \"Create a group?\" -> POST /groups\n- \"Get group details?\" -> GET /groups/{GroupId}\n- \"Update a group?\" -> PUT /groups/{GroupId}\n- \"List all invite?\" -> GET /groups/{GroupId}/invite\n- \"Create a leave?\" -> POST /groups/{GroupId}/leave\n- \"List all icon?\" -> GET /groups/{GroupId}/icon\n- \"Create a icon?\" -> POST /groups/{GroupId}/icon\n- \"List all health?\" -> GET /health\n- \"List all photo?\" -> GET /settings/profile/photo\n- \"Create a photo?\" -> POST /settings/profile/photo\n- \"Create a account?\" -> POST /account\n- \"Create a media?\" -> POST /media\n- \"Get media details?\" -> GET /media/{MediaId}\n- \"Delete a media?\" -> DELETE /media/{MediaId}\n- \"List all app?\" -> GET /stats/app\n- \"List all db?\" -> GET /stats/db\n- \"List all metrics?\" -> GET /metrics\n- \"List all support?\" -> GET /support\n- \"List all ca?\" -> GET /certificates/external/ca\n- \"Create a external?\" -> POST /certificates/external\n- \"Create a ca?\" -> POST /certificates/webhooks/ca\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints return the modified resource on success\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api WhatsApp Business API\n@base http://example.com/v1\n@version 1.0\n@auth Bearer basic | Bearer bearer\n@endpoints 55\n@hint download_for_search\n@toc users(6), settings(17), account(3), contacts(1), messages(2), groups(13), health(1), media(3), stats(2), metrics(1), support(1), certificates(5)\n\n@group users\n@endpoint POST /users/login\n@desc Login-User\n@required {new_password: str}\n@returns(200) OK\n\n@endpoint POST /users\n@desc Create-User\n@required {username: str # password, password: str # username}\n@returns(200)\n@example_request {\"username\":\"{{UserUsername}}\",\"password\":\"{{UserPassword}}\"}\n\n@endpoint GET /users/{UserUsername}\n@desc Get-User\n@required {UserUsername: str}\n@returns(200)\n\n@endpoint PUT /users/{UserUsername}\n@desc Update-User\n@required {UserUsername: str, password: str # password}\n@returns(200)\n@example_request {\"password\":\"<New Password>\"}\n\n@endpoint DELETE /users/{UserUsername}\n@desc Delete-User\n@required {UserUsername: str}\n@returns(200)\n\n@endpoint POST /users/logout\n@desc Logout-User\n@returns(200)\n\n@endgroup\n\n@group settings\n@endpoint GET /settings/application\n@desc Get-Application-Settings\n@returns(200) {callback_backoff_delay_ms: str, max_callback_backoff_delay_ms: str, callback_persist: bool, media: map{auto_download: [str]}, webhooks: map{url: str, max_concurrent_requests: int(int32)}, on_call_pager: str, pass_through: bool, sent_status: bool, unhealthy_interval: int, heartbeat_interval: int}\n\n@endpoint DELETE /settings/application\n@desc Reset-Application-Settings\n@returns(200)\n\n@endpoint PATCH /settings/application\n@desc Update-Application-Settings\n@optional {callback_backoff_delay_ms: str=3000 # Backoff delay for a failed callback in milliseconds This setting is used to configure the amount of time the backoff delays before retrying a failed callback. The backoff delay increases linearly by this value each time a callback fails to get a HTTPS 200 OK response. The backoff delay is capped by the max_callback_backoff_delay_ms setting., max_callback_backoff_delay_ms: str=900000 # Maximum delay for a failed callback in milliseconds, callback_persist: bool=true # Stores callbacks on disk until they are successfully acknowledged by the Webhook or not. Restart required., media: map{auto_download!: [str]}, webhooks: map{url: str, max_concurrent_requests: int(int32)}, on_call_pager: str # Set to valid WhatsApp Group with users who wish to see alerts for critical errors and messages., pass_through: bool=true # When true, removes messages from the local database after they are delivered to or read by the recipient. When false, saves all messages on local storage until they are explicitly deleted. When messages are sent, they are stored in a local database. This database is used as the application's history. Since the business keeps its own history, you can specify whether you want message pass_through or not. Restart required., sent_status: bool=false # Receive a notification that a message is sent to server. When true, you will receive a message indicating that a message has been sent. If false (default), you will not receive notification., unhealthy_interval: int=30 # Multiconnect: Maximum amount of seconds a Master node waits for a Coreapp node to respond to a heartbeat before considering it unhealthy and starting the failover process., heartbeat_interval: int=5 # Multiconnect: Interval of the Master node monitoring of Coreapp nodes in seconds}\n@returns(200) {meta: map{version: str, api_status: str}, errors: [map]}\n@example_request {\"webhooks\":{\"url\":\"<Webhook URL, https>\"}}\n\n@endgroup\n\n@group account\n@endpoint POST /account/shards\n@desc Set-Shards\n@required {cc: str, phone_number: str, shards: int(int32)(1/2/4/8/16/32), pin: str}\n@returns(200)\n@example_request {\"cc\":\"<Country Code>\",\"phone_number\":\"<Phone Number>\",\"shards\":32,\"pin\":\"<Two-Step PIN>\"}\n\n@endgroup\n\n@group settings\n@endpoint GET /settings/application/media/providers\n@desc Get-Media-Providers\n@returns(200)\n\n@endpoint POST /settings/application/media/providers\n@desc Update-Media-Providers\n@returns(200)\n@example_request [{\"name\":\"<Provider Name>\",\"type\":\"www\",\"config\":{\"bearer\":\"<Bearer Auth Token>\"}}]\n\n@endpoint DELETE /settings/application/media/providers/{ProviderName}\n@desc Delete-Media-Providers\n@required {ProviderName: str # Provider Name}\n@returns(200)\n\n@endpoint POST /settings/backup\n@desc Backup-Settings\n@required {password: str # Used to encrypt backup data for security}\n@returns(200) {settings: map{data: str}}\n@example_request {\"password\":\"<Password for Backup>\"}\n\n@endpoint POST /settings/restore\n@desc Restore-Settings\n@required {password: str # The password you used in the /v1/settings/backup API call to encrypt the backup data, data: str # The data that was returned by the /v1/settings/backup API call}\n@returns(200)\n@example_request {\"password\":\"<Password for Backup>\",\"data\":\"<Data to Restore, from Backup API>\"}\n\n@endpoint GET /settings/business/profile\n@desc Get-Business-Profile\n@returns(200)\n\n@endpoint POST /settings/business/profile\n@desc Update-Business-Profile\n@required {address: str # Address of the business Maximum of 256 characters, description: str # Description of the business Maximum of 256 characters, email: str # Email address to contact the business Maximum of 128 characters, vertical: str # Industry of the business Maximum of 128 characters, websites: [str] # URLs associated with business (e.g., website, Facebook page, Instagram) Maximum of 2 websites with a maximum of 256 characters each}\n@returns(200)\n@example_request {\"address\":\"<Business Profile Address>\",\"description\":\"<Business Profile Description>\",\"email\":\"<Business Profile Email>\",\"vertical\":\"<Business Profile Vertical>\",\"websites\":[\"https://www.whatsapp.com\",\"https://www.facebook.com\"]}\n\n@endpoint GET /settings/profile/about\n@desc Get-Profile-About\n@returns(200) {settings: map{profile: map{about: map{text: str}}}}\n\n@endpoint PATCH /settings/profile/about\n@desc Update-Profile-About\n@required {text: str # Text to display in your profile's About section The max length for the string is 139 characters.}\n@returns(200)\n@example_request {\"text\":\"<About Profile>\"}\n\n@endpoint POST /settings/account/two-step\n@desc Enable-Two-Step\n@required {pin: str}\n@returns(200)\n@example_request {\"pin\":\"<Two-Step Verification PIN>\"}\n\n@endpoint DELETE /settings/account/two-step\n@desc Disable-Two-Step\n@returns(200)\n\n@endgroup\n\n@group account\n@endpoint POST /account/verify\n@desc Register-Account\n@required {code: str}\n@returns(200)\n@example_request {\"code\":\"<Registration Code Received via SMS/Voice>\"}\n\n@endgroup\n\n@group contacts\n@endpoint POST /contacts\n@desc Check-Contact\n@required {contacts: [str] # Array of contact phone numbers. The numbers can be in any standard telephone number format.}\n@optional {blocking: str(no_wait/wait)=no_wait # Blocking determines whether the request should wait for the processing to complete (synchronous) or not (asynchronous).}\n@returns(200)\n@example_request {\"blocking\":\"wait\",\"contacts\":[\"{{Recipient-WA-ID}}\"]}\n\n@endgroup\n\n@group messages\n@endpoint POST /messages\n@desc Send-Message\n@required {to: str # When recipient_type is individual, this field is the WhatsApp ID (phone number) returned from contacts endpoint. When recipient_type is group, this field is the WhatsApp group ID.}\n@optional {type: str(audio/contacts/document/hsm/image/location/text/video/voice/unknown)=text # type of the message, recipient_type: str(individual/group)=individual # Determines whether the recipient is an individual or a group Specifying recipient_type in the request is optional when the value is individual. However, recipient_type is required when using group. If sending a text message to a group, see the Sending Group Messages documentation., text: map{body!: str}, audio: map # The media object containing audio, image: map # The media object containing an image, document: map # The media object containing a document, video: map # The media object containing a video, hsm: map{namespace!: str, element_name!: str, language!: map, localizable_params!: [map]} # The containing element for the message content — Indicates that the message is highly structured. Parameters contained within provide the structure., ttl: map, contacts: [map{addresses: [map], birthday: str, emails: [map], ims: [str], name: map, org: map, phones: [map], urls: [map]}], location: map{longitude!: str, latitude!: str, name!: str, address!: str}, preview_url: bool # Specifying preview_url in the request is optional when not including a URL in your message. To include a URL preview, set preview_url to true in the message body and make sure the URL begins with http:// or https://. For more information, see the Sending URLs in Text Messages section.}\n@returns(200)\n@example_request {\"to\":\"{{Recipient-WA-ID}}\",\"type\":\"text\",\"recipient_type\":\"individual\",\"text\":{\"body\":\"<Message Text>\"}}\n\n@endpoint PUT /messages/{MessageID}\n@desc Mark-Message-As-Read\n@required {MessageID: str # Message ID from Webhook, status: str=read}\n@returns(200)\n@example_request {\"status\":\"read\"}\n\n@endgroup\n\n@group groups\n@endpoint GET /groups\n@desc Get-All-Groups\n@returns(200)\n\n@endpoint POST /groups\n@desc Create-Group\n@required {subject: str}\n@returns(200)\n@example_request {\"subject\":\"<Group Subject>\"}\n\n@endpoint GET /groups/{GroupId}\n@desc Get-Group-Info\n@required {GroupId: str}\n@returns(200)\n\n@endpoint PUT /groups/{GroupId}\n@desc Update-Group-Info\n@required {GroupId: str, subject: str}\n@returns(200)\n@example_request {\"subject\":\"<New Group Subject>\"}\n\n@endpoint GET /groups/{GroupId}/invite\n@desc Get-Group-Invite\n@required {GroupId: str}\n@returns(200)\n\n@endpoint DELETE /groups/{GroupId}/invite\n@desc Delete-Group-Invite\n@required {GroupId: str}\n@returns(200)\n\n@endpoint DELETE /groups/{GroupId}/participants\n@desc Remove-Group-Participant\n@required {GroupId: str, wa_ids: [str]}\n@returns(200)\n@example_request {\"wa_ids\":[\"{{Recipient-WA-ID}}\"]}\n\n@endpoint POST /groups/{GroupId}/leave\n@desc Leave-Group\n@required {GroupId: str}\n@returns(200)\n\n@endpoint GET /groups/{GroupId}/icon\n@desc Get-Group-Icon-Binary\n@required {GroupId: str}\n@returns(200)\n\n@endpoint POST /groups/{GroupId}/icon\n@desc Set-Group-Icon\n@required {GroupId: str}\n@returns(200)\n\n@endpoint DELETE /groups/{GroupId}/icon\n@desc Delete-Group-Icon\n@required {GroupId: str}\n@returns(200)\n\n@endpoint DELETE /groups/{GroupId}/admins\n@desc Demote-Group-Admin\n@required {GroupId: str, wa_ids: [str] # The WhatsApp IDs of the people to be added or removed as group admins}\n@returns(200)\n@example_request {\"wa_ids\":[\"<Recipient WA-ID, from Contacts API>\"]}\n\n@endpoint PATCH /groups/{GroupId}/admins\n@desc Promote-To-Group-Admin\n@required {GroupId: str, wa_ids: [str] # The WhatsApp IDs of the people to be added or removed as group admins}\n@returns(200)\n@example_request {\"wa_ids\":[\"<Recipient WA-ID, from Contacts API>\"]}\n\n@endgroup\n\n@group health\n@endpoint GET /health\n@desc Check-Health\n@returns(200)\n\n@endgroup\n\n@group settings\n@endpoint GET /settings/profile/photo\n@desc Get-Profile-Photo\n@optional {format: str}\n@returns(200) {settings: map{profile: map{photo: map{link: str}}}}\n\n@endpoint POST /settings/profile/photo\n@desc Update-Profile-Photo\n@returns(200)\n\n@endpoint DELETE /settings/profile/photo\n@desc Delete-Profile-Photo\n@returns(200)\n\n@endgroup\n\n@group account\n@endpoint POST /account\n@desc Request-Code\n@required {cc: str # Numerical country code for the phone number you are registering, phone_number: str # Phone number you are registering, without the country code or plus symbol (+), method: str(sms/voice) # Method of receiving your registration code, cert: str # Base64-encoded Verified Name certificate}\n@optional {pin: str # Existing 6-digit PIN — This is only required when two-factor verification is enabled on this account.}\n@returns(201) Created: the account already exists. You are already registered, so you do not need to do anything else.\n@returns(202) {account: [map]} # Created: the account does not exist. Depending on the method selected in the request, check your SMS or voice number for the registration code.\n@example_request {\"cc\":\"<Country Code>\",\"phone_number\":\"<Phone Number>\",\"method\":\"sms\",\"cert\":\"<Valid Cert from Business Manager>\",\"pin\":\"<Two-Step Verification PIN\"}\n\n@endgroup\n\n@group media\n@endpoint POST /media\n@desc Upload-Media\n@returns(200)\n\n@endpoint GET /media/{MediaId}\n@desc Download-Media\n@required {MediaId: str}\n@returns(200)\n\n@endpoint DELETE /media/{MediaId}\n@desc Delete-Media\n@required {MediaId: str}\n@returns(200)\n\n@endgroup\n\n@group stats\n@endpoint GET /stats/app\n@desc Get-App-Stats\n@optional {format: str}\n@returns(200)\n\n@endpoint GET /stats/db\n@desc Get-DB-Stats\n@optional {format: str}\n@returns(200)\n\n@endgroup\n\n@group metrics\n@endpoint GET /metrics\n@desc Get-Metrics (since v2.21.3)\n@optional {format: str}\n@returns(200)\n\n@endgroup\n\n@group support\n@endpoint GET /support\n@desc Get-Support-Info\n@returns(200)\n\n@endgroup\n\n@group certificates\n@endpoint GET /certificates/external/ca\n@desc Download-CA-Certificate\n@returns(200)\n\n@endpoint POST /certificates/external\n@desc Upload-Certificate\n@returns(200)\n\n@endpoint GET /certificates/webhooks/ca\n@desc Download Webhook CA Certificate\n@returns(200)\n\n@endpoint POST /certificates/webhooks/ca\n@desc Upload Webhook CA Certificate\n@returns(200)\n\n@endpoint DELETE /certificates/webhooks/ca\n@desc Delete Webhook CA Certificate\n@returns(200)\n\n@endgroup\n\n@end\n"}}