# Repository

This file outlines the Flashback API's repository management features, including creating, updating, listing, and monitoring repositories that group multiple storage buckets. Repositories can operate in MIRROR or BACKUP mode and support cloud providers like AWS, GCS, Azure, and S3/GCS-compatible services.

{% hint style="info" %}
To perform this operation, you must be authenticated by means of one of the following methods: [BearerAuth](https://docs.flashback.tech/support-reference/platform-api-reference/..#http-bearer-authentication).
{% endhint %}

## TypeScript Client Quick Links

```typescript
import { FlashbackClient } from '@flashback/client';
const client = new FlashbackClient({ accessToken: 'your-access-token' });

// List repositories
await client.repos.list();

// Create repository
await client.repos.create({ /* repo config */ });

// Update repository
await client.repos.update('repo-id', { /* updates */ });

// Get repository stats
await client.repos.getStats({ repoIds: ['repo-id'] });
```

## Repository API Calls <a href="#flashback-api-buckets" id="flashback-api-buckets"></a>

| Method                                                      | API Reference                                                                                                                      | Description                                                                        |
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| <mark style="color:green;">`GET`</mark> `/repo`             | [**get\_\_repo**](https://docs.flashback.tech/support-reference/platform-api-reference/repo-management/get__repo)                  | Retrieve all repositories for the authenticated user's organization.               |
| <mark style="color:green;">`GET`</mark>`/repo/stats`        | [**get\_\_repo\_stats**](https://docs.flashback.tech/support-reference/platform-api-reference/repo-management/get__repo_stats)     | Fetch usage and performance statistics for one or more repositories.               |
| <mark style="color:orange;">`POST`</mark>`/repo`            | [**post\_\_repo**](https://docs.flashback.tech/support-reference/platform-api-reference/repo-management/post__repo)                | Create a new storage repository linking multiple buckets in MIRROR or BACKUP mode. |
| <mark style="color:purple;">`PUT`</mark>` ``/repo/{repoId}` | [**put\_\_repo\_{repoId}**](https://docs.flashback.tech/support-reference/platform-api-reference/repo-management/put__repo_repoid) | Update an existing repository’s configuration including its bucket layout.         |
| <mark style="color:red;">`DELETE`</mark>`/repo/{id}`        | [**delete\_\_repo\_{Id}**](https://docs.flashback.tech/support-reference/platform-api-reference/repo-management/delete__repo)      | Delete a storage repository (hard delete for Web3 users, soft delete for others).  |


---

# 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.flashback.tech/support-reference/platform-api-reference/repo-management.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.
