> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/api-reference/campaign/get-a-list-of-available-campaigns-for-the-member.md).

# Get a list of available campaigns for the member.

Integration\
\
This method returns all active Campaigns for Member. The logged in member can only see their own available campaigns. Endpoint returns all active campaigns, for campaigns that have not reached the limit it adds `"limitReached": false`, and for campaigns that have reached the limit `"limitReached": true`. If there is a dynamic effect in the campaign, the endpoint may return that the campaign limit is not reached, although the effect may exceed the limit and points will not be awarded If sorting is not chosen, the rows will be returned in an unspecified order. To sort a result, use an `_orderBy` parameter in query.

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Campaign","description":"These endpoints will allow you to easily manage campaigns."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"page":{"name":"_page","in":"query","description":"Number of the page with results, starts from 1.\n\n**Not for iterating over large data sets.** The cost of a request grows with the page number: the database still reads and discards every row of the previous pages, so deep pages are slow and load the whole API. Use `_page` to browse the first pages of a result. The maximum value of `_page` is limited on some endpoints, see [Limits](https://help.openloyalty.io/technical-guide/api-fundamentals/limits).\n\nTo fetch all records, or any large volume of them, use the `_scroll` parameter where the endpoint offers it, see [Scroll mechanism for pages](https://help.openloyalty.io/technical-guide/api-fundamentals/scroll-mechanism-for-pages).\n","required":false,"schema":{"type":"integer","default":1,"minimum":1}},"itemsOnPage":{"name":"_itemsOnPage","in":"query","description":"Items on one page, in both `_page` and `_scroll` pagination.\n","required":false,"schema":{"type":"integer","default":10,"maximum":50,"minimum":1}},"orderBy":{"name":"_orderBy","in":"query","description":"Sorting order. If sorting is not chosen, the rows will be returned in an unspecified order. Sort order: * `asc` - Ascending, from A to Z * `desc` - Descending, from Z to A","required":false,"style":"deepObject","explode":true,"schema":{"type":"object","additionalProperties":{"type":"string","enum":["asc","desc"]}}}},"schemas":{"AvailableCampaign":{"required":["campaignId","name","active","activity","rules","translations","createdAt","displayOrder","labels","type","trigger","limitReached","limits","memberFilter","limitUsages"],"properties":{"campaignId":{"type":"string","format":"uuid"},"active":{"type":"boolean"},"activity":{"required":["startsAt"],"properties":{"startsAt":{"type":"string"},"endsAt":{"type":"string","nullable":true}},"type":"object","additionalProperties":false},"rules":{"type":"array","items":{"required":["conditions","effects"],"properties":{"conditions":{"type":"array","items":{"properties":{"operator":{"type":"string"},"data":{"type":"array","items":{"type":"string"}},"attribute":{"type":"string"}},"type":"object"}},"effects":{"type":"array","items":{"required":["effect"],"properties":{"effect":{"type":"string"},"pointsRule":{"description":"Absent on a `give_points` effect that declares its payout through `unitsRule`.","type":"string"},"relatedLineTarget":{"description":"The line target whose lines `unitsRule` measures. Present only on a `give_points` effect with `unitsRule` that names a line target; absent when `unitsRule` measures the whole transaction.","type":"string","minLength":3,"maxLength":32},"unitsRule":{"description":"Present only for a `give_points` effect that declares its payout this way.","allOf":[{"$ref":"#/components/schemas/UnitsRule"}]}},"type":"object"}}},"type":"object"}},"limits":{"$ref":"#/components/schemas/Limit"},"translations":{"type":"array","items":{"required":["id","name","locale"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"id":{"type":"integer"},"locale":{"type":"string"}},"type":"object","additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"memberFilter":{"type":"object"},"displayOrder":{"type":"number"},"labels":{"type":"array","items":{"required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object","additionalProperties":false}},"multiLevel":{"type":"number"},"codeGenerator":{"type":"object"},"eventCodeAttribute":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string"},"trigger":{"type":"string"},"event":{"type":"string"},"achievementId":{"type":"string","format":"uuid"},"relatedAchievement":{"$ref":"#/components/schemas/RelatedAchievement"},"limitReached":{"description":"This property indicates whether the limit for campaign is reached by member","type":"boolean"},"limitUsages":{"properties":{"points":{"description":"These fields are not updated immediately after the status changes.","properties":{"currentValue":{"type":"number","format":"float"},"limitValue":{"type":"number","format":"float"},"remaining":{"type":"number","format":"float"},"interval":{"properties":{"type":{"type":"string","enum":["calendarHours","calendarDays","calendarWeeks","calendarMonths","calendarYears"]},"value":{"type":"integer","deprecated":true}},"type":"object"}},"type":"object"}},"type":"object"},"customFields":{"description":"Custom field values of the campaign, grouped by custom field group key. Present only when the campaign has at least one value set; identical to the value returned by the campaign management endpoints.","type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":true}}},"type":"object","additionalProperties":false},"UnitsRule":{"description":"How a `give_points` effect computes the units it grants.","required":["applyTo","amount"],"properties":{"applyTo":{"description":"The measure `amount` is multiplied by, read from the line target `relatedLineTarget` names, or from the whole transaction when the effect declares no `relatedLineTarget`.\n\n* `flat` — `amount` once. Booked against a line target, it pays only when the target matched at least one line, and nothing otherwise.\n* `quantity` — `amount` × the quantity bought: of the target's lines, of the units its sets consumed, or of every line of the transaction.\n* `value` — `amount` × the gross value: of the target's lines, of the lines its sets consumed, or of the whole transaction.\n* `count` — `amount` × the number of sets formed. Accepted only when `relatedLineTarget` names a line target that selects `sets`; on a `lines` target or without `relatedLineTarget` the request is rejected with `400` on `rules.N.effects.M.unitsRule.applyTo`.\n\nThe effect's `transform` scales the result afterwards.","type":"string","enum":["flat","quantity","count","value"]},"amount":{"description":"Units granted per measure unit. Must be greater than zero and at most 10 000 000; anything else is rejected with `400` on `rules.N.effects.M.unitsRule.amount`.","type":"number","exclusiveMinimum":true,"minimum":0,"maximum":10000000}},"type":"object","additionalProperties":false},"Limit":{"properties":{"points":{"required":["value"],"properties":{"interval":{"properties":{"type":{"type":"string"},"value":{"type":"integer","deprecated":true}},"type":"object"},"value":{"type":"number","format":"float"}},"type":"object"},"pointsPerMember":{"required":["value"],"properties":{"interval":{"properties":{"type":{"type":"string"},"value":{"type":"integer","deprecated":true}},"type":"object"},"value":{"type":"number","format":"float"}},"type":"object"},"executionsPerMember":{"required":["value"],"properties":{"interval":{"properties":{"type":{"type":"string"},"value":{"type":"integer","deprecated":true}},"type":"object"},"value":{"type":"number","format":"float"}},"type":"object"}},"type":"object"},"RelatedAchievement":{"properties":{"achievementId":{"type":"string","format":"uuid"},"achievementName":{"type":"string"},"limitReached":{"description":"This property indicates whether the limit for achievement is reached by member","type":"boolean"},"memberProgress":{"$ref":"#/components/schemas/MemberAchievementProgress"},"lastTrigger":{"description":"Last trigger which triggered related achievement","properties":{"triggerId":{"type":"string","format":"uuid"},"triggerType":{"type":"string","enum":["transaction","custom_event"]}},"type":"object"}},"type":"object","deprecated":true},"MemberAchievementProgress":{"properties":{"completedCount":{"type":"integer"},"rules":{"type":"array","items":{"properties":{"achievementRuleId":{"type":"string"},"periodGoal":{"type":"number","format":"float"},"currentPeriodValue":{"type":"number","format":"float"},"consecutivePeriods":{"type":"integer"},"completedConsecutivePeriods":{"type":"integer"},"periodType":{"type":"string"},"type":{"type":"string"},"trigger":{"type":"string"},"periodValue":{"type":"number","format":"float"}},"type":"object"}}},"type":"object"},"SearchableTotalResponse":{"required":["all","filtered","estimated"],"properties":{"all":{"type":"integer","deprecated":true},"filtered":{"type":"integer","deprecated":true},"estimated":{"description":"Field estimated is used to show that the results are estimated. It might happen when there are more than 5000 results due to performance optimization.","type":"boolean","deprecated":true}},"type":"object","deprecated":true},"MemberAvailableCampaign":{"required":["campaignId","translations","name","limitReached"],"properties":{"campaignId":{"type":"string","format":"uuid"},"translations":{"type":"array","items":{"properties":{"name":{"type":"string"},"description":{"type":"string"},"id":{"type":"integer"},"locale":{"type":"string"}},"type":"object"}},"name":{"type":"string"},"description":{"type":"string"},"relatedAchievement":{"$ref":"#/components/schemas/RelatedAchievement"},"limitReached":{"description":"This property indicates if the campaign is available to a member","type":"boolean"},"limitUsages":{"properties":{"pointsPerMember":{"properties":{"currentValue":{"type":"number","format":"float"},"limitValue":{"type":"number","format":"float"},"remaining":{"type":"number","format":"float"},"interval":{"properties":{"type":{"type":"string","enum":["calendarHours","calendarDays","calendarWeeks","calendarMonths","calendarYears"]},"value":{"type":"integer","deprecated":true}},"type":"object"}},"type":"object"},"executionsPerMember":{"properties":{"currentValue":{"type":"number","format":"float"},"limitValue":{"type":"number","format":"float"},"remaining":{"type":"number","format":"float"},"interval":{"properties":{"type":{"type":"string","enum":["calendarHours","calendarDays","calendarWeeks","calendarMonths","calendarYears"]},"value":{"type":"integer","deprecated":true}},"type":"object"}},"type":"object"}},"type":"object"},"customFields":{"description":"Custom field values of the campaign, grouped by custom field group key. Present only when the campaign has at least one value set; identical to the value returned by the campaign management endpoints.","type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":true}}},"type":"object","additionalProperties":false},"ExpiredToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"InvalidToken":{"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"type":"object"},"Unauthorized":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}},"responses":{"BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"required":["code","message","errors"],"properties":{"code":{"type":"integer"},"message":{"type":"string"},"errors":{"type":"array","items":{"required":["message","parameters","plural","code","path"],"properties":{"message":{"type":"string"},"parameters":{},"plural":{"type":"integer","nullable":true},"code":{"type":"string"},"path":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/member/{member}/campaign":{"get":{"tags":["Campaign"],"summary":"Get a list of available campaigns for the member.","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method returns all active Campaigns for Member.\nThe logged in member can only see their own available campaigns.\nEndpoint returns all active campaigns, for campaigns that have not reached the limit it adds `\"limitReached\": false`,\nand for campaigns that have reached the limit `\"limitReached\": true`.\nIf there is a dynamic effect in the campaign, the endpoint may return that the\ncampaign limit is not reached, although the effect may exceed the limit and points will not be awarded \nIf sorting is not chosen, the rows will be returned in an unspecified order.\nTo sort a result, use an `_orderBy` parameter in query.\n","operationId":"_campaignAvailableMember","parameters":[{"$ref":"#/components/parameters/storeCode"},{"name":"member","in":"path","required":true,"schema":{"type":"string","pattern":"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|email=[a-zA-Z0-9!#$%&'\\.*+\\-@=?^_{|}~;]+|phone=[0-9+]+|loyaltyCardNumber=[0-9a-zA-Z\\._-]+"}},{"name":"type","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"string"}},{"name":"trigger","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"string"}},{"name":"event","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"string"}},{"name":"campaignId","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"string"}},{"name":"showAll","in":"query","description":"This parameter allows to show all campaign even not active","required":false,"style":"deepObject","explode":true,"schema":{"type":"boolean"}},{"name":"name","in":"query","description":"Campaign name","required":false,"style":"deepObject","explode":true,"schema":{"type":"string"}},{"name":"startsAt","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"string","format":"date-time"}},{"name":"endsAt","in":"query","required":false,"style":"deepObject","explode":true,"schema":{"type":"string","format":"date-time"}},{"name":"labels","in":"query","description":"Filter with Campaign custom attributes.\n\nExample: `labels=(key;value)`\n","required":false,"style":"deepObject","explode":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"If set to html, the descriptions will be in HTML format. Omit for raw output.","required":false,"style":"deepObject","explode":true,"schema":{"type":"string","format":"html|raw"}},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/itemsOnPage"},{"$ref":"#/components/parameters/orderBy"}],"responses":{"200":{"description":"List of available member campaigns.","content":{"application/json":{"schema":{"oneOf":[{"title":"AvailableCampaign","required":["items","total"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AvailableCampaign"}},"total":{"$ref":"#/components/schemas/SearchableTotalResponse"}},"type":"object","additionalProperties":false},{"title":"MemberAvailableCampaign","required":["items","total"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MemberAvailableCampaign"}},"total":{"$ref":"#/components/schemas/SearchableTotalResponse"}},"type":"object","additionalProperties":false}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ExpiredToken"},{"$ref":"#/components/schemas/InvalidToken"},{"$ref":"#/components/schemas/Unauthorized"}]}}}},"403":{"$ref":"#/components/responses/AccessDenied"}}}}}}
````


---

# 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://help.openloyalty.io/api-reference/campaign/get-a-list-of-available-campaigns-for-the-member.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.
