Update Campaign


                https://api.ocamba.com/v1/hood/campaigns/{id}
            

Updates the specific Campaign by setting the values of the parameters passed. Any parameters not provided will be left unchanged


Name
Description
idstringrequired
Unique resource identifier.


Example: 12345

Name
Description
adexobject

Name
Description
adex_messages[ template-adex-message ]
Array of adex message objects.
Adex Message
Name
Description
account_idarray
Array of account ids created on Ocamba platform.


Example: 123456,654321

campaign_idarray
Array of campaign ids created on Ocamba platform.


Example: 1367890,1098763

default_campaign_idinteger
Campaign id created on Ocamba platform.


Example: 1036975

group_idarray
Array of group ids created on Ocamba platform.


Example: 113,22,374

number_of_messagesinteger
Minimal value is 1, maximal value is 10.


Example: 4

Default: 1

repeat_on_clickinteger
Repeats action on click


Example: 1

Possible values: 0 | 1

zone_idinteger
Push zone id created on Ocamba platform.


Example: 1000321

integration_idstring
Adex channel does not have integrations, automatiacally set to 0.

template_ids[ string ]
Array of valid adex template ids.

emailobject

Name
Description
email_messages[ template-email-message ]
Array of email message objects.
Email message
Name
Description
contentstring
The email content. string[1 .. 65535] characters.


Example: 60% Off One Item Just Added to the Sale! Click here!

preheaderstring
The preheader is the text to the right of the subject line that gives a brief preview of the email. string[1 .. 100] characters.


Example: 60% Off One Item Just Added to the Sale!

subjectstring
The subject of the email. string[1 .. 78] characters.


Example: My first email with Ocamba.

integration_idstring
Valid email integration id.


Example: 1524

template_ids[ string ]
Array of valid email template ids.

end_timedateTime
Schedule a campaign end time. Timezone: GMT.


Example: 2024-10-27 22:32:00

labels[ string ]
Array of labels names.


Example: cars,marketing

max_runsnumber (integer)
The maximum number of times a Campaign can be run.


Example: 10

metadataobject

Name
Description
keystring
Key for the metadata. Maximum 40 characters.


Example: key

valuestring
Value for the metadata. Maximum 500 characters.


Example: value

namestring
Name of the campaign, max 100 characters.


Example: My first campaign

pushobject

Name
Description
adex_messages[ template-push-message ]
Array of push message objects.
Push Message
Name
Description
An array of action objects.
Push Message Action
Name
Description
iconstring
Visual attribute presented to the user. Must be a valid url.


Example: https://www.iconexample.com

titleobject
The main textual aspect as pairs of keys and values, where key represents language and value title in that language.


Example: { "en": "en_title" "de": "de_title" }

urlstring
The landing url of the action.


Example: https://www.urlexample.com

badgestring
Monochromatic mini-icon which portrays to user source where he subscribed in the first place.


Example: https://www.badgeexample.com

bodyobject

Name
Description
keystring
Language code supported by Ocamba platform (ISO 639-2, 2 letter language codes).


Example: en

valuestring
Maximum 120 characters.


Example: Hello world

iconstring
Secondary visual attribute presented to the user. Must be a valid url.


Example: https://www.iconexample.com

imageobject

Name
Description
keystring
Language code supported by Ocamba platform (ISO 639-2, 2 letter language codes).


Example: en

valuestring
Maximum 1000 characters.


Example: https://www.exampleimage.com/

landing_urlstring
The url of the site the user is redirected to when clicking on the notification.


Example: https://www.landingurl.com/

renotifystring
Replacing old notification with the new one using the silent method. Applicable only with tag option.


Example: 0

Possible values: 0 | 1

require_interactionstring
Demand action execution from the user. Applicable only for desktop users. Acts like a boolean.


Example: 1

Possible values: 0 | 1

silentstring
Serving notification without sound and vibration. Applicable only to mobile devices.


Example: 0

Possible values: 0 | 1

tagstring
This option enables the removal of notifications with the same tag which were delivered earlier.


Example: tag

titleobject

Name
Description
keystring
Language code supported by Ocamba platform (ISO 639-2, 2 letter language codes).


Example: en

valuestring
Maximum 70 characters.


Example: Title example

