Skip to main content

Configure SMS Campaign

Update one or more parts of an SMS campaign configuration. The campaign must be in DRAFT status. Each top-level field is optional; omitted fields remain unchanged.


Endpoint

PATCH https://api.campaignlark.com/v1/sms-campaigns/:id/configure

Path Parameters

ParameterTypeRequiredDescription
idstringrequiredCampaign ID as a MongoDB ObjectID hex string.

Request Body

FieldTypeRequiredDescription
namestringoptionalCampaign name. Must be 1–255 characters when provided.
messagestringoptionalSMS message. Must be 1–1600 characters when provided.
audiencearrayoptionalAudience configuration. Providing it replaces the existing audience.
audience[].typestringrequired when audience is providedENTIRE_AUDIENCE, TAGS, or SEGMENTS.
audience[].tagsarray of integersrequired for TAGSTags to include.
audience[].segmentsarray of integersrequired for SEGMENTSSegments to include.
audience[].exclude_tagsarray of integersoptionalTags to exclude.
audience[].exclude_segmentsarray of integersoptionalSegments to exclude.

Sample Request

PATCH https://api.campaignlark.com/v1/sms-campaigns/64f1a2b3c4d5e6f7a8b9c0d1/configure
Content-Type: application/json

{
"name": "Summer Sale SMS",
"message": "Summer sale: 20% off today. https://example.com/sale",
"audience": [
{
"type": "SEGMENTS",
"segments": [2, 7],
"exclude_segments": [4]
}
]
}

Response

Success — 200 OK

Returns the updated SMS campaign object in the same shape as Get SMS Campaign.


Errors

StatusMessageCause
400Invalid request body.The request body could not be parsed.
400Please provide a campaign ID.id is missing.
400We could not find the campaign you are looking for.The ID is malformed or the campaign does not exist in the workspace.
400Please provide a name for this campaign.name is empty or whitespace.
400The campaign name must be 255 characters or less.name exceeds 255 characters.
400Please provide a message for this campaign.message is empty or whitespace.
400The message must be 1600 characters or less.message exceeds 1600 characters.
400Please configure an audience for this campaign.audience is empty.
400At least one tag is required for this audience.A TAGS audience has no included tags.
400At least one segment is required for this audience.A SEGMENTS audience has no included segments.
400Invalid tag ID provided.A tag ID is not positive.
400Invalid segment ID provided.A segment ID is not positive.
400One or more tags could not be found.A referenced tag does not exist in the workspace.
400One or more segments could not be found.A referenced segment does not exist in the workspace.
400Invalid exclude tag ID provided.An excluded tag ID is not positive.
400Invalid exclude segment ID provided.An excluded segment ID is not positive.
400One or more exclude tags could not be found.A referenced excluded tag does not exist.
400One or more exclude segments could not be found.A referenced excluded segment does not exist.
400Invalid audience type. Must be 'ENTIRE_AUDIENCE', 'TAGS', or 'SEGMENTS'.The audience type is invalid.
400Archived campaigns cannot be edited.The campaign is archived.
400Only draft campaigns can be edited.The campaign is not in DRAFT status.