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

# Get campaign

> Retrieve campaign details by `campaignId`.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/messaging-10dlc/campaigns.yml get /10dlc/campaign/{campaignId}
openapi: 3.1.0
info:
  title: Telnyx 10DLC Campaigns API
  version: 2.0.0
  description: API for 10DLC campaign management.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /10dlc/campaign/{campaignId}:
    get:
      tags:
        - Campaign
      summary: Get campaign
      description: Retrieve campaign details by `campaignId`.
      operationId: GetCampaign
      parameters:
        - required: true
          schema:
            title: Campaignid
            type: string
          name: campaignId
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelnyxCampaign_CSP'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        4XX:
          $ref: '#/components/responses/10dlc_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 telnyxCampaignCsp = await
            client.messaging10dlc.campaign.retrieve('campaignId');


            console.log(telnyxCampaignCsp.brandId);
        - 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
            )
            telnyx_campaign_csp = client.messaging_10dlc.campaign.retrieve(
                "campaignId",
            )
            print(telnyx_campaign_csp.brand_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\ttelnyxCampaignCsp, err := client.Messaging10dlc.Campaign.Get(context.TODO(), \"campaignId\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", telnyxCampaignCsp.BrandID)\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.campaign.CampaignRetrieveParams;

            import
            com.telnyx.sdk.models.messaging10dlc.campaign.TelnyxCampaignCsp;


            public final class Main {
                private Main() {}

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

                    TelnyxCampaignCsp telnyxCampaignCsp = client.messaging10dlc().campaign().retrieve("campaignId");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            telnyx_campaign_csp =
            telnyx.messaging_10dlc.campaign.retrieve("campaignId")


            puts(telnyx_campaign_csp)
        - 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 {
              $telnyxCampaignCsp = $client->messaging10dlc->campaign->retrieve(
                'campaignId'
              );

              var_dump($telnyxCampaignCsp);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx messaging-10dlc:campaign retrieve \
              --api-key 'My API Key' \
              --campaign-id campaignId
components:
  schemas:
    TelnyxCampaign_CSP:
      title: TelnyxCampaign_CSP
      required:
        - brandId
        - campaignId
        - cspId
        - description
        - mock
        - subUsecases
        - termsAndConditions
        - usecase
      type: object
      properties:
        ageGated:
          title: Agegated
          type: boolean
          description: Age gated content in campaign.
        autoRenewal:
          title: Autorenewal
          type: boolean
          description: Campaign subscription auto-renewal status.
        billedDate:
          title: Billeddate
          type: string
          description: Campaign recent billed date.
        brandId:
          title: Brandid
          type: string
          description: Unique identifier assigned to the brand.
          example: d2ca9d69-641b-4131-83fa-5d0744f4c8a9
        brandDisplayName:
          title: Branddisplayname
          description: Display or marketing name of the brand.
          example: ABC Mobile
          type: string
        campaignId:
          title: Campaignid
          type: string
          description: Unique identifier for a campaign.
          example: 823d6b1a-6ed6-41a3-9c50-c8ff41b682ba
        tcrBrandId:
          title: TcrBrandid
          type: string
          description: Unique identifier assigned to the brand by the registry.
          example: BBRAND1
        tcrCampaignId:
          title: TcrCampaignid
          type: string
          description: Unique identifier assigned to the campaign by the registry.
          example: CCAMP1
        createDate:
          title: Createdate
          type: string
          description: Unix timestamp when campaign was created.
        cspId:
          title: Cspid
          type: string
          description: Alphanumeric identifier of the CSP associated with this campaign.
        description:
          title: Description
          type: string
          description: Summary description of this campaign.
        directLending:
          title: Directlending
          type: boolean
        embeddedLink:
          title: Embeddedlink
          type: boolean
          description: Does message generated by the campaign include URL link in SMS?
        embeddedPhone:
          title: Embeddedphone
          type: boolean
          description: Does message generated by the campaign include phone number in SMS?
        helpKeywords:
          title: Helpkeywords
          type: string
          description: >-
            Subscriber help keywords. Multiple keywords are comma separated
            without space.
        helpMessage:
          title: Helpmessage
          type: string
          description: Help message of the campaign.
        messageFlow:
          title: Messageflow
          type: string
          description: Message flow description.
        mock:
          title: Mock
          type: boolean
          description: >-
            Campaign created from mock brand. Mocked campaign cannot be shared
            with an upstream CNP.
        nextRenewalOrExpirationDate:
          title: Nextrenewalorexpirationdate
          type: string
          description: When the campaign would be due for its next renew/bill date.
        numberPool:
          title: Numberpool
          type: boolean
          description: Does campaign utilize pool of phone numbers?
        optinKeywords:
          title: Optinkeywords
          type: string
          description: >-
            Subscriber opt-in keywords. Multiple keywords are comma separated
            without space.
        optinMessage:
          title: Optinmessage
          type: string
          description: Subscriber opt-in message.
        optoutKeywords:
          title: Optoutkeywords
          type: string
          description: >-
            Subscriber opt-out keywords. Multiple keywords are comma separated
            without space.
        optoutMessage:
          title: Optoutmessage
          type: string
          description: Subscriber opt-out message.
        referenceId:
          title: Referenceid
          type: string
          description: >-
            Caller supplied campaign reference ID. If supplied, the value must
            be unique across all submitted campaigns. Can be used to prevent
            duplicate campaign registrations.
        resellerId:
          title: Resellerid
          type: string
          description: >-
            Alphanumeric identifier of the reseller that you want to associate
            with this campaign.
        sample1:
          title: Sample1
          type: string
          description: >-
            Message sample. Some campaign tiers require 1 or more message
            samples.
        sample2:
          title: Sample2
          type: string
          description: >-
            Message sample. Some campaign tiers require 2 or more message
            samples.
        sample3:
          title: Sample3
          type: string
          description: >-
            Message sample. Some campaign tiers require 3 or more message
            samples.
        sample4:
          title: Sample4
          type: string
          description: >-
            Message sample. Some campaign tiers require 4 or more message
            samples.
        sample5:
          title: Sample5
          type: string
          description: >-
            Message sample. Some campaign tiers require 5 or more message
            samples.
        status:
          title: Status
          type: string
          description: >-
            Current campaign status. Possible values: ACTIVE, EXPIRED. A newly
            created campaign defaults to ACTIVE status. 
        subUsecases:
          title: Subusecases
          uniqueItems: true
          type: array
          items:
            type: string
          description: >-
            Campaign sub-usecases. Must be of defined valid sub-usecase types.
            Use `/10dlc/enum/usecase` operation to retrieve list of valid
            sub-usecases
        subscriberHelp:
          title: Subscriberhelp
          type: boolean
          description: Does campaign responds to help keyword(s)?
        subscriberOptin:
          title: Subscriberoptin
          type: boolean
          description: >-
            Does campaign require subscriber to opt-in before SMS is sent to
            subscriber?
        subscriberOptout:
          title: Subscriberoptout
          type: boolean
          description: Does campaign support subscriber opt-out keyword(s)?
        termsAndConditions:
          title: Termsandconditions
          type: boolean
          description: Is terms & conditions accepted?
        usecase:
          title: Usecase
          type: string
          description: >-
            Campaign usecase. Must be of defined valid types. Use
            `/10dlc/enum/usecase` operation to retrieve usecases available for
            given brand.
        vertical:
          title: Vertical
          type: string
          description: >-
            Business/industry segment of this campaign (Deprecated). Must be of
            defined valid types. Use `/registry/enum/vertical` operation to
            retrieve verticals available for given brand, vertical combination.


            This field is deprecated.
          deprecated: true
        webhookURL:
          title: WebhookURL
          type: string
          description: Webhook to which campaign status updates are sent.
          example: https://example.com/webhook
        webhookFailoverURL:
          title: WebhookFailoverURL
          type: string
          description: Failover webhook to which campaign status updates are sent.
          example: https://example.com/failover-webhook
        isTMobileRegistered:
          title: IsTMobileRegistered
          type: boolean
          description: Indicates whether the campaign is registered with T-Mobile.
        isTMobileSuspended:
          title: isTMobileSuspended
          type: boolean
          description: Indicates whether the campaign is suspended with T-Mobile.
        isTMobileNumberPoolingEnabled:
          title: isTMobileNumberPoolingEnabled
          type: boolean
          description: >-
            Indicates whether the campaign has a T-Mobile number pool ID
            associated with it.
        failureReasons:
          title: failureReasons
          description: Failure reasons if campaign submission failed
          type: string
        submissionStatus:
          title: submissionStatus
          description: Campaign submission status
          enum:
            - CREATED
            - FAILED
            - PENDING
          type: string
        campaignStatus:
          title: campaignStatus
          description: Campaign status
          example: TCR_ACCEPTED
          enum:
            - TCR_PENDING
            - TCR_SUSPENDED
            - TCR_EXPIRED
            - TCR_ACCEPTED
            - TCR_FAILED
            - TELNYX_ACCEPTED
            - TELNYX_FAILED
            - MNO_PENDING
            - MNO_ACCEPTED
            - MNO_REJECTED
            - MNO_PROVISIONED
            - MNO_PROVISIONING_FAILED
          type: string
        privacyPolicyLink:
          title: PrivacyPolicyLink
          type: string
          description: Link to the campaign's privacy policy.
        termsAndConditionsLink:
          title: TermsAndConditionsLink
          type: string
          description: Link to the campaign's terms and conditions.
        embeddedLinkSample:
          title: EmbeddedLinkSample
          type: string
          description: Sample of an embedded link that will be sent to subscribers.
      description: >-
        Campaign is generated by the 10DLC registry once the corresponding
        campaign request is approved. Each campaign is assigned a unique
        identifier - **campaignId**. Once a campaign is activated, limited
        information is published to the NetNumber OSR service for consumption by
        members of the ecosystem. When a campaign is suspended(reversible) or
        expired(non-reversible), campaign data is deleted from the OSR service.
        Most attributes of campaignare immutable, including **usecase**,
        **vertical**, **brandId** and **cspId**.
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
    10dlc_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/10dlc_Error'
      type: object
    10dlc_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:
    10dlc_GenericErrorResponse:
      description: Generic response error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/10dlc_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````