> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/server-side/decision-api/run-on-premise/reference/campaigns.md).

# Campaigns

## Get all campaigns for the visitor

> Get all campaigns value and metadata for a visitor ID and context

```json
{"openapi":"3.1.1","info":{"title":"Flagship Decision API","version":"2.0"},"servers":[{"url":"/v2"}],"paths":{"/campaigns":{"post":{"description":"Get all campaigns value and metadata for a visitor ID and context","operationId":"get-campaigns","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.campaignsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.errorMessage"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.errorMessage"}}}}},"summary":"Get all campaigns for the visitor","tags":["Campaigns"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.campaignsBodySwagger"}}},"description":"Campaigns request body","required":true}}}},"components":{"schemas":{"handlers.campaignsResponse":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/handlers.campaignResponse"},"type":"array"},"panic":{"type":"boolean"},"visitor_id":{"type":"string"}},"type":"object"},"handlers.campaignResponse":{"properties":{"id":{"type":"string"},"variation":{"$ref":"#/components/schemas/handlers.variationResponse"},"variationGroupId":{"type":"string"}},"type":"object"},"handlers.variationResponse":{"properties":{"id":{"type":"string"},"modifications":{"$ref":"#/components/schemas/handlers.modificationResponse"},"reference":{"type":"boolean"}},"type":"object"},"handlers.modificationResponse":{"properties":{"type":{"type":"string"},"value":{"additionalProperties":true,"type":"object"}},"type":"object"},"handlers.errorMessage":{"properties":{"message":{"type":"string"}},"type":"object"},"handlers.campaignsBodySwagger":{"properties":{"anonymous_id":{"type":"string"},"context":{"$ref":"#/components/schemas/handlers.campaignsBodyContextSwagger"},"trigger_hit":{"type":"boolean"},"visitor_consent":{"type":"boolean"},"visitor_id":{"type":"string"}},"required":["visitor_id"],"type":"object"},"handlers.campaignsBodyContextSwagger":{"properties":{"key_bool":{"type":"boolean"},"key_number":{"type":"number"},"key_string":{"type":"string"}},"type":"object"}}}}
```

## Get a single campaigns for the visitor

> Get a single campaign value and metadata for a visitor ID and context

```json
{"openapi":"3.1.1","info":{"title":"Flagship Decision API","version":"2.0"},"servers":[{"url":"/v2"}],"paths":{"/campaigns/{id}":{"post":{"description":"Get a single campaign value and metadata for a visitor ID and context","operationId":"get-campaign","parameters":[{"schema":{"type":"string"},"description":"Campaign ID","in":"path","name":"id","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.campaignResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.errorMessage"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.errorMessage"}}}}},"summary":"Get a single campaigns for the visitor","tags":["Campaigns"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.campaignsBodySwagger"}}},"description":"Campaign request body","required":true}}}},"components":{"schemas":{"handlers.campaignResponse":{"properties":{"id":{"type":"string"},"variation":{"$ref":"#/components/schemas/handlers.variationResponse"},"variationGroupId":{"type":"string"}},"type":"object"},"handlers.variationResponse":{"properties":{"id":{"type":"string"},"modifications":{"$ref":"#/components/schemas/handlers.modificationResponse"},"reference":{"type":"boolean"}},"type":"object"},"handlers.modificationResponse":{"properties":{"type":{"type":"string"},"value":{"additionalProperties":true,"type":"object"}},"type":"object"},"handlers.errorMessage":{"properties":{"message":{"type":"string"}},"type":"object"},"handlers.campaignsBodySwagger":{"properties":{"anonymous_id":{"type":"string"},"context":{"$ref":"#/components/schemas/handlers.campaignsBodyContextSwagger"},"trigger_hit":{"type":"boolean"},"visitor_consent":{"type":"boolean"},"visitor_id":{"type":"string"}},"required":["visitor_id"],"type":"object"},"handlers.campaignsBodyContextSwagger":{"properties":{"key_bool":{"type":"boolean"},"key_number":{"type":"number"},"key_string":{"type":"string"}},"type":"object"}}}}
```


---

# 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:

```
GET https://docs.abtasty.com/server-side/decision-api/run-on-premise/reference/campaigns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
