# Accessing Content

The Content Library allows your application to fetch and display structured CBT, DBT, mindfulness, and wellbeing exercises. These exercises can be shown as standalone activities, recommended alongside therapy sessions, or included in daily routines.

This page shows how to retrieve content from the therappai API and embed it inside your product.

***

## **How Content Delivery Works**

Content inside therappai is made up of:

* **Categories** (CBT, DBT, Mindfulness)
* **Titles & descriptions**
* **Exercise steps or guidance**
* **Tags** (e.g., anxiety, grounding, focus)
* **Optional audio files**
* **Transcripts**
* **Progress & completion data**

The API provides simple endpoints for:

* listing all content
* retrieving detailed exercise information
* tracking favourites
* tracking progress

Your UI determines how content is displayed.

***

### **1. Fetch All Content**

Use this if your app has:

* a content library screen
* a catalog of exercises
* personalised recommendations
* a carousel of learning tools

Request:

```
GET /content/
Authorization: Bearer ACCESS_TOKEN
```

This returns a list of content items for the user to browse.

***

### **2. Fetch a Specific Exercise**

When a user taps into an exercise, fetch its details with:

```
GET /content/{id}/
Authorization: Bearer ACCESS_TOKEN
```

A content item may include:

* title
* long description
* steps or structured exercise
* audio file (optional)
* transcript
* tags
* estimated duration
* completion attributes

You decide how to render these in your UI — full page, step-by-step, audio player, etc.

***

### **3. Mark Content as Favourite**

If your app allows saving favourite exercises:

```
POST /content/{id}/favorite/
Authorization: Bearer ACCESS_TOKEN
```

This helps build:

* personalised dashboards
* favourites screens
* quick access lists

***

### **4. Track Content Progress**

If an exercise is multi-step or multi-part, your app can track how much the user completes.

Example:

```
POST /content/{id}/progress/
```

Typical use cases:

* update step number
* mark complete
* show partially completed exercises

This enables “Continue where you left off” flows.

***

### **5. Render Content in Your UI**

Most developers present content in one of these ways:

#### **Card List**

* featured exercises
* categories
* recommendations

#### **Full Exercise Page**

* title
* description
* exercise steps
* progress controls
* audio player
* transcript

#### **Bottom Sheet or Modal**

Short tools such as grounding exercises.

#### **Audio-First View**

For meditations or guided practices.

#### **Chat-Linked Content**

Show recommended content after an AI therapy response.

***

### **6. Pairing Content with Other Features**

Content works best when paired with:

#### **AI Therapy**

Suggest relevant exercises after certain messages (e.g., anxiety → grounding tool).

#### **Mood Tracking**

Recommend exercises based on mood trends or low check-ins.

#### **Daily Tasks**

Use content exercises as part of daily wellbeing routines.

#### **Crisis Buddy**

Offer grounding exercises when the user is distressed.

***

### **Minimum Viable Content Integration**

1. Fetch list → `/content/`
2. Fetch details → `/content/{id}/`
3. Display exercises in your UI
4. (Optional) Track favourites and progress

This is enough to ship content support in your application.
