> ## 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.

# Upload Whatsapp profile photo



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/whatsapp/management.yml post /whatsapp/phone_numbers/{phone_number}/profile/photo
openapi: 3.1.0
info:
  title: Telnyx WhatsApp Management API
  version: 2.0.0
  description: >
    API for managing WhatsApp Business Accounts (WABAs), phone numbers, and
    message templates.


    Use these endpoints to:

    - List and manage WhatsApp Business Accounts

    - Configure phone numbers for WhatsApp

    - Create and manage message templates

    - Set up webhook configurations
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /whatsapp/phone_numbers/{phone_number}/profile/photo:
    post:
      tags:
        - Whatsapp Phone Numbers
      summary: Upload Whatsapp profile photo
      operationId: PostWhatsappProfilePhoto
      parameters:
        - $ref: '#/components/parameters/WhatsappPhoneNumber'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Image file (JPEG recommended, max 10 MB)
      responses:
        '200':
          $ref: '#/components/responses/WhatsappProfileSingleResponse'
          description: Profile with updated photo
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.whatsapp.phone_numbers.profile.photo.upload(
                phone_number="phone_number",
                file=b"Example data",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Whatsapp.PhoneNumbers.Profile.Photo.Upload(\n\t\tcontext.TODO(),\n\t\t\"phone_number\",\n\t\ttelnyx.WhatsappPhoneNumberProfilePhotoUploadParams{\n\t\t\tFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.whatsapp.phonenumbers.profile.photo.PhotoUploadParams;

            import
            com.telnyx.sdk.models.whatsapp.phonenumbers.profile.photo.PhotoUploadResponse;

            import java.io.ByteArrayInputStream;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    PhotoUploadParams params = PhotoUploadParams.builder()
                        .phoneNumber("phone_number")
                        .file(new ByteArrayInputStream("Example data".getBytes()))
                        .build();
                    PhotoUploadResponse response = client.whatsapp().phoneNumbers().profile().photo().upload(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            response =
            telnyx.whatsapp.phone_numbers.profile.photo.upload("phone_number",
            file: StringIO.new("Example data"))


            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\FileParam;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->whatsapp->phoneNumbers->profile->photo->upload(
                'phone_number',
                file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx whatsapp:phone-numbers:profile:photo upload \
              --api-key 'My API Key' \
              --phone-number phone_number \
              --file 'Example data'
components:
  parameters:
    WhatsappPhoneNumber:
      name: phone_number
      in: path
      required: true
      schema:
        type: string
      description: Phone number (E.164 format)
  responses:
    WhatsappProfileSingleResponse:
      description: Successful response with Whatsapp profile
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/WhatsappProfileData'
    messaging_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
  schemas:
    WhatsappProfileData:
      type: object
      properties:
        id:
          type: string
        record_type:
          type: string
          example: whatsapp_phone_number_profiles
        phone_number_id:
          type: string
          description: Whatsapp phone number ID
        display_name:
          type: string
        profile_photo_url:
          type: string
        category:
          type: string
        about:
          type: string
          maxLength: 139
        description:
          type: string
          maxLength: 512
        email:
          type: string
        website:
          type: string
        address:
          type: string
        profile_id:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    messaging_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/messaging_Error'
    messaging_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          x-format: integer
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````