For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
  • Contact Management
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
  • Conversations
  • Ecommerce
  • Loyalty
      • GETGet loyalty program list
      • POSTCreate loyalty program
      • GETGet loyalty program Info
      • PUTUpdate loyalty program
      • PATCHPartially update loyalty program
      • DELDelete Loyalty Program
      • POSTPublish loyalty program
      • POSTCreate subscription
      • POSTCreate subscription member
      • DELDelete subscription member
      • DELDelete subscription
      • GETGet Subscription Data
LogoLogo
Help CenterAPI KeysStatusSign In
LoyaltyProgram

Create loyalty program

POST
https://api.brevo.com/v3/loyalty/config/programs
POST
/v3/loyalty/config/programs
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.program.createNewLp({
8 name: "string",
9 });
10}
11main();
1{
2 "id": "string",
3 "name": "string",
4 "description": "string",
5 "meta": {},
6 "state": "inactive",
7 "subscriptionPoolId": "string",
8 "subscriptionGeneratorId": "string",
9 "pattern": "string",
10 "codeCount": 1,
11 "documentId": "string",
12 "birthdayAttribute": "string",
13 "createdAt": "2024-01-15T09:30:00Z",
14 "updatedAt": "2024-01-15T09:30:00Z"
15}
Creates loyalty program
Was this page helpful?
Previous

Get loyalty program Info

Next
Built with

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Request

Payload for creating a new loyalty program.
namestringRequired<=128 characters

Required name of the loyalty program (max 128 chars).

descriptionstringOptional<=256 characters

Optional description of the loyalty program (max 256 chars).

documentIdstringOptional
Optional unique document ID.
metamap from strings to anyOptional
Optional metadata related to the loyalty program.

Response

Successfully created loyalty program.
idstringformat: "uuid"
Loyalty Program unique identifier.
namestring
Loyalty Program name.
descriptionstring
Loyalty Program description.
metamap from strings to any
Loyalty Program metadata.
stateenum
Current state of the loyalty program.
Allowed values:
subscriptionPoolIdstringformat: "uuid"
Loyalty Program subscription pool ID.
subscriptionGeneratorIdstringformat: "uuid"
Loyalty Program subscription generator ID.
patternstring
Subscription code pattern.
codeCountlong
Number of available subscription codes.
documentIdstringformat: "uuid"
Associated document identifier.
birthdayAttributestring
Contact attribute name used for birthday tracking.
createdAtdatetime
Timestamp when the loyalty program was created.
updatedAtdatetime
Timestamp when the loyalty program was last modified.

Errors

401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
422
Unprocessable Entity Error
500
Internal Server Error