Skip to main content
GET
Get a running campaign

Authorizations

Authorization
string
header
required

API Key Authentication

Use your API key in the Authorization header:

Key Types:

Secret Keys (Server-Side Only):

  • Format: tybrite_sk_live_* (production) or tybrite_sk_test_* (sandbox)
  • Full read/write access to all endpoints
  • ⚠️ NEVER expose in client-side code or public repositories
  • Required for: write operations, authentication, payment verification, AI recommendations

Publishable Keys (Client-Safe):

  • Format: tybrite_pk_live_* (production) or tybrite_pk_test_* (sandbox)
  • Read-only access (GET requests only, plus POST semantic search)
  • ✅ Safe for client-side JavaScript, mobile apps, and public code
  • Allowed for: browsing products, search, CMS content, pricing queries

Endpoint-Specific Requirements:

  • Authentication endpoints (/v1/auth/*): Secret key required
  • Payment verification (POST /v1/payments/verify): Secret key required
  • AI Recommendations (POST /v1/recommendations): Secret key required
  • Semantic Search (POST /v1/search): Both key types allowed (read-only operation)
  • All write operations: Secret key required
  • All read operations: Both key types allowed

Using a publishable key for restricted operations returns 403 Forbidden.

Path Parameters

id
string<uuid>
required

The campaign id.

Response

The campaign.

A discount with a budget behind it. It stops discounting once the budget is spent, which is what separates a campaign from a promotion — a promotion runs until its end date. The budget and everything measured against it are the merchant's own figures and are not exposed.

id
string<uuid>
name
string
type
string

The kind of campaign, as the merchant categorised it.

Example:

"seasonal"

discount_type
enum<string>

Whether discount_value is a percentage of the cart or a fixed amount off it.

Available options:
percentage,
fixed_amount
discount_value
number

The percentage, or the fixed amount, depending on discount_type.

start_date
string<date>
end_date
string<date>
status
string

Lifecycle status. Only a running campaign is returned, so this is always active.

Example:

"active"

applies_to
enum<string>

Where the campaign is valid — a storefront, a till, or both.

Available options:
all,
online,
pos
has_time_restrictions
boolean

Whether the campaign only applies at certain hours or on certain days.

start_time
string | null

Start of the daily window, in time_zone. Null when there is no time restriction.

end_time
string | null

End of the daily window, in time_zone. Null when there is no time restriction.

time_zone
string | null

The zone the daily window is evaluated in.

Example:

"UTC"

apply_to_days
string[] | null

Days of the week the campaign applies on. Null when it applies every day.

image
string | null

Banner artwork for the campaign. Null when the merchant has not set one.

image_mobile
string | null

Phone-sized banner. Null when only the desktop banner is set — fall back to image there, rather than cropping it.