# 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.&#x20;

\
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](https://docs.tryterra.co/reference/core-concepts#coach) has authenticated under your developer ID

**Recommended action:**

**Save the** [**Coach**](https://docs.tryterra.co/reference/core-concepts#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](https://docs.tryterra.co/reference/core-concepts#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](https://docs.tryterra.co/reference/core-concepts#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>
