Profile picture
Last update: 6 hours ago by Irais Aguirre
Integration summary
- Base URL:
https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services- Token: admin token, in the
Authorization: Bearer {{admin-token}}header (how to generate it)- Endpoints on this page:
POST /v1/profile/photo: Update profile picture
Change the profile picture of a phone number. The image is sent as bytes in the request body.
Update profile picture
Request
Update profile picture request:
| URL | https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/profile/photo |
| Method | POST |
| Type | image/jpeg, image/jpg, image/png |
Headers
Update profile picture headers:
| Name | Description | Type | Requirements |
|---|---|---|---|
| Content-Type | Image type. Possible values:
| String | Required |
| Authorization | Admin token. See Generate authentication token. | String | Required |
| phone_number_id | Business phone number, including country code. Example: 5215500000000. | String | Required |
Body
Update profile picture body fields:
| Name | Description | Type | Requirements |
|---|---|---|---|
| Image file | The image file's bytes, sent as-is in the request body. WhatsApp crops and scales the picture to a square of at most 640 px per side and 5 MB. Images less than 192 px high or wide may look bad after resizing, so a 640 x 640 px image is recommended. | Binary | Required |
Example
Complete Update profile picture example:
curl --location 'https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/profile/photo' \--header 'phone_number_id: 5215500000000' \--header 'Content-Type: image/jpeg' \--header 'Authorization: Bearer {{admin-token}}' \--data-binary '@/path/to/logo.jpg'
Response
Update profile picture response:
| Name | Description | Type |
|---|---|---|
| code | Response code. If the request succeeds, the value is 0. | Integer |
| detail | Response detail. If the request succeeds, the value is "Success". | String |
{"code": 0,"detail": "Success"}
Note: if Meta rejects the image, the service returns HTTP 200 with code 15 ("Image is not valid, permitted formats are: JPEG, JPG and PNG") in the body. Clients must check the response code field, not only the HTTP status.
