Skip to main content

Add or alter campaign groups

This endpoint allows you to add or alter campaign groups.

Contents

Overview

Call namealter-campaign-group
Endpoint URLhttps://{API hostname}/internal/alter-campaign-group
Request methodsPOST, PUT
Request Content-Typeapplication/json, application/x-www-form-urlencoded
Response Content-Typeapplication/json
Auth requiredyes

Version-specific information

This endpoint is available from version 1.0.

Permissions and authentication

This endpoint requires admin authentication with WRITE access to the chain.

HTTP parameters

ParameterDescription
chain_id(integer, mandatory) The ID of the chain
id(integer, conditional) The ID of the campaign group to update. Required for updates, omit for creation
name(string, conditional, max=255) The name of the campaign group. Required for creation
active_date_from(datetime, optional) The start date for the campaign group in YYYY-MM-DD HH:MM:SS format
active_date_until(datetime, optional) The end date for the campaign group in YYYY-MM-DD HH:MM:SS format

Headers

The following headers can/must be passed to the API call:

ParameterDescription
N/AN/A

Sample request

Creating a new campaign group

curl -X POST https://{API hostname}/internal/alter-campaign-group \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 123,
"name": "Summer Campaign Group",
"active_date_from": "2025-06-01 00:00:00",
"active_date_until": "2025-08-31 23:59:59"
}'

Updating an existing campaign group

curl -X PUT https://{API hostname}/internal/alter-campaign-group \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"chain_id": 123,
"id": 456,
"name": "Updated Summer Campaign Group",
"active_date_from": "2025-06-15 00:00:00",
"active_date_until": "2025-09-15 23:59:59"
}'

Sample response

{
"result": "ok",
"data": {
"id": 456,
"chain_id": 123,
"name": "Summer Campaign Group",
"active_date_from": "2025-06-01 00:00:00",
"active_date_until": "2025-08-31 23:59:59",
"created_at": "2025-08-12 14:30:00",
"updated_at": "2025-08-12 14:30:00"
}
}

Possible error responses

Error codeError nameHTTP statusDescription
6no_valid_session401The user needs to be logged in and a valid session key needs to be sent
68permission_denied_or_non_existent403This user has insufficient permissions for this object or the object does not exist
217chain_id_not_found400No record has been found for that chain_id
417string_parameter_too_long400One of the parameters passed is too long
419parameter_invalid400One of the parameters is invalid and should be in a different format
441parameter_missing400A parameter is missing
462parameter_mismatch400Parameters supplied do not match