vibrationstring
Two vibration pulses with customizable length and pause between them, described in milliseconds (200,100,200 formats), will start when a notification is displayed. Applicable only for Android users.


Example: 100,100,200

integration_idstring
Push channel does not have integrations, automatiacally set to 0.

template_ids[ string ]
Array of valid push template ids.

repeat_with_cron[ campaign-cron ]
Defines the campaign's schedule through an array of objects.
RepeatWithCron
Name
Description
cronstring
A cron expression automatically generated based on the provided minute, hour, day of the month, month, and day of the week values.


Example: 0 1,3 * 2 *

days_of_montharray
An array of unique values specifying the day(s) of the month the Campaign should run. Valid values range from 1 to 31.


Example: 5

days_of_weekarray
An array of unique values specifying the day(s) of the week the Campaign should run. 0 represents Sunday and 6 represents Saturday.


Example: 0,4

hoursarray
An array of unique values specifying the hour(s) of the day the Campaign should run. Valid values range from 0 to 23.


Example: 10

minutesarray
An array of unique values specifying the minute(s) of the hour the Campaign should run. Valid values range from 0 to 59.


Example: 5

monthsarray
An array of unique values specifying the month(s) the Campaign should run. Valid values range from 1 to 12.


Example: 12

repeat_with_ticker[ campaign-ticker ]
Defines the campaign's schedule through an array of objects.
Time interval
Name
Description
days_of_weekarray
Specifies the days of the week when the campaign will run, using an array of values where each number represents a day (e.g., 0 for Sunday, 6 for Saturday). For example, 2,5 would represent Tuesday and Friday.


Example: 2,5

hournumber (integer)
Specifies the time interval in hours at which the campaign will execute.


Example: 2

start_fromdateTime
The starting date and time from which the time interval will begin.


Example: 2024-10-02 15:00

repeat_with_timearray (date-time)
Specifies the exact dates and times when the Campaign is scheduled to run.


Example: 2024-10-12 07:27:12,2024-10-12 07:27:12

scorenumber (integer)
Campaign performance score.


Example: 20

send_if_user_time_passedboolean
Send notification to users even if user time zone already passed.


Example: true

Possible values: true | false

send_in_user_time_zoneboolean
Send notification to users based on their own local time zones.


Example: true

Possible values: true | false

smsobject

Name
Description
integration_idstring
Valid sms integration id.


Example: 1511

sms_messages[ template-sms-message ]
Array of sms message objects.
Sms Message
Name
Description
contentobject

Name
Description
keystring
Language code supported by Ocamba platform (ISO 639-2, 2 letter language codes).


Example: en

valuestring
Maximum 160 characters.


Example: Content example

shorten_links[ shorten-link ]
Array of shorten link objects, maximum length is limited by content length. If a placeholder in content has less than 23 characters it will count as 23 characters.

template_ids[ string ]
Array of valid sms template ids.

start_timedateTime
Schedule a campaign start time. Timezone: GMT.


Example: 2024-10-05 22:32:00

statusstring
The status of the Campaign.


Example: active

Possible values: active | draft | inactive | paused | suspended

Targeting object.
Campaign targeting
Name
Description
application_groupsobject

Name
Description
items[ string ]
Array of hood application group ids created by the Ocamba platform.

opstring



Example: neq

Possible values: eq | neq

applicationsobject

Name
Description
items[ string ]
List of application ids with unique items and minimum length of 1. Every item should be valid full qualified domain name and can contain star (*).

opstring



Example: eq

Possible values: eq | neq

browsersobject

Name
Description
items[ string ]
Array of browser ids supported by Ocamba, max 100 items.

opstring



Example: eq

Possible values: eq | neq

containersobject

Name
Description
items[ string ]
Array of hood containers ids created on Ocamba platform, max 100 items.

opstring



Example: eq

Possible values: eq | neq

countriesobject

Name
Description
items[ string ]
Array of country codes supported by Ocamba (ISO 3166-1, 2 letter country codes), max 270 items.

opstring



Example: eq

Possible values: eq | neq

engagement_scoreobject

Name
Description
fromnumber (integer)
Describes the lower threshold for engagement score when targeting users. Minimum value is 0, maximum is 100.


Example: 11

