> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/flow/receive-a-single-campaign.md).

# Receive a single campaign

One campaign with its full message structure — the same item graph as the automated flow detail. The id of an automated flow returns 404 — use `/automated-flows/{id}` instead.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"Flow","description":"Flows"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"CampaignDetail":{"type":["object"],"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["campaigns"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/CampaignAttributes"},{"type":"object","required":["entryFlowItemId","items"],"properties":{"entryFlowItemId":{"type":"string","description":"ID of the first item in the flow"},"items":{"type":"array","description":"Every item of the flow, linked by resolved ids","items":{"$ref":"#/components/schemas/FlowItem"}}}}]}}},"CampaignAttributes":{"type":"object","required":["id","name","status","campaignType"],"properties":{"id":{"type":"string","description":"ID of the campaign"},"name":{"type":"string","description":"Name of the campaign"},"status":{"type":"string","description":"The dashboard's send status of the campaign","enum":["draft","scheduled","processing","sending","sent","failed","cancelled","evaluating","noWinner"]},"campaignType":{"type":"string","description":"Whether the campaign sends one message or runs an adaptive test across variants","enum":["standard","adaptive"]},"scheduledFor":{"type":"string","format":"date-time","nullable":true,"description":"When the campaign is scheduled to send; null when not scheduled"},"scheduleType":{"type":"string","description":"Whether scheduledFor is interpreted in the site's timezone or in each subscriber's own timezone","enum":["siteTimezone","subscriberTimezone"]},"sentAt":{"type":"string","format":"date-time","description":"When the campaign was actually sent"},"deliveredSubscriberCount":{"type":"integer","description":"Number of subscribers the campaign was delivered to"},"includeSegments":{"type":"array","description":"Segments the campaign audience includes","items":{"$ref":"#/components/schemas/Segment"}},"excludeSegments":{"type":"array","description":"Segments the campaign audience excludes","items":{"$ref":"#/components/schemas/Segment"}},"isQuietHoursEnabled":{"type":"boolean","description":"Whether messages from this campaign are held during the subscriber's quiet hours"},"adaptiveTest":{"description":"Adaptive test state (campaignType=adaptive only)","$ref":"#/components/schemas/CampaignAdaptiveTest"},"discountUsage":{"type":"array","description":"Discounts the campaign's messages reference. referenceCount is the\nnumber of places in the campaign that reference the discount —\nconfiguration, not code consumption.\n","items":{"type":"object","required":["id","referenceCount"],"properties":{"id":{"type":"string"},"referenceCount":{"type":"integer"}}}},"discountCodePoolUsage":{"type":"array","description":"Discount code pools the campaign's messages reference. referenceCount\nis the number of places in the campaign that reference the pool —\nconfiguration, not code consumption.\n","items":{"type":"object","required":["id","referenceCount"],"properties":{"id":{"type":"string"},"referenceCount":{"type":"integer"}}}},"failedReason":{"type":"string","description":"Why the campaign send failed (status=failed only)"},"failedAt":{"type":"string","format":"date-time","description":"When the campaign send failed (status=failed only)"},"cancelledAt":{"type":"string","format":"date-time","description":"When the campaign was cancelled (status=cancelled only)"},"createdAt":{"type":"string","format":"date-time","description":"When the campaign was created"},"updatedAt":{"type":"string","format":"date-time","description":"When the campaign was last updated"}}},"Segment":{"type":"object","description":"A segment of the campaign audience. name is the segment's current\nname, or an empty string when it could not be resolved (for\nexample a deleted segment).\n","required":["id","name"],"properties":{"id":{"type":"string","description":"ID of the segment"},"name":{"type":"string","description":"Current name of the segment, empty when unresolved"}}},"CampaignAdaptiveTest":{"type":"object","description":"Adaptive test state of a campaign","properties":{"adaptiveTestStatus":{"type":"string","description":"running while the test variants are being evaluated;\ncomplete_with_winner when a variant won and was rolled out;\ncomplete_no_winner when no variant stood out; complete_control_kept\nwhen the control message beat every variant and was kept.\n","enum":["running","complete_with_winner","complete_no_winner","complete_control_kept"]},"adaptiveTestResult":{"type":"object","description":"Outcome of the test, present once evaluated","properties":{"winnerFlowItemId":{"type":"string","description":"ID of the winning variant's flow item"},"wasTiebroken":{"type":"boolean"},"completedAt":{"type":"string","format":"date-time"}}},"testVariantsDispatchedAt":{"type":"string","format":"date-time","description":"When the test variants were sent to the sample audience"}}},"FlowItem":{"type":"object","description":"One item of the flow's item graph. The resource `type` is always\n`flow-item`; the shape is picked by `attributes.type`.\nItems link to each other by resolved ids — `nextItemId` (or a\nbranch's `nextItemId`) — rather than nesting; null means end of\nbranch. An internal item type this API doesn't model is returned\nwith `attributes.type` \"unsupported\" and only its id.\n","required":["type","attributes"],"properties":{"type":{"type":"string","enum":["flow-item"]},"attributes":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","description":"Kind of item","enum":["sms","delay","conditional-split","random-split","adaptive-test","user-input","unsupported"]},"id":{"type":"string","description":"ID of the item"},"name":{"type":"string","description":"Item's display name (sms only)"},"messages":{"type":"array","description":"Messages to send (sms only)","items":{"$ref":"#/components/schemas/FlowMessage"}},"discountCodes":{"type":"array","description":"Static discount codes attached to the message (sms only)","items":{"type":"string"}},"discounts":{"type":"array","description":"Discounts attached to the message (sms only)","items":{"type":"object"}},"discountCodePoolId":{"type":"string","description":"ID of the discount code pool the message draws a unique code from (sms only)"},"uniqueDiscountIssuanceType":{"type":"string","description":"How a unique discount code is issued to the subscriber (sms only)"},"replyKeywordSettings":{"type":"object","description":"Keyword auto-reply configuration for this message (sms only)"},"delayType":{"type":"string","description":"Kind of delay (delay only)","enum":["delay","delay-until","delay-scheduled"]},"durationInSeconds":{"type":"integer","description":"Length of the delay, in seconds (delay only)"},"branches":{"type":"array","description":"Outgoing branches (conditional-split, random-split)","items":{"$ref":"#/components/schemas/FlowItemBranch"}},"defaultNextItemId":{"type":"string","nullable":true,"description":"ID of the next item when no branch matches (conditional-split only)"},"isSticky":{"type":"boolean","description":"Whether a returning subscriber is kept on the same arm (random-split only)"},"adaptiveTest":{"type":"object","description":"Adaptive test configuration (adaptive-test only)","properties":{"variants":{"type":"array","description":"Variant flow items under test","items":{"type":"object","properties":{"flowItemId":{"type":"string","description":"ID of the variant's flow item"}}}},"evaluation":{"type":"object","description":"Evaluation configuration used to pick a winner"},"audienceSplitPercentage":{"type":"number","description":"Share of the audience sampled before picking a winner"}}},"fieldName":{"type":"string","description":"Name of the captured field. LEGACY: user-input items are\nno longer creatable; existing flows may still contain\none.\n"},"validationRule":{"type":"string","description":"Validation applied to the subscriber's reply. LEGACY:\nuser-input items are no longer creatable; existing flows\nmay still contain one.\n"},"skippedNextItemId":{"type":"string","nullable":true,"description":"ID of the next item when the subscriber doesn't respond.\nLEGACY: user-input items are no longer creatable;\nexisting flows may still contain one.\n"},"nextItemId":{"type":"string","nullable":true,"description":"ID of the next item; null means end of branch (sms, delay, user-input)"}}}}},"FlowMessage":{"type":"object","description":"One SMS/MMS message of an sms flow item","properties":{"text":{"type":"string","description":"Message body"},"imageUrl":{"type":"string","nullable":true,"description":"MMS image attached to the message"}}},"FlowItemBranch":{"type":"object","description":"One outgoing branch of a split item. conditional-split branches\nuse conditions or expression with nextItemId; random-split\nbranches use percentage with nextItemId.\n","properties":{"conditions":{"type":"array","items":{"type":"object"},"description":"v1 conditional split conditions"},"expression":{"type":"object","description":"v2 conditional split expression: `and[].or[]` of conditions,\neach with a `slug`, `type`, `operator` and, depending on the\nslug, a `value`, a `dateFilter` (time window the condition\napplies to) and `filters` (occurrence or count). A condition\nnarrows its match with either one `subcondition` or, for\n`visited-page`, a `subconditions` list whose rows all apply to\nthe same page view; each row has `slug`, `category`, `operator`\nand a `value`, absent when the operator is `exist`. Conditions\nand subcondition rows whose value is a list of IDs carry\n`values` instead of `value`: one `{ id, name }` entry per ID,\nwhere `name` is the current name of the referenced segment,\nflow, opt-in tool, product, variant or Klaviyo list, or an\nempty string when it could not be resolved. This applies to\n`member-of-a-segment` (segment ids, on the condition), and on\nthe subcondition row for the flow subcondition (flow IDs),\n`subscription-source`/`optin-tool-id` (opt-in tool ids),\n`product`/`product-id` and `product-variant` (Shopify ids),\n`klaviyo-segment-or-list` (Klaviyo ids).\n"},"percentage":{"type":"number","description":"Share of traffic sent down this arm (random split)"},"nextItemId":{"type":"string","nullable":true,"description":"ID of the next item on this branch; null means end of branch (dead arm)"}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/campaign-flows/{id}":{"get":{"summary":"Receive a single campaign","tags":["Flow"],"operationId":"getCampaign","description":"One campaign with its full message structure — the same item\ngraph as the automated flow detail. The id of an automated flow\nreturns 404 — use `/automated-flows/{id}` instead.\n","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the campaign","schema":{"type":"string"}}],"responses":{"200":{"description":"Ok","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CampaignDetail"}}}}}},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.recart.com/developers/public-api/flow/receive-a-single-campaign.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
