logo
enes

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:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/profile/photo
MethodPOST
Typeimage/jpeg, image/jpg, image/png

Headers

Update profile picture headers:

NameDescriptionTypeRequirements
Content-TypeImage type. Possible values:
  • image/jpeg
  • image/jpg
  • image/png
StringRequired
AuthorizationAdmin token. See Generate authentication token.StringRequired
phone_number_idBusiness phone number, including country code. Example: 5215500000000.StringRequired

Body

Update profile picture body fields:

NameDescriptionTypeRequirements
Image fileThe 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.BinaryRequired

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:

NameDescriptionType
codeResponse code. If the request succeeds, the value is 0.Integer
detailResponse 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.


Previous
Business profile
Next
Error codes