Getting started
1. Create a token
Go to Settings → API Tokens in your Brila account and create a new
token. Give it a name (so you can recognize it later) and pick the scopes
it needs — for example discount_codes:read and discount_codes:write.
The raw token is shown once, right after creation. Copy it somewhere safe — if you lose it, revoke it and create a new one.
2. Make a request
Send the token as a Bearer token in the Authorization header:
curl https://brila.me/api/v1/discount_codes \
-H "Authorization: Bearer brla_..."
{
"data": [
{
"id": "b3f1e2b0-...",
"code": "SUMMER10",
"type": "percentage",
"amount": "10",
"brand": "My Brand",
"visibility": "public",
"position": 0
}
]
}
3. Create something
curl -X POST https://brila.me/api/v1/discount_codes \
-H "Authorization: Bearer brla_..." \
-H "Content-Type: application/json" \
-d '{
"code": "WELCOME10",
"type": "percentage",
"amount": "10",
"brand": "My Brand"
}'
See the API reference for every field and endpoint, or read on for how authentication and scopes work.