Texa Desk Application API · Campaigns
Create a campaign
POST/
Create a campaign. For a supported messaging inbox, provide scheduled_at to schedule a one-off campaign; omitting it makes the campaign eligible for the next scheduler run. Website campaigns use trigger_rules instead. Channel-specific campaign availability and requirements still apply. One-off campaigns require at least one audience label for delivery. WhatsApp campaigns also require template_params with the selected template name, language, and any variable values. A successful creation response does not confirm delivery. Requires an account administrator and API access enabled for the account.
Authorization
api_access_tokenheaderrequiredA person's access token (Texa Desk, Profile settings → Access token) or an agent bot's token, in the api_access_token header. It acts as that person, with their role's permissions.
Path parameters
account_idintegerrequiredThe numeric ID of the account
Body application/json
campaignobjectrequiredChoose the variant matching the inbox referenced by inbox_id. The channel type is stored on the inbox and cannot be inferred from this request by a schema validator. These variants describe the inputs needed for delivery; creation can accept incomplete inputs without guaranteeing that the campaign will send.
campaign.titlestringrequiredCampaign title.
campaign.descriptionstringInternal description of the campaign.
campaign.inbox_idintegerrequiredID of an inbox in this account. Supported inbox types are Website, Twilio SMS, SMS, and WhatsApp.
campaign.sender_idintegerID of a user in this account to use as the campaign sender.
campaign.messagestringrequiredCampaign message content.
campaign.enabledbooleanWhether an ongoing website campaign is enabled. This does not cancel a scheduled one-off campaign.
campaign.scheduled_atstring (date-time)Scheduled time for a one-off campaign, as an ISO 8601 timestamp with timezone. Defaults to the current time when omitted; website campaigns ignore this field. Responses return Unix seconds instead.
campaign.audiencearray of objectRequired when creating a one-off SMS or WhatsApp campaign. Provide at least one label from this account. Contacts matching any selected label are included. When updating, omit this field to retain the existing audience.
campaign.audience[].typestringrequiredOne of: Label.
campaign.audience[].idintegerrequiredID of a label in this account.
campaign.trigger_rulesobjectWebsite campaign trigger rules. Defaults to an empty object and can be omitted for a one-off campaign.
campaign.trigger_only_during_business_hoursbooleanRestrict an ongoing website campaign to inbox business hours.
campaign.template_paramsobjectcampaign.template_params.namestringrequiredName of the approved template in the selected inbox's message_templates.
campaign.template_params.languagestringrequiredLanguage code matching that template in the selected inbox.
campaign.template_params.namespacestringTemplate namespace, when present in the selected template.
campaign.template_params.categorystringCategory of the selected template.
campaign.template_params.processed_paramsobjectValues for the selected template's variables, grouped by component. Supply all parameters needed by that template. May be omitted for a template without variables. Body keys use positional numbers or the template's named parameters. Liquid expressions such as {{ contact.name }} are rendered separately for each recipient.
Responses
200Success
idintegerAccount-scoped campaign ID. Use this value in campaign API paths.
titlestringdescriptionstringaccount_idintegerinboxobjectinbox.idnumberID of the inbox
inbox.namestringThe name of the inbox
inbox.website_urlstringWebsite URL
inbox.page_idstringFacebook Page ID associated with the inbox
inbox.instagram_idstringInstagram account ID associated with the inbox
inbox.business_idstringTikTok business ID associated with the inbox
inbox.provider_namestringProvider username or page name associated with the social inbox
inbox.profile_idstringX profile ID associated with the inbox
inbox.line_channel_idstringLINE channel ID associated with the inbox
inbox.emailstringEmail address associated with the inbox
inbox.bot_namestringTelegram bot name associated with the inbox
inbox.inbox_identifierstringPublic identifier associated with an API inbox
inbox.channel_typestringThe type of the inbox
inbox.avatar_urlstringThe avatar image of the inbox
inbox.widget_colorstringWidget Color used for customization of the widget
inbox.website_tokenstringWebsite Token
inbox.enable_auto_assignmentbooleanThe flag which shows whether Auto Assignment is enabled or not
inbox.web_widget_scriptstringScript used to load the website widget
inbox.welcome_titlestringWelcome title to be displayed on the widget
inbox.welcome_taglinestringWelcome tagline to be displayed on the widget
inbox.greeting_enabledbooleanThe flag which shows whether greeting is enabled
inbox.greeting_messagestringA greeting message when the user starts the conversation
inbox.channel_idnumberID of the channel this inbox belongs to
inbox.working_hours_enabledbooleanThe flag which shows whether working hours feature is enabled
inbox.enable_email_collectbooleanThe flag to enable collecting email from contacts
inbox.csat_survey_enabledbooleanThe flag to enable CSAT survey
inbox.auto_assignment_configobjectConfiguration settings for auto assignment
inbox.out_of_office_messagestringMessage to show when agents are out of office
inbox.working_hoursarray of objectConfiguration for working hours of the inbox
inbox.working_hours[].day_of_weeknumberDay of the week (0-6, where 0 is Sunday)
inbox.working_hours[].closed_all_daybooleanWhether the inbox is closed for the entire day
inbox.working_hours[].open_hournumberHour when inbox opens (0-23)
inbox.working_hours[].open_minutesnumberMinutes of the hour when inbox opens (0-59)
inbox.working_hours[].close_hournumberHour when inbox closes (0-23)
inbox.working_hours[].close_minutesnumberMinutes of the hour when inbox closes (0-59)
inbox.working_hours[].open_all_daybooleanWhether the inbox is open for the entire day
inbox.timezonestringTimezone configuration for the inbox
inbox.callback_webhook_urlstringWebhook URL for callbacks
inbox.allow_messages_after_resolvedbooleanWhether to allow messages after a conversation is resolved
inbox.lock_to_single_conversationbooleanWhether to lock a contact to a single conversation
inbox.sender_name_typestringType of sender name to display (e.g., friendly)
inbox.business_namestringBusiness name associated with the inbox
inbox.branded_email_layoutstringLiquid HTML layout for branded email replies. Available to administrators for Email inbox show/update responses.
inbox.hmac_mandatorybooleanWhether HMAC verification is mandatory
inbox.selected_feature_flagsarray of stringSelected feature flags for the inbox
inbox.reply_timestringExpected reply time
inbox.messaging_service_sidstringMessaging service SID for SMS providers
inbox.phone_numberstringPhone number associated with the inbox
inbox.mediumstringMedium of communication (e.g., sms, email)
inbox.providerstringProvider of the channel
senderobjectSender details, or an empty object when no sender is assigned.
messagestringtemplate_paramsobjectcampaign_statusstringOne of: active, processing, completed.
campaign_typestringDerived from the inbox type; website campaigns are ongoing and supported messaging campaigns are one-off. One of: ongoing, one_off.
enabledbooleanscheduled_atintegerScheduled time in Unix seconds. Only present for one-off campaigns.
started_atintegerStart time in Unix seconds. Only present for one-off campaigns.
completed_atintegerCompletion time in Unix seconds. Only present for one-off campaigns.
audiencearray of objectAudience for a one-off campaign. Only present for one-off campaigns.
trigger_rulesobjecttrigger_only_during_business_hoursbooleancreated_atstring (date-time)updated_atstring (date-time)Authentication failed or the user is not an account administrator
API access is disabled for the account
Campaign validation failed