---
title: "Set the campaigns a brief is linked to"
method: PUT
path: "/briefs/{id}/campaigns"
tags: ["Briefs"]
---

# Set the campaigns a brief is linked to

`PUT /briefs/{id}/campaigns`

## Request

- Base URL: `https://viral.app/api/v1`
- URL: `https://viral.app/api/v1/briefs/{id}/campaigns`
- Auth: API key in header `x-api-key`

Reconciles the brief's non-ended campaign links to the given set: removed links are deleted, added links steal any existing brief on the target campaign (a campaign holds one brief). With notify=true, creators on newly linked campaigns are notified. PUT /briefs/{id}/audience sets campaigns, creators and everyone in one call.

## Path parameters

- `id` string, required: Campaign brief ID with orgbrief_ prefix

## Request body

- object: Reconciles the brief's non-ended campaign links to the given set. Removed links are deleted, added links steal any existing brief on the target campaign; links to ended campaigns are untouched.
  - `campaignIds` string[], required
  - `notify` boolean, required

## Response `200`

OK

- object
  - `campaigns` object[], required
    - `id` string, required: Campaign ID with orgcamp_ prefix
    - `name` string, required
    - `status` 'upcoming' | 'active' | 'closing' | 'ended', required: Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.
    - `activeCreatorCount` integer, required

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `404`: 404
- `408`: 408
- `409`: 409
- `429`: 429
- `500`: 500

---

[API](https://skmtc.dev/viral/apis/viral-app-api.md) · [All operations](https://skmtc.dev/viral/apis/viral-app-api/llms.txt) · [OpenAPI document](https://skmtc.dev/viral/apis/viral-app-api/revisions/31e97fa79ef1?raw)
