---
title: "Creates a program campaign from the given stream program."
method: POST
path: "/campaign/program"
tags: ["Campaign"]
---

# Creates a program campaign from the given stream program.

`POST /campaign/program`

The program is validated before the campaign is persisted; a malformed graph
 (missing root, dangling references, cycles, unreachable nodes) is rejected. The
 campaign starts in the Created status; move it to Active to start serving sessions.

## Request body

- CreateProgramCampaignEndpointInput
  - `name` string, required — The name of the campaign.
  - `priority` integer, required — The priority weight the campaign competes with for sessions.
  - `rootNodeId` string, required — The node the program's evaluation enters at.
  - `nodes` object, required — The program's decision graph, keyed by node id.
  - `maxRapids` integer, required — The session ends after this many counted responses.
  - `maxDurationSeconds` integer, required — The session ends after this many seconds.

## Response `200`

OK

- CreateProgramCampaignEndpointOutput
  - `campaignId` string, required — The id of the created campaign.

## Other responses

- `400` — Bad Request
- `401` — Unauthenticated
- `403` — Forbidden

---

[API](https://skmtc.net/rapidata/apis/rapidata-api.md) · [All operations](https://skmtc.net/rapidata/apis/rapidata-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rapidata/rapidata-api/revisions/e42ec51c7b88/schema)
