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

# Update Phone Number Campaign



## OpenAPI

````yaml /openapi/source/external/messaging/10dlc.json put /10dlc/phone_number_campaigns/{phoneNumber}
openapi: 3.1.0
info:
  title: Telnyx 10DLC API
  description: >-
    # Overview

    The Telnyx 10DLC API facilitates interaction with The Campaign Registry
    (TCR), allowing the creation and registration of brands and campaigns with
    TCR.


    # API Interaction

    ## Request Authorization

    Telnyx 10DLC API endpoints require authorization for each request. To
    properly authorize requests, send an Authorization header with `Bearer `
    plus your Telnyx API key as the value. See the following curl request for
    example usage:


    ```sh

    curl --location --request GET
    'https://api.telnyx.com/10dlc/example/endpoint' \ 

    --header 'Authorization: Bearer YOUR_API_KEY_GOES_HERE' \ 

    --data-raw ''

    ```


    You can obtain your API key by logging into your <a
    href="https://portal.telnyx.com">Telnyx portal account</a> and clicking the
    "API Keys" tab. From there, you can copy your desired API key for use in
    your requests, similar to the above example curl request.


    ## The 10DLC Work Flow

    1. Create a brand


    2. Apply for brand vetting


    3. Create a campaign or campaigns (associated with the created brand)


    4. Assign a phone number or phone numbers to the created campaign

    ## 10DLC Costs

    **Brands:**

    1. Brand registration: $4 one time charge


    2.  Brand vetting: $40 one time charge


    **Campaigns:**


    1. Campaign registration T-Mobile: $50 one time charge


    2. Campaign creation: first 3 month's charge upfront. After the first 3
    months, this charge will change to a once a month recurring charge (see
    charge values below, based on campaign use case)

       a. Charity Campaign Use Case: $15 upfront (first 3 months), and $5 month to month after

       b. Low Mixed Volume Campaign Use Case: $6 upfront (first 3 months), and $2 month to month after

       c. Any Other Campaign Use Case: $30 upfront (first 3 months), and $10 month to month after
    3. Phone number to campaign assignment: $0.03 one time charge for each
    assignment


    ## Frequently Asked Questions

    For frequently asked questions, visit <a
    href="https://support.telnyx.com/en/articles/3679260-frequently-asked-questions-about-10dlc">Telnyx
    10DLC FAQs</a>.
  version: '0.1'
  x-latency-category: responsive
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: Brands
    description: Brand operations
  - name: Campaign
    description: Campaign operations
  - name: Phone Number Campaigns
    description: Phone number campaign assignment
  - name: Bulk Small Business
    description: >-
      Endpoints for creating and checking the status of campaigns, brands, and
      phone numbers
  - name: Bulk Phone Number Campaigns
    description: Phone number campaign bulk assignment
  - name: Callbacks
    description: Callbacks
