> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goliathdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Team API

> Teammates, team invites, team analytics, and your own profile through the Goliath developer API

## About

Operations for the people side of your organization: list teammates, manage
team invitations, read team performance analytics, and manage the key
owner's own profile.

All operations go through the developer API gateway — one endpoint, called by
`operationId`. If you haven't set up a key yet, start with the
[Developer API Overview](/developer-api/overview).

## Operations

### Teammates and profile (`READ` + `WRITE` scopes)

| operationId         | Scope   | What it does                                                                                                                                                                                                                                                             |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `listTeammates`     | `READ`  | List teammates in your organization (optionally filtered by a search term). Use the returned `userId` with `assignContact` and other operations.                                                                                                                         |
| `getTeammatesByIds` | `READ`  | Resolve teammate user ids to people — pass `userIds`, get back `id`, `firstName`, `lastName`, `email` for each. The id → person lookup: `listTeammates` searches by name/email/phone and caps at 20 rows, so it cannot answer "who is this id" in a larger organization. |
| `getMyProfile`      | `READ`  | Fetch the key owner's own profile — name, email, phone number.                                                                                                                                                                                                           |
| `updateMyProfile`   | `WRITE` | Update the key owner's own profile. `firstName`, `lastName`, and `phoneNumber` are required together (send current values for unchanged fields). Email is not editable.                                                                                                  |

### Team invites (`ADMIN` scope)

| operationId        | What it does                                                                                                                                                                      |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `listTeamInvites`  | List the organization's team invitations (pending + spent/revoked, single-use + permanent). Each `id` maps to the accept URL `/accept-invite/{id}`.                               |
| `createTeamInvite` | Create an invite link. `userType` sets the role (`ADMIN` \| `MEMBER` \| `ISA`; default `MEMBER`); pass `emails` to notify recipients, or `isPermanent: true` for a reusable link. |
| `revokeTeamInvite` | Revoke an invitation by id — the link stops working immediately.                                                                                                                  |

### Team analytics (`ADMIN` scope)

Reporting reads over the same nightly snapshots as the web app's Analytics
pages — each response carries the `asOfDate` it was computed. Both take an
optional `period`: `SEVEN_DAYS` | `FOURTEEN_DAYS` | `THIRTY_DAYS` |
`YEAR_TO_DATE` (default `THIRTY_DAYS`).

| operationId                 | What it does                                                                                                                                                                      |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getTeamAnalyticsOverview`  | Team performance overview — org-wide activity totals with prior-period deltas, per-agent rows (calls, texts, appointments, lead buckets, score), and per-agent pipeline outcomes. |
| `getTeamActivityTimeseries` | Daily team activity rows — calls, texts, emails, tasks, appointments, active agents, new leads per day. For charting trends.                                                      |

<Warning>
  **Rate-limited**

  Analytics operations are rate-limited per key. Exceeding the limit returns
  `429 rate_limited` with a `Retry-After` header. Pipeline-level analytics
  (outcomes and funnel) live in the
  [Pipelines API](/developer-api/pipelines#pipeline-analytics-admin-scope).
</Warning>

<Note>
  **Everything is your organization**

  Team operations are inherently org-scoped: `listTeammates` and `listTeamInvites`
  return only your organization's people and invites, and `createTeamInvite` creates
  under your org. `revokeTeamInvite` takes an invitation id, but a foreign one is
  rejected — the service requires you to be an `ADMIN` of that invitation's own
  organization. Analytics run against your org only (the gateway injects the org id,
  so it can't be forged). See [Authorization](/developer-api/authorization).
</Note>

## Example

Pull the last 7 days of team activity for a dashboard:

```bash theme={null}
curl -X POST https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer gsk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "operationId": "getTeamActivityTimeseries", "variables": { "period": "SEVEN_DAYS" } }'
```

Full variable schemas, response shapes, and worked examples for every
operation are available from the
[discovery endpoint](/developer-api/overview#discovering-operations).
