# Event types

{% hint style="info" %}
Every request made to Terra, and every event sent from Terra will contain a `terra-reference` header containing a unique identifier for the request or event.

\
The `terra-reference` identifier uniquely ties together a request -> event pair, whenever a request for data leads to data being asynchronously sent to your server. This can be useful for keeping track of whether or not a data transfer request has been fulfilled, or is still pending transfer
{% endhint %}

## Coach

<details>

<summary>Coach registration</summary>

**Slug:**

coach.registered

**Trigger:**

A [Coach](/reference/teams-api/core-concepts.md#coach) has authenticated under your developer ID

**Recommended action:**

**Save the** [**Coach**](/reference/teams-api/core-concepts.md#coach) **to your database**

**Format:**

```json
{
  "data": Coach,
  "message": "Coach has successfully registered",
  "type": "coach.registered"
}
```

</details>

## Athlete

<details>

<summary>Athlete creation</summary>

**Slug:**

`athlete.registered`

**Trigger:**

One or more athletes have been registered under an associated coach

**Recommended action:**

Save the [athletes](/reference/teams-api/core-concepts.md#athlete) to your database, and make a PATCH for each athlete to attach the appropriate reference ID to them

**Format:**

```json
{
  "data": Coach,
  "message": "One or more Athletes have been successfully registered",
  "type": "athlete.registered"
}
```

</details>

<details>

<summary>Athlete deletion</summary>

**Slug:**

`athlete.deleted`

**Trigger:**

One or more athletes have been deleted

**Recommended action:**

Remove the [athletes](/reference/teams-api/core-concepts.md#athlete)' information from your database as per your requirements, or acknowledge that these have been deleted on the providers' system

**Format:**

```json
{
  "data": [athlete],
  "message": "One or more Athletes have been deleted",
  "type": "athlete.deleted"
}
```

</details>

## Data requests

<details>

<summary>Tests retrieved</summary>

**Slug:**

`test.retrieved`

**Trigger:**

One or more tests have been retrieved

**Recommended action:**

Save the tests' data as per your requirements, and update any existing tests based on the tests' unique IDs

**Format:**

```json
{
  "data": [Test],
  "coach": Coach,
  "type": "test.retrieved"
}
```

</details>

<details>

<summary>Activities retrieved</summary>

**Slug:**

`activity.retrieved`

**Trigger:**

One or more activities have been retrieved

**Recommended action:**

Save the activities' data as per your requirements, and update any existing tests based on the activities' unique IDs

**Format:**

```json
{
  "data": [Activity],
  "coach": Coach,
  "type": "activity.retrieved"
}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tryterra.co/reference/teams-api/event-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