paths:
  /10dlc/phone_number_campaigns/{phoneNumber}:
    put:
      tags:
        - Phone Number Campaigns
      summary: Update Phone Number Campaign
      operationId: PutPhoneNumberCampaign
      parameters:
        - required: true
          schema:
            title: Phonenumber
            type: string
          name: phoneNumber
          in: path
          description: Unique identifier of the phone number.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneNumberCampaignCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberCampaign'
        4XX:
          $ref: '#/components/responses/GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const phoneNumberCampaign = await
            client.messaging10dlc.phoneNumberCampaigns.update('phoneNumber', {
              campaignId: '4b300178-131c-d902-d54e-72d90ba1620j',
              phoneNumber: '+18005550199',
            });


            console.log(phoneNumberCampaign.campaignId);
        - 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
            )

            phone_number_campaign =
            client.messaging_10dlc.phone_number_campaigns.update(
                campaign_phone_number="phoneNumber",
                campaign_id="4b300178-131c-d902-d54e-72d90ba1620j",
                phone_number="+18005550199",
            )

            print(phone_number_campaign.campaign_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\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\tphoneNumberCampaign, err := client.Messaging10dlc.PhoneNumberCampaigns.Update(\n\t\tcontext.TODO(),\n\t\t\"phoneNumber\",\n\t\ttelnyx.Messaging10dlcPhoneNumberCampaignUpdateParams{\n\t\t\tPhoneNumberCampaignCreate: telnyx.PhoneNumberCampaignCreateParam{\n\t\t\t\tCampaignID:  \"4b300178-131c-d902-d54e-72d90ba1620j\",\n\t\t\t\tPhoneNumber: \"+18005550199\",\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", phoneNumberCampaign.CampaignID)\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.messaging10dlc.phonenumbercampaigns.PhoneNumberCampaign;

            import
            com.telnyx.sdk.models.messaging10dlc.phonenumbercampaigns.PhoneNumberCampaignCreate;

            import
            com.telnyx.sdk.models.messaging10dlc.phonenumbercampaigns.PhoneNumberCampaignUpdateParams;


            public final class Main {
                private Main() {}

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

                    PhoneNumberCampaignUpdateParams params = PhoneNumberCampaignUpdateParams.builder()
                        .campaignPhoneNumber("phoneNumber")
                        .phoneNumberCampaignCreate(PhoneNumberCampaignCreate.builder()
                            .campaignId("4b300178-131c-d902-d54e-72d90ba1620j")
                            .phoneNumber("+18005550199")
                            .build())
                        .build();
                    PhoneNumberCampaign phoneNumberCampaign = client.messaging10dlc().phoneNumberCampaigns().update(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            phone_number_campaign =
            telnyx.messaging_10dlc.phone_number_campaigns.update(
              "phoneNumber",
              campaign_id: "4b300178-131c-d902-d54e-72d90ba1620j",
              phone_number: "+18005550199"
            )


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


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


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


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


            try {
              $phoneNumberCampaign = $client->messaging10dlc->phoneNumberCampaigns->update(
                'phoneNumber',
                campaignID: '4b300178-131c-d902-d54e-72d90ba1620j',
                phoneNumber: '+18005550199',
              );

              var_dump($phoneNumberCampaign);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx messaging-10dlc:phone-number-campaigns update \
              --api-key 'My API Key' \
              --campaign-phone-number phoneNumber \
              --campaign-id 4b300178-131c-d902-d54e-72d90ba1620j \
              --phone-number +18005550199
components:
  schemas:
    PhoneNumberCampaignCreate:
      title: PhoneNumberCampaignCreate
      required:
        - phoneNumber
        - campaignId
      type: object
      properties:
        phoneNumber:
          title: Phonenumber
          type: string
          description: The phone number you want to link to a specified campaign.
          example: '+18005550199'
        campaignId:
          title: Campaignid
          type: string
          description: >-
            The ID of the campaign you want to link to the specified phone
            number.
          example: 4b300178-131c-d902-d54e-72d90ba1620j
    PhoneNumberCampaign:
      title: PhoneNumberCampaign
      required:
        - phoneNumber
        - campaignId
        - createdAt
        - updatedAt
      type: object
      properties:
        phoneNumber:
          title: Phonenumber
          type: string
          example: '+18005550199'
        brandId:
          description: Brand ID. Empty if the number is associated to a shared campaign.
          title: BrandId
          type: string
          example: 7ba705b7-22af-493f-addc-ac04b7ca071c
        tcrBrandId:
          description: TCR's alphanumeric ID for the brand.
          title: TcrBrandId
          type: string
          example: BBRAND1
        campaignId:
          description: >-
            For shared campaigns, this is the TCR campaign ID, otherwise it is
            the campaign ID 
          title: Campaignid
          type: string
        tcrCampaignId:
          description: TCR's alphanumeric ID for the campaign.
          title: TcrCampaignid
          type: string
          example: CCAMPA1
        telnyxCampaignId:
          description: Campaign ID. Empty if the number is associated to a shared campaign.
          title: Telnyxcampaignid
          type: string
          example: 3008dd9f-66d7-40e0-bf23-bf2d8d1a96ba
        assignmentStatus:
          description: The assignment status of the number.
          title: AssignmentStatus
          enum:
            - FAILED_ASSIGNMENT
            - PENDING_ASSIGNMENT
            - ASSIGNED
            - PENDING_UNASSIGNMENT
            - FAILED_UNASSIGNMENT
          example: ASSIGNED
          type: string
        tmobileNumberMappingStatus:
          description: The T-Mobile assignment status of the number.
          title: TMobileNumberMappingStatus
          type: string
          example: ADDED
        nonTmobileNumberMappingStatus:
          description: The assignment status of the number towards other carriers.
          title: NonTMobileNumberMappingStatus
          type: string
          example: ADDED
        failureReasons:
          description: >-
            Extra info about a failure to assign/unassign a number. Relevant
            only if the assignmentStatus is either FAILED_ASSIGNMENT or
            FAILED_UNASSIGNMENT
          type: string
        createdAt:
          title: Createdat
          type: string
          example: '2021-03-08T17:57:48.801186'
        updatedAt:
          title: Updatedat
          type: string
          example: '2021-03-08T17:57:48.801186'
    Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      type: object
    Error:
      required:
        - code
        - title
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
  responses:
    GenericErrorResponse:
      description: Generic response error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````