---
title: "Attach the user's published posts to a campaign (a post counts toward one campaign at a time)"
method: POST
path: "/api/v1/campaigns/{id}/attach"
---

# Attach the user's published posts to a campaign (a post counts toward one campaign at a time)

`POST /api/v1/campaigns/{id}/attach`

## Request

- Base URL: `https://everpop.app`
- URL: `https://everpop.app/api/v1/campaigns/{id}/attach`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- object
  - `postIds` string[], required: postId values from GET /api/v1/receipts or the campaign proof.

## Response `200`

How many posts were attached.

- AttachEnvelope
  - `ok` unknown, required
  - `data` object, required
    - `attached` integer, required: Distinct posts attached (repeated ids count once).

## Other responses

- `401`: The API key did not authenticate. code=key_missing: no Authorization: Bearer epk_... header. code=key_invalid: the key is unknown or revoked. code=key_expired: the key passed its expiry; the user creates a new one in Dashboard → API.
- `402`: REST and MCP need the Pro or Scale plan. reason=subscription: the account has no active subscription (subscribe, or redeem an invite code). reason=plan: the account's plan doesn't include this (API and agent access need Pro or Scale).
- `403`: A post id is not one of the user's published posts (named in the message).
- `404`: Campaign not found for this account.
- `422`: A post is not published yet, a post breaks the campaign's brief rules or the brief cannot be read, or the body did not validate.
- `429`: Too many requests. code=rate_limited: the per-minute limit; wait Retry-After (60) seconds. code=quota_exhausted (with used, limit, resetsAt, retryable: false): the monthly allowance is used up; Retry-After is the seconds until resetsAt — tell the user rather than wait. code=queue_capacity (retryable: true): the render queue is full; retry after Retry-After (180).

---

[API](https://skmtc.dev/everpop/apis/everpop-api.md) · [All operations](https://skmtc.dev/everpop/apis/everpop-api/llms.txt) · [OpenAPI document](https://skmtc.dev/everpop/apis/everpop-api/revisions/1a9fb20867f5?raw)
