---
title: "Create agent source restriction"
method: POST
path: "/v2/campaigns/{campaignId}/agent-source-restrictions"
tags: ["Campaigns.Agent Source Restrictions"]
---

# Create agent source restriction

`POST /v2/campaigns/{campaignId}/agent-source-restrictions`

## Request

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

Block an agent from taking calls that come from a certain source in a campaign.

## Path parameters

- `campaignId` string, uuid, required: Campaign ID

## Request body

- PostV2CampaignsCampaignIdAgentSourceRestrictionsRequestBody
  - `memberId` string, uuid, required: Member/Agent ID
  - `sourceId` string, uuid, required: Source ID

## Response `200`

POST /v2/campaigns/:campaignId/agent-source-restrictions Positive response

- PostV2CampaignsCampaignIdAgentSourceRestrictionsPositiveResponse
  - `restriction` object, required: Created restriction record
    - `id` string, uuid, required
    - `createdAt` string, date-time, nullable, required: Restriction creation time. ISO 8601 timestamp
    - `updatedAt` string, date-time, nullable, required: Restriction last update time. ISO 8601 timestamp
    - `campaignId` string, uuid, required
    - `memberId` string, uuid, required
    - `campaignSourceId` string, uuid, required
    - `sourceId` string, uuid, required: Source ID
    - `campaignName` string
    - `memberName` string
    - `sourceName` string

## Other responses

- `400`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 400
- `401`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 401
- `403`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 403
- `404`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 404
- `409`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 409
- `422`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 422
- `429`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 429
- `500`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 500
- `502`: POST /v2/campaigns/:campaignId/agent-source-restrictions Negative response 502
- `503`: POST /v2/campaigns/:campaignId/agent-source-restrictions 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)
