# OpenAPI and schema

> Machine-readable data model endpoint for AI agents and integrations.

## GET /api/v2/schema

Returns a machine-readable description of the trackagoat data model. Designed for AI agents that need to understand entity types, field names, and relationships without reading source code.

### Request

```bash
curl -H "Authorization: Bearer tga_<key>" \
  https://www.trackagoat.com/api/v2/schema
```

### When to use this

Call `/api/v2/schema` when you first connect to the API to get a full picture of available entities and their fields. The response is stable across minor API updates: field names and types won't change without a version bump.

> **Tip:**
>
> AI agents should call `/api/v2/schema` at the start of each session to orient themselves before querying data. See the [Agent guide](https://www.trackagoat.com/docs/agents/guide.md) for more.

### Response

The schema endpoint returns an object describing each entity type, its fields, and key relationships. The exact shape is controlled server-side and may expand over time.

Since Trackagoat 2.0 the model is multi-platform: it now includes the **account** and **content group** entities alongside creators and videos. A creator owns many accounts, videos hang off accounts, and a content group links the same logical content across platforms.

```json
{
  "data": {
    "entities": {
      "project": { "fields": {...}, "description": "..." },
      "creator": { "fields": {...}, "description": "..." },
      "account": { "fields": {...}, "description": "..." },
      "video": { "fields": {...}, "description": "..." },
      "content_group": { "fields": {...}, "description": "..." },
      "campaign": { "fields": {...}, "description": "..." }
    },
    "relationships": [...]
  },
  "error": null,
  "meta": null
}
```

- [Agent guide](https://www.trackagoat.com/docs/agents/guide.md): How AI agents should connect to and use the trackagoat API.
- [API overview](https://www.trackagoat.com/docs/api-reference/overview.md): Base URL, response envelope, pagination, and versioning.

---
Source: https://www.trackagoat.com/docs/api-reference/schema
