Check out our upcoming events and meetups! View events →
import fs from 'fs';
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.whatsapp.phoneNumbers.profile.photo.upload('phone_number', {
file: fs.createReadStream('path/to/file'),
});
console.log(response.data);{
"data": {
"id": "<string>",
"record_type": "whatsapp_phone_number_profiles",
"phone_number_id": "<string>",
"display_name": "<string>",
"profile_photo_url": "<string>",
"category": "<string>",
"about": "<string>",
"description": "<string>",
"email": "<string>",
"website": "<string>",
"address": "<string>",
"profile_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Phone number (E.164 format)
Image file (JPEG recommended, max 10 MB)
Profile with updated photo
Show child attributes
Was this page helpful?
import fs from 'fs';
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.whatsapp.phoneNumbers.profile.photo.upload('phone_number', {
file: fs.createReadStream('path/to/file'),
});
console.log(response.data);{
"data": {
"id": "<string>",
"record_type": "whatsapp_phone_number_profiles",
"phone_number_id": "<string>",
"display_name": "<string>",
"profile_photo_url": "<string>",
"category": "<string>",
"about": "<string>",
"description": "<string>",
"email": "<string>",
"website": "<string>",
"address": "<string>",
"profile_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}