# Data Retention & Privacy

This guide brings together all the details about TryItOn’s data retention policies, helping you build data-sensitive applications with confidence.

### What TryItOn Stores vs. What We Don't <a href="#what-fashn-stores-vs-what-we-dont" id="what-fashn-stores-vs-what-we-dont"></a>

#### What We Store <a href="#what-we-store" id="what-we-store"></a>

* **Request metadata:** Includes who sent the API request, the input data (request body), and the timestamp of the request.
* **Image URLs:** The URLs provided for `model_image` and `garment_image` are stored as part of the request body.
* **Base64 placeholders:** For base64 inputs, only `<base64>` is stored in the request history—not the actual encoded data.

#### What We Don't Store <a href="#what-we-dont-store" id="what-we-dont-store"></a>

* **Input image files:** Never stored on our servers, regardless of how they’re uploaded.
* **Base64 image data:** The actual base64 strings are never saved.
* **Output images:** Images served through our CDN are automatically deleted after 72 hours.

{% hint style="info" %}
**Privacy Insight**

Storing image URLs does not affect privacy if your URLs are set to expire. While TryItOn keeps the submitted URLs, the images become inaccessible once those URLs expire.
{% endhint %}

### Data Retention Timeline and Purpose <a href="#data-retention-timeline-and-purpose" id="data-retention-timeline-and-purpose"></a>

Image outputs are temporarily stored for up to **72 hours** for the following purposes:

1. **Data Transfer Window:** To provide enough time for you to transfer data to your own storage or handle use cases that don’t need long-term storage.
2. **Support & Troubleshooting:** To allow us to provide effective assistance if any issues are reported with the outputs.
3. **Content Moderation & Abuse Prevention:** To allow us to review content for policy compliance, perform moderation, and investigate potential misuse of the technology.

After 72 hours, image outputs are **automatically deleted** and CDN URLs become inaccessible.

{% hint style="success" %}
**We Never Train on Customer Data**

Your data is never used for training or improving our AI models in any form.
{% endhint %}

### Best Practices for Data-Sensitive Applications <a href="#best-practices-for-data-sensitive-applications" id="best-practices-for-data-sensitive-applications"></a>

Choose the privacy strategy that best fits your application's requirements:

#### URL Expiry Strategy (Recommended) <a href="#url-expiry-strategy-recommended" id="url-expiry-strategy-recommended"></a>

The most effective way to balance privacy and performance is to ensure that stored URLs eventually expire. Although TryItOn keeps URLs in the request history, privacy remains protected once those URLs are no longer accessible.

**Implementation:**

* **Configure URL expiry:** Configure your image hosting so that URLs become inaccessible after the desired time period.
* **Use signed URLs:** Use temporary signed URLs that expire automatically

{% tabs %}
{% tab title="cURL" %}

```json
curl -X POST https://tryiton.now/api/v1/tryon/clothes \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
        "model_image": "https://your-host.com/signed-url?expires=1762137600",
        "garment_image": "https://your-host.com/signed-url?expires=1762137600",
        }'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://tryiton.now/api/v1/tryon/clothes', {
  method: 'POST',
  body: JSON.stringify({
    model_image: "https://your-host.com/signed-url?expires=1762137600",
    garment_image: "https://your-host.com/signed-url?expires=1762137600",
  }),
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  }
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
 
response = requests.post(
    "https://tryiton.now/api/v1/tryon/clothes",
    headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
    json={
        "model_image": "https://your-host.com/signed-url?expires=1762137600",
        "garment_image": "https://your-host.com/signed-url?expires=1762137600",
    }
)
```

{% endtab %}
{% endtabs %}

**Privacy benefits:** URLs become inaccessible after expiry

#### Base64 Strategy (Maximum Privacy) <a href="#base64-strategy-maximum-privacy" id="base64-strategy-maximum-privacy"></a>

For highly sensitive content where storing URLs is not acceptable, only `<base64>` placeholders are shown in the request history and never the actual image data.

{% tabs %}
{% tab title="cURL" %}

```json
curl -X POST https://api.tryiton.now/v1/run \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
           "model_name": "tryon-v1.6",
           "inputs": {
             "model_image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
             "garment_image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
             "return_base64": true,
             "output_format": "png"
           }
         }'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.tryiton.now/v1/run', {
  method: 'POST',
  body: JSON.stringify({
    model_name: "tryon-v1.6",
    inputs: {
      model_image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
      garment_image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
      return_base64: true,
      output_format: "png"
    }
  }),
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  }
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
 
response = requests.post(
    "https://api.tryiton.now/v1/run",
    headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
    json={
        "model_name": "tryon-v1.6",
        "inputs": {
            "model_image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
            "garment_image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...",
            "return_base64": True,
            "output_format": "png"
        }
    }
)
```

{% endtab %}
{% endtabs %}

**Privacy benefits:** No image data is stored on TryItOn’s systems, all data remains entirely within your API request and response cycle.


---

# 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.tryiton.now/api-overview/data-retention-and-privacy.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.
