Update delivery pause

Update delivery pause

PATCH https://api.ocamba.com/v1/hood/settings/delivery-pause
Merges the workspace delivery pause and returns the stored pause. Omitted switches stay unchanged. false turns a switch off.

Note

This call requires the settings.delivery-pause permission. A denied call returns 403 and does not write the pause.

The body is the pause document itself, not a settings object. PATCH /settings rejects a delivery_pause field. Send all, campaigns, transactional, or automation. A missing switch stays as it is. JSON null is rejected. An unknown key returns 400 and sets details.rule to delivery_pause_scope.

campaigns pauses campaigns and push tasks together. campaigns.all and campaigns.labels are independent. A label set to true is paused. A label set to false is removed from the pause. Labels omitted from the patch stay paused. A paused label that is not in the campaign label catalog yet is added there. Removing a pause does not delete the catalog label. Each name is trimmed, must be 2 to 100 characters, and at most 100 labels can stay paused.

all: true and transactional.all: true refuse POST /messages/send. automation.all is stored for the workspace and does not refuse that call. Turning all off leaves campaigns, transactional, and automation unchanged.

Tip
The response is the stored pause. all is always present. A scope that is not paused is omitted, and label values in the response are true. Repeating the same patch leaves the stored pause unchanged.

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Request schema

body

Response schemas

curl -X PATCH \
 "https://api.ocamba.com/v1/hood/settings/delivery-pause" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "all": true,
  "campaigns": {
    "all": true,
    "labels": {
      "promo": true
    }
  },
  "transactional": {
    "all": true
  },
  "automation": {
    "all": true
  }
}'
const url = 'https://api.ocamba.com/v1/hood/settings/delivery-pause';
const options = {
  method: 'PATCH',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "all": true,
      "campaigns": {
        "all": true,
        "labels": {
          "promo": true
        }
      },
      "transactional": {
        "all": true
      },
      "automation": {
        "all": true
      }
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v1/hood/settings/delivery-pause");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "all" => true,
    "campaigns" => [
      "all" => true,
      "labels" => [
        "promo" => true
      ]
    ],
    "transactional" => [
      "all" => true
    ],
    "automation" => [
      "all" => true
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl -X PATCH \
 "https://api.ocamba.com/v1/hood/settings/delivery-pause" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "campaigns": {
    "labels": {
      "black-friday": true
    }
  }
}'
const url = 'https://api.ocamba.com/v1/hood/settings/delivery-pause';
const options = {
  method: 'PATCH',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "campaigns": {
        "labels": {
          "black-friday": true
        }
      }
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v1/hood/settings/delivery-pause");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "campaigns" => [
      "labels" => [
        "black-friday" => true
      ]
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl -X PATCH \
 "https://api.ocamba.com/v1/hood/settings/delivery-pause" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "campaigns": {
    "labels": {
      "promo": false
    }
  }
}'
const url = 'https://api.ocamba.com/v1/hood/settings/delivery-pause';
const options = {
  method: 'PATCH',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "campaigns": {
        "labels": {
          "promo": false
        }
      }
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v1/hood/settings/delivery-pause");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "campaigns" => [
      "labels" => [
        "promo" => false
      ]
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl -X PATCH \
 "https://api.ocamba.com/v1/hood/settings/delivery-pause" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "all": false
}'
const url = 'https://api.ocamba.com/v1/hood/settings/delivery-pause';
const options = {
  method: 'PATCH',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "all": false
    }
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v1/hood/settings/delivery-pause");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "all" => false
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

200 OK

{
  "all": false,
  "campaigns": {
    "labels": {
      "black-friday": true,
      "promo": true
    }
  }
}

400 Bad Request

{
  "code": 400,
  "title": "Bad Request",
  "message": "unknown delivery_pause scope \"workflow\"",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62",
  "details": {
    "rule": "delivery_pause_scope"
  }
}

403 Forbidden

{
  "code": 403,
  "title": "Forbidden",
  "message": "Permission denied",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses