---
title: "Save campaign behaviors atomically"
method: PUT
path: "/v2/campaigns/{campaignId}/behaviors"
tags: ["Campaigns"]
---

# Save campaign behaviors atomically

`PUT /v2/campaigns/{campaignId}/behaviors`

## Request

- Base URL: `https://api.carecycle.ai`
- URL: `https://api.carecycle.ai/v2/campaigns/{campaignId}/behaviors`
- Auth: API key in header `x-api-key`

Replace all of a campaign's behaviors in one step. Send the complete list. Either every change is saved, or none are.

## Path parameters

- `campaignId` string, uuid, required

## Request body

- PutV2CampaignsCampaignIdBehaviorsRequestBody
  - `expectedHash` string, required
  - `behaviors` object[], required
    - `id` string, uuid, required
    - `behaviorKey` string, uuid, required
    - `capabilityId` string, uuid, required
    - `snippetId` string, uuid, nullable, required
    - `scope` 'business_hours' | 'after_hours', required
    - `appliesTo` string[], nullable, required
    - `enabled` boolean, required
    - `priority` integer, required
    - `isDefault` boolean, required
    - `transferConfigId` string, uuid, nullable, required
    - `appointmentConfigId` string, uuid, nullable, required

## Response `200`

PUT /v2/campaigns/:campaignId/behaviors Positive response

- PutV2CampaignsCampaignIdBehaviorsPositiveResponse
  - `success` boolean, required

## Other responses

- `400`: PUT /v2/campaigns/:campaignId/behaviors Negative response 400
- `401`: PUT /v2/campaigns/:campaignId/behaviors Negative response 401
- `403`: PUT /v2/campaigns/:campaignId/behaviors Negative response 403
- `404`: PUT /v2/campaigns/:campaignId/behaviors Negative response 404
- `409`: PUT /v2/campaigns/:campaignId/behaviors Negative response 409
- `422`: PUT /v2/campaigns/:campaignId/behaviors Negative response 422
- `429`: PUT /v2/campaigns/:campaignId/behaviors Negative response 429
- `500`: PUT /v2/campaigns/:campaignId/behaviors Negative response 500
- `502`: PUT /v2/campaigns/:campaignId/behaviors Negative response 502
- `503`: PUT /v2/campaigns/:campaignId/behaviors Negative response 503

---

[API](https://skmtc.dev/carecycle/apis/carecycle-public-api.md) - [All operations](https://skmtc.dev/carecycle/apis/carecycle-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/carecycle/apis/carecycle-public-api/revisions/db390c743c36?raw)
