> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/api-reference/internal/enrolment-and-messaging/campaigns.md). Agents can also search and read this documentation through its [MCP server](https://docs.thewalletcrew.io/~gitbook/mcp).

# Campaigns

## List campaigns

> Returns every campaign, in creation order. Unpaged.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Campaigns"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.campaign:read"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CampaignDefinition":{"required":["identifierKeys","name","passType","tag"],"type":"object","properties":{"id":{"type":"string","description":"Server-set on creation, immutable: 8 letters and digits."},"name":{"maxLength":100,"minLength":0,"type":"string","description":"Label shown in the admin, up to 100 characters."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels to filter and group campaigns in the admin. At most 20 tags of 50 characters; trimmed, blanks\ndropped, case-insensitive duplicates kept once."},"passType":{"minLength":1,"type":"string","description":"The pass template whose identifiers the links carry. Fixed once created."},"layout":{"type":["null","string"],"description":"The download page (a layout of type `pass`) a link opens. `null` uses the pass template's own."},"identifierKeys":{"minItems":1,"type":"array","items":{"type":"string"},"description":"The pass identifiers each link carries, in the order of a link's values, e.g. `[\"ur.customerId\"]`. Each\none is read by a data provider of the pass template. Fixed once created."},"tag":{"maxLength":64,"minLength":0,"type":"string","description":"The source tag every pass added from these links is attributed to (`neo.src`), e.g. the campaign code of\nthe sending tool: 1 to 64 letters, digits, `_` and `-`, unique among the tenant's campaigns\nregardless of case. Fixed once created. Not Neo.Runtime.Campaign.CampaignDefinition.Tags, which only label the campaign in the admin."},"medium":{"maxLength":50,"minLength":0,"type":["null","string"],"description":"The source medium of every pass added from these links: how they are sent, e.g. `rcs`\n(`neo.src.medium`). Up to 50 characters, without\n`,` or `|`."},"status":{"description":"Whether the links work. A stopped campaign's links send the visitor to Neo.Runtime.Campaign.CampaignDefinition.StoppedUrl, or answer\n404 without one, until it is active again.","default":"active","$ref":"#/components/schemas/CampaignStatus"},"stoppedUrl":{"maxLength":2000,"minLength":0,"type":["null","string"],"description":"Where a link of a stopped campaign sends the visitor, e.g. the brand's site: an absolute `http` or\n`https` URL, up to 2,000 characters. `null` answers 404."},"linkCount":{"type":"integer","description":"Links generated so far, server-set.","format":"int64"},"creationDate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","format":"int64"}],"description":"Creation time in UTC, server-set. Accepts ISO 8601 date-time string or Unix epoch seconds in request inputs. Responses are serialized as ISO 8601 date-time strings."},"createdBy":{"type":["null","string"],"description":"Who created it, server-set."}},"additionalProperties":false,"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open."},"CampaignStatus":{"enum":["active","stopped"],"type":"string","description":"Whether the links of a campaign work."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/campaigns":{"get":{"tags":["Campaigns"],"summary":"List campaigns","description":"Returns every campaign, in creation order. Unpaged.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Campaigns returned.","content":{"text/plain":{"schema":{"type":"array","items":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}},"application/json":{"schema":{"type":"array","items":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}},"text/json":{"schema":{"type":"array","items":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.campaign:read` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Create campaign

> The id, link count, creation date and creator are set by the server. The pass type, identifier keys and\
> tag are fixed from then on. Every pass added from the links is attributed to the tag\
> (\`neo.src\`) and the medium (\`neo.src.medium\`).

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Campaigns"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.campaign:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CampaignDefinition":{"required":["identifierKeys","name","passType","tag"],"type":"object","properties":{"id":{"type":"string","description":"Server-set on creation, immutable: 8 letters and digits."},"name":{"maxLength":100,"minLength":0,"type":"string","description":"Label shown in the admin, up to 100 characters."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels to filter and group campaigns in the admin. At most 20 tags of 50 characters; trimmed, blanks\ndropped, case-insensitive duplicates kept once."},"passType":{"minLength":1,"type":"string","description":"The pass template whose identifiers the links carry. Fixed once created."},"layout":{"type":["null","string"],"description":"The download page (a layout of type `pass`) a link opens. `null` uses the pass template's own."},"identifierKeys":{"minItems":1,"type":"array","items":{"type":"string"},"description":"The pass identifiers each link carries, in the order of a link's values, e.g. `[\"ur.customerId\"]`. Each\none is read by a data provider of the pass template. Fixed once created."},"tag":{"maxLength":64,"minLength":0,"type":"string","description":"The source tag every pass added from these links is attributed to (`neo.src`), e.g. the campaign code of\nthe sending tool: 1 to 64 letters, digits, `_` and `-`, unique among the tenant's campaigns\nregardless of case. Fixed once created. Not Neo.Runtime.Campaign.CampaignDefinition.Tags, which only label the campaign in the admin."},"medium":{"maxLength":50,"minLength":0,"type":["null","string"],"description":"The source medium of every pass added from these links: how they are sent, e.g. `rcs`\n(`neo.src.medium`). Up to 50 characters, without\n`,` or `|`."},"status":{"description":"Whether the links work. A stopped campaign's links send the visitor to Neo.Runtime.Campaign.CampaignDefinition.StoppedUrl, or answer\n404 without one, until it is active again.","default":"active","$ref":"#/components/schemas/CampaignStatus"},"stoppedUrl":{"maxLength":2000,"minLength":0,"type":["null","string"],"description":"Where a link of a stopped campaign sends the visitor, e.g. the brand's site: an absolute `http` or\n`https` URL, up to 2,000 characters. `null` answers 404."},"linkCount":{"type":"integer","description":"Links generated so far, server-set.","format":"int64"},"creationDate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","format":"int64"}],"description":"Creation time in UTC, server-set. Accepts ISO 8601 date-time string or Unix epoch seconds in request inputs. Responses are serialized as ISO 8601 date-time strings."},"createdBy":{"type":["null","string"],"description":"Who created it, server-set."}},"additionalProperties":false,"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open."},"CampaignStatus":{"enum":["active","stopped"],"type":"string","description":"Whether the links of a campaign work."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/campaigns":{"post":{"tags":["Campaigns"],"summary":"Create campaign","description":"The id, link count, creation date and creator are set by the server. The pass type, identifier keys and\ntag are fixed from then on. Every pass added from the links is attributed to the tag\n(`neo.src`) and the medium (`neo.src.medium`).","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The campaign to create.","content":{"application/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"text/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"application/*+json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}},"required":true},"responses":{"201":{"description":"Campaign created.","content":{"text/plain":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"application/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"text/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}}},"400":{"description":"Missing body, unknown pass type, a layout that is not a download page, an identifier key no data provider of the pass type reads, a tag that is malformed or already used, a medium containing ',' or '|', a stopped URL that is not an absolute http(s) URL, or a field over its limits. The problem names the field.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.campaign:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"The tenant does not exist.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"Concurrent campaign write; retry.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## GET /api/{tenantId}/admin/campaigns/{campaignId}

> Get campaign

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Campaigns"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.campaign:read"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CampaignDefinition":{"required":["identifierKeys","name","passType","tag"],"type":"object","properties":{"id":{"type":"string","description":"Server-set on creation, immutable: 8 letters and digits."},"name":{"maxLength":100,"minLength":0,"type":"string","description":"Label shown in the admin, up to 100 characters."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels to filter and group campaigns in the admin. At most 20 tags of 50 characters; trimmed, blanks\ndropped, case-insensitive duplicates kept once."},"passType":{"minLength":1,"type":"string","description":"The pass template whose identifiers the links carry. Fixed once created."},"layout":{"type":["null","string"],"description":"The download page (a layout of type `pass`) a link opens. `null` uses the pass template's own."},"identifierKeys":{"minItems":1,"type":"array","items":{"type":"string"},"description":"The pass identifiers each link carries, in the order of a link's values, e.g. `[\"ur.customerId\"]`. Each\none is read by a data provider of the pass template. Fixed once created."},"tag":{"maxLength":64,"minLength":0,"type":"string","description":"The source tag every pass added from these links is attributed to (`neo.src`), e.g. the campaign code of\nthe sending tool: 1 to 64 letters, digits, `_` and `-`, unique among the tenant's campaigns\nregardless of case. Fixed once created. Not Neo.Runtime.Campaign.CampaignDefinition.Tags, which only label the campaign in the admin."},"medium":{"maxLength":50,"minLength":0,"type":["null","string"],"description":"The source medium of every pass added from these links: how they are sent, e.g. `rcs`\n(`neo.src.medium`). Up to 50 characters, without\n`,` or `|`."},"status":{"description":"Whether the links work. A stopped campaign's links send the visitor to Neo.Runtime.Campaign.CampaignDefinition.StoppedUrl, or answer\n404 without one, until it is active again.","default":"active","$ref":"#/components/schemas/CampaignStatus"},"stoppedUrl":{"maxLength":2000,"minLength":0,"type":["null","string"],"description":"Where a link of a stopped campaign sends the visitor, e.g. the brand's site: an absolute `http` or\n`https` URL, up to 2,000 characters. `null` answers 404."},"linkCount":{"type":"integer","description":"Links generated so far, server-set.","format":"int64"},"creationDate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","format":"int64"}],"description":"Creation time in UTC, server-set. Accepts ISO 8601 date-time string or Unix epoch seconds in request inputs. Responses are serialized as ISO 8601 date-time strings."},"createdBy":{"type":["null","string"],"description":"Who created it, server-set."}},"additionalProperties":false,"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open."},"CampaignStatus":{"enum":["active","stopped"],"type":"string","description":"Whether the links of a campaign work."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/campaigns/{campaignId}":{"get":{"tags":["Campaigns"],"summary":"Get campaign","parameters":[{"name":"campaignId","in":"path","description":"Campaign id, case-sensitive.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Campaign returned.","content":{"text/plain":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"application/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"text/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.campaign:read` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"No campaign with that id, or the tenant does not exist.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Update campaign

> Replaces the name, tags, layout, medium, status and stopped URL; links already sent follow the new values\
> from their next open. \`status: stopped\` sends every link to \`stoppedUrl\`, or answers 404 without one,\
> until it is \`active\` again. The\
> pass type, identifier keys and tag must be sent as they are; the server fields are kept.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Campaigns"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.campaign:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"CampaignDefinition":{"required":["identifierKeys","name","passType","tag"],"type":"object","properties":{"id":{"type":"string","description":"Server-set on creation, immutable: 8 letters and digits."},"name":{"maxLength":100,"minLength":0,"type":"string","description":"Label shown in the admin, up to 100 characters."},"tags":{"type":"array","items":{"type":"string"},"description":"Labels to filter and group campaigns in the admin. At most 20 tags of 50 characters; trimmed, blanks\ndropped, case-insensitive duplicates kept once."},"passType":{"minLength":1,"type":"string","description":"The pass template whose identifiers the links carry. Fixed once created."},"layout":{"type":["null","string"],"description":"The download page (a layout of type `pass`) a link opens. `null` uses the pass template's own."},"identifierKeys":{"minItems":1,"type":"array","items":{"type":"string"},"description":"The pass identifiers each link carries, in the order of a link's values, e.g. `[\"ur.customerId\"]`. Each\none is read by a data provider of the pass template. Fixed once created."},"tag":{"maxLength":64,"minLength":0,"type":"string","description":"The source tag every pass added from these links is attributed to (`neo.src`), e.g. the campaign code of\nthe sending tool: 1 to 64 letters, digits, `_` and `-`, unique among the tenant's campaigns\nregardless of case. Fixed once created. Not Neo.Runtime.Campaign.CampaignDefinition.Tags, which only label the campaign in the admin."},"medium":{"maxLength":50,"minLength":0,"type":["null","string"],"description":"The source medium of every pass added from these links: how they are sent, e.g. `rcs`\n(`neo.src.medium`). Up to 50 characters, without\n`,` or `|`."},"status":{"description":"Whether the links work. A stopped campaign's links send the visitor to Neo.Runtime.Campaign.CampaignDefinition.StoppedUrl, or answer\n404 without one, until it is active again.","default":"active","$ref":"#/components/schemas/CampaignStatus"},"stoppedUrl":{"maxLength":2000,"minLength":0,"type":["null","string"],"description":"Where a link of a stopped campaign sends the visitor, e.g. the brand's site: an absolute `http` or\n`https` URL, up to 2,000 characters. `null` answers 404."},"linkCount":{"type":"integer","description":"Links generated so far, server-set.","format":"int64"},"creationDate":{"oneOf":[{"type":"string","format":"date-time"},{"type":"integer","format":"int64"}],"description":"Creation time in UTC, server-set. Accepts ISO 8601 date-time string or Unix epoch seconds in request inputs. Responses are serialized as ISO 8601 date-time strings."},"createdBy":{"type":["null","string"],"description":"Who created it, server-set."}},"additionalProperties":false,"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open."},"CampaignStatus":{"enum":["active","stopped"],"type":"string","description":"Whether the links of a campaign work."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/campaigns/{campaignId}":{"put":{"tags":["Campaigns"],"summary":"Update campaign","description":"Replaces the name, tags, layout, medium, status and stopped URL; links already sent follow the new values\nfrom their next open. `status: stopped` sends every link to `stoppedUrl`, or answers 404 without one,\nuntil it is `active` again. The\npass type, identifier keys and tag must be sent as they are; the server fields are kept.","parameters":[{"name":"campaignId","in":"path","description":"Campaign id, case-sensitive.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The campaign as it should now stand.","content":{"application/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"text/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"application/*+json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}},"required":true},"responses":{"200":{"description":"Campaign updated.","content":{"text/plain":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"application/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}},"text/json":{"schema":{"description":"A campaign: personal links added to each row of a file, each giving its recipient their pass, created on first open.","$ref":"#/components/schemas/CampaignDefinition"}}}},"400":{"description":"Missing body, a changed pass type, identifier key or tag, a medium containing ',' or '|', a layout that is not a download page, a stopped URL that is not an absolute http(s) URL, or a field over its limits. The problem names the field.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.campaign:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"No campaign with that id, or the tenant does not exist.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"Concurrent campaign write; retry.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Delete campaign

> Its links answer 404 from then on, for good. Passes already created are kept. To pause instead, update it\
> with \`status: stopped\`.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Campaigns"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.campaign:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/campaigns/{campaignId}":{"delete":{"tags":["Campaigns"],"summary":"Delete campaign","description":"Its links answer 404 from then on, for good. Passes already created are kept. To pause instead, update it\nwith `status: stopped`.","parameters":[{"name":"campaignId","in":"path","description":"Campaign id, case-sensitive.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Campaign deleted."},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.campaign:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"No campaign with that id, or the tenant does not exist.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"Concurrent campaign write; retry.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Record delivery reports

> Records what the system that sent a campaign's links reports about them: \`sent\`, \`delivered\`,\
> \`read\` or \`failed\`. A report names its link by the row the link was generated from, and is dated by\
> \`occurredAt\`, the time it happened in that system. A call with an invalid report records none of them. A\
> report sent twice is recorded twice; the campaign's figures count each link once.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Campaigns"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.campaign.delivery:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"DeliveryReportsRequest":{"required":["reports"],"type":"object","properties":{"reports":{"maxItems":1000,"minItems":1,"type":"array","items":{"description":"What an external system reports about one campaign link it sent.","$ref":"#/components/schemas/DeliveryReport"},"description":"1 to 1,000 reports."}},"additionalProperties":false,"description":"The delivery reports to record."},"DeliveryReport":{"required":["occurredAt","status","values"],"type":"object","properties":{"values":{"type":"array","items":{"type":"string"},"description":"The link's identifier values, one per identifier key of the campaign, in their order: the row the link was\ngenerated from."},"status":{"description":"What happened to the message carrying the link.","$ref":"#/components/schemas/DeliveryStatus"},"occurredAt":{"type":"string","description":"When it happened in the external system, ISO 8601 with its offset, for instance `2026-11-03T16:30:00Z`.\nThe campaign's figures date it at this time.","format":"date-time"},"provider":{"maxLength":64,"type":["null","string"],"description":"The system that reports it, for instance the SMS or email provider. Up to 64 characters."}},"additionalProperties":false,"description":"What an external system reports about one campaign link it sent."},"DeliveryStatus":{"enum":["sent","delivered","read","failed"],"type":"string","description":"What an external system reports about a campaign link it sent."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/campaigns/{campaignId}/deliveries":{"post":{"tags":["Campaigns"],"summary":"Record delivery reports","description":"Records what the system that sent a campaign's links reports about them: `sent`, `delivered`,\n`read` or `failed`. A report names its link by the row the link was generated from, and is dated by\n`occurredAt`, the time it happened in that system. A call with an invalid report records none of them. A\nreport sent twice is recorded twice; the campaign's figures count each link once.","parameters":[{"name":"campaignId","in":"path","description":"Campaign id, case-sensitive.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The reports.","content":{"application/json":{"schema":{"description":"The delivery reports to record.","$ref":"#/components/schemas/DeliveryReportsRequest"}},"text/json":{"schema":{"description":"The delivery reports to record.","$ref":"#/components/schemas/DeliveryReportsRequest"}},"application/*+json":{"schema":{"description":"The delivery reports to record.","$ref":"#/components/schemas/DeliveryReportsRequest"}}},"required":true},"responses":{"204":{"description":"Reports recorded."},"400":{"description":"Missing body, no reports or more than 1,000, a report without a known status or time, dated before the campaign or in the future, or whose values do not match the campaign's identifier keys. The problem names the report.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.campaign.delivery:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"No campaign with that id, or the tenant does not exist.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```

## Generate campaign links

> Signs one link per row. A link carries the campaign and the row's values only; it opens the campaign's\
> download page, which finds or creates the pass carrying those identifiers. The same row always gives the\
> same link. Adds the number of rows to the campaign's link count.

```json
{"openapi":"3.1.1","info":{"title":"The Wallet Crew internal API","version":"v1"},"tags":[{"name":"Campaigns"}],"servers":[{"url":"https://api.thewalletcrew.io","description":"Production Server"},{"url":"https://api-qa.thewalletcrew.io","description":"Staging Server"}],"security":[{"admin-bearer":["tenant.campaign:write"]},{"apiKey":[]}],"components":{"securitySchemes":{"admin-bearer":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://auth.neostore.cloud/authorize?audience=https://app.neostore.cloud/api/","scopes":{}}}},"apiKey":{"type":"apiKey","name":"X-API-KEY","in":"header"}},"schemas":{"LinksRequest":{"required":["values"],"type":"object","properties":{"values":{"maxItems":10000,"minItems":1,"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"One row per link: a value per identifier key of the campaign, in their order. 1 to 10,000 rows."}},"additionalProperties":false,"description":"The rows to generate links for."},"LinksResponse":{"type":"object","properties":{"links":{"type":"array","items":{"type":"string"},"description":"One link per row, in the order of the rows."}},"additionalProperties":false,"description":"The generated links."},"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}},"paths":{"/api/{tenantId}/admin/campaigns/{campaignId}/links":{"post":{"tags":["Campaigns"],"summary":"Generate campaign links","description":"Signs one link per row. A link carries the campaign and the row's values only; it opens the campaign's\ndownload page, which finds or creates the pass carrying those identifiers. The same row always gives the\nsame link. Adds the number of rows to the campaign's link count.","parameters":[{"name":"campaignId","in":"path","description":"Campaign id, case-sensitive.","required":true,"schema":{"type":"string"}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The rows.","content":{"application/json":{"schema":{"description":"The rows to generate links for.","$ref":"#/components/schemas/LinksRequest"}},"text/json":{"schema":{"description":"The rows to generate links for.","$ref":"#/components/schemas/LinksRequest"}},"application/*+json":{"schema":{"description":"The rows to generate links for.","$ref":"#/components/schemas/LinksRequest"}}},"required":true},"responses":{"200":{"description":"Links generated, in the order of the rows.","content":{"text/plain":{"schema":{"description":"The generated links.","$ref":"#/components/schemas/LinksResponse"}},"application/json":{"schema":{"description":"The generated links.","$ref":"#/components/schemas/LinksResponse"}},"text/json":{"schema":{"description":"The generated links.","$ref":"#/components/schemas/LinksResponse"}}}},"400":{"description":"Missing body, no rows or more than 10,000, or a row whose values do not match the campaign's identifier keys. The problem names the row.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"401":{"description":"The caller is not authenticated.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"403":{"description":"The caller lacks the `tenant.campaign:write` scope.","content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"404":{"description":"No campaign with that id, or the tenant does not exist.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"409":{"description":"Concurrent campaign write; retry.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"429":{"description":"Over 1200 requests per minute to this endpoint for the tenant (default limit); retry after `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying. Sent when the limiter knows it.","schema":{"type":"integer"}}},"content":{"application/problem+json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thewalletcrew.io/api-reference/internal/enrolment-and-messaging/campaigns.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
