---
title: "Assign a source to a campaign"
method: POST
path: "/v2/sources/{id}/assignments"
tags: ["Sources"]
---

# Assign a source to a campaign

`POST /v2/sources/{id}/assignments`

## Request

- Base URL: `https://api.carecycle.ai`
- URL: `https://api.carecycle.ai/v2/sources/{id}/assignments`
- Auth: API key in header `x-api-key`

Connect a lead source to a campaign. Choose how leads arrive (the acquisition type) and, if you want, an existing tracking number. Connecting the same source again keeps its current setup and number. The campaign still decides how calls are handled.

## Path parameters

- `id` string, uuid, required

## Request body

- PostV2SourcesIdAssignmentsRequestBody
  - `campaignId` string, uuid, required
  - `sourceType` 'outbound' | 'inbound': Acquisition type: outbound for lead records, inbound for live calls. Independent of campaign direction.
  - `phoneNumberId` integer, nullable
  - `enabled` boolean
  - `metadata` object, nullable

## Response `200`

POST /v2/sources/:id/assignments Positive response

- PostV2SourcesIdAssignmentsPositiveResponse
  - `id` string, uuid, required
  - `sourceId` string, uuid, required
  - `campaignId` string, uuid, required
  - `campaignName` string, nullable
  - `direction` 'outbound' | 'inbound', required
  - `enabled` boolean, required
  - `phoneNumberId` integer, nullable, required
  - `phoneNumber` string, nullable
  - `service` 'mobius' | 'softphone' | 'null', nullable
  - `assignedAt` string, date-time, nullable, required: Source assignment time. ISO 8601 timestamp
  - `unassignedAt` string, date-time, nullable, required: Source unassignment time. ISO 8601 timestamp
  - `metadata` object, nullable

## Other responses

- `400`: POST /v2/sources/:id/assignments Negative response 400
- `401`: POST /v2/sources/:id/assignments Negative response 401
- `403`: POST /v2/sources/:id/assignments Negative response 403
- `404`: POST /v2/sources/:id/assignments Negative response 404
- `409`: POST /v2/sources/:id/assignments Negative response 409
- `422`: POST /v2/sources/:id/assignments Negative response 422
- `429`: POST /v2/sources/:id/assignments Negative response 429
- `500`: POST /v2/sources/:id/assignments Negative response 500
- `502`: POST /v2/sources/:id/assignments Negative response 502
- `503`: POST /v2/sources/:id/assignments 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/9534fc3b0a65?raw)
