Read your data
The API can answer the same questions a connected AI app can, in a form your own code can use. Everything here is read-only.
Choose what the key can read
When you create a key, give it only what it needs. A key that builds a report on programs has no reason to see employee names.
Walk through a long list
Lists of programs, employees and groups come back a page at a time. Keep asking until nextCursor is null:
const employees = []
let cursor
do {
const url = new URL('https://api.teambrite.com/v1/employees')
url.searchParams.set('limit', '100')
if (cursor) url.searchParams.set('cursor', cursor)
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.TEAMBRITE_API_KEY}` },
})
const page = await response.json()
employees.push(...page.data)
cursor = page.nextCursor
} while (cursor)
Find one person
To match someone in your own system to Teambrite, filter employees by email, externalId or id. You get them as the only item in data, or an empty data if nobody matches.
See what's coming
Upcoming rewards lists the rewards due, earliest first and a page at a time, with totals by program. It's a good source for a budget report. Starter plans can look 60 days ahead, and Enterprise plans 365. If you ask for more than your plan allows, you get what it does allow, and limitedToDays says so.
Find the gaps
Three endpoints look for problems in your programs:
| Endpoint | The question it answers |
|---|---|
| Coverage gaps | How many people does no birthday or anniversary program reach? List them when you need names |
| Quiet employees | Who has gone a long time without a reward? |
| Program review | Which programs would pay someone twice, or never pay anyone? |
These do more work than a simple list, so run them on a schedule rather than on every page view.