tonumber (integer)
Describes the upper threshold for engagement score when targeting users. Minimum value is 1, maximum is 100.


Example: 73

groupsobject

Name
Description
items[ string ]
Array of hood group ids created on Ocamba platform, max 100 items.

opstring



Example: eq

Possible values: eq | neq

languagesobject

Name
Description
items[ string ]
Array of language codes supported by Ocamba (ISO 639-2, 2 letter language codes), max 50 items.

opstring



Example: eq

Possible values: eq | neq

osobject

Name
Description
items[ string ]
Array of os ids supported by Ocamba, max 50 items.

opstring



Example: eq

Possible values: eq | neq

partnersobject

Name
Description
items[ string ]
List of partner ids with unique items and minimum length of 1.

opstring



Example: eq

Possible values: eq | neq

regionsobject

Name
Description
items[ string ]
Region ids.

opstring



Example: eq

Possible values: eq | neq

remote_usersobject

Name
Description
items[ string ]
Array of remote user ids maximum length of 100, tracked by Ocamba platform, max 100 items.

opstring



Example: eq

Possible values: eq | neq

subscribed_ageobject

Name
Description
fromnumber (integer)
Number in range 0-3500


Example: 10

tonumber (integer)
Number in range 1-3500. Must be greater than 'from' field.


Example: 100

user_dataobject

Name
Description
keystring
Key can be any string which represents user specific data, max 100 characters. Key will be sanitized by removing leading and trailing whitespace, replacing all consecutive non-leading and non-trailing whitespaces with a single underscore, converting all character to lowercase and using only first 100 characters if there are over 100 characters.

valueobject

Name
Description
items[ string ]
Array of values, maximum 10 items.

opstring



Example: eq

Possible values: eq | neq

usersobject

Name
Description
items[ string ]
Array of user ids tracked by Ocamba platform, max 100 items.

opstring



Example: eq

Possible values: eq | neq

telegramobject

Name
Description
integration_idstring
Valid telegram integration id.


Example: 1531

telegram_messages[ template-telegram-message ]
Array of telegram message objects.
Telegram Message
Name
Description
contentstring
Content of the telegram message.


Example: Hello from Ocamba!

template_ids[ string ]
Array of valid telegram template ids.

webhooks[ campaign-webhooks ]
Defines an array of webhook objects, with a maximum of 3 entries.
Webhooks
Name
Description
namestring
A user-provided name for the webhook, which must be unique within the array.


Example: webhook example

204 - No Content
Arrow

note
1 Updatable fields are name, description, status, labels, metadata, start_time, end_time, repeat_with_cron, repeat_with_ticker, repeat_with_time, send_in_user_time_zone, send_if_user_time_passed, quiet_hours, max_runs, webhooks, push, adex, email, sms, targeting, deal_id, score.
tip
1 If you don't know the campaign id, list the campaigns to find it.

200 Arrow
{
  "name": "My first campaign",
  "labels": [
    "cars"
  ],
  "metadata": {
      "key": "key",
      "value": "value"
  },
  "financial_performance": {
      "items": [
          {
              "event_name": "Cost",
              "event": "cost",
              "event_date": "2024-10-01",
              "cost": "500",
              "revenue": "500"
          }
      ],
      "profit": "300"
  },
  "start_time": "2025-10-05 22:32:00",
  "end_time": "2025-10-27 22:32:00",
  "repeat_with_cron": [
      {
          "minutes": "5",
          "hours": "10",
          "days_of_month": "5",
          "months": "12",
          "days_of_week": "0,4"
      }
  ],
  "repeat_with_ticker": [
      {
          "hour": 2,
          "days_of_week": "2,5",
          "start_from": "2024-10-02 15:00"
      }
  ],
  "repeat_with_time": "2024-10-12 07:27:12,2024-10-12 07:27:12",
  "status": "active",
  "send_in_user_time_zone": true,
  "send_if_user_time_passed": true,
  "quiet_time": {
      "from": 2,
      "to": 12
  },
  "max_runs": 10,
  "webhooks": [
      {
          "name": "webhook example"
      }
  ],
  "targeting": {
      "countries": {
          "items": [
              "US"
          ],
          "op": "eq"
      }
  },
  "deal_id": "1011251",
  "score": 20,
  "archived": 0
}