> For the complete documentation index, see [llms.txt](https://docs.flashback.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flashback.tech/support-reference/platform-api-reference/repo-management/get__repo.md).

# get\_\_repo

`GET /repo`

*List Repositories*

Get all repositories for the authenticated user's organization

#### Parameters

| Name        | In    | Type   | Required | Description                                                                                                                                                  |
| ----------- | ----- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| workspaceId | query | string | false    | Optional workspace ID to filter repositories. If not provided, returns all repositories the user has access to based on their role and workspace membership. |

#### TypeScript Client Library

```typescript
public getStorageRepos = async (workspaceId?: string): Promise<GetReposResponse> => {
  const queryParams = workspaceId ? `?workspaceId=${workspaceId}` : '';
  return this.makeRequest<GetReposResponse>(`repo${queryParams}`, 'GET', null);
};
```

#### Code Samples

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

```shell
# You can also use wget
curl -X GET https://backend.flashback.tech/repo \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

# With workspaceId parameter
curl -X GET 'https://backend.flashback.tech/repo?workspaceId=workspace-123' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'
```

{% endtab %}

{% tab title="HTTP" %}

```http
GET https://backend.flashback.tech/repo HTTP/1.1
Host: localhost:3000
Accept: application/json

# With workspaceId parameter
GET https://backend.flashback.tech/repo?workspaceId=workspace-123 HTTP/1.1
Host: localhost:3000
Accept: application/json
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

// Without workspaceId
fetch('https://backend.flashback.tech/repo',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

// With workspaceId
const workspaceId = 'workspace-123';
fetch(`https://backend.flashback.tech/repo?workspaceId=${workspaceId}`,
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://backend.flashback.tech/repo',
  params: {
  }, headers: headers

p JSON.parse(result)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://backend.flashback.tech/repo', headers = headers)

print(r.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://backend.flashback.tech/repo', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
```

{% endtab %}

{% tab title="Java" %}

```java
URL obj = new URL("https://backend.flashback.tech/repo");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://backend.flashback.tech/repo", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
```

{% endtab %}
{% endtabs %}

> Example responses

> 200 Response

```json
{
  "success": true,
  "repos": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "My Backup Repository",
      "storageType": "S3",
      "mode": "MIRROR",
      "workspaceId": "workspace-123",
      "buckets": [
        {
          "folder": "backups",
          "master": true,
          "bucketId": "123e4567-e89b-12d3-a456-426614174000",
          "bucket": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "name": "My Backup Bucket",
            "bucket": "my-backup-bucket-2024",
            "storageType": "S3",
            "key": "AKIAIOSFODNN7EXAMPLE",
            "secret": {
              "key": "encrypted-secret-key",
              "iv": "initialization-vector",
              "authTag": "authentication-tag",
              "message": "encrypted-message"
            },
            "endpoint": "https://s3.amazonaws.com",
            "region": "us-east-1",
            "status": "ACTIVE",
            "projectId": "my-project-123",
            "createdAt": "2024-01-15T09:00:00Z"
          }
        }
      ],
      "apiKeys": [
        {
          "id": "789e0123-e45b-67d8-a901-234567890000",
          "name": "Read-only key for analytics",
          "accessType": "READ",
          "key": "AKIAIOSFODNN7EXAMPLE",
          "secret": {
            "key": "encrypted-secret-key",
            "iv": "initialization-vector",
            "authTag": "authentication-tag",
            "message": "encrypted-message"
          },
          "createdAt": "2024-01-15T10:30:00Z"
        }
      ],
      "aiLlms": [
        {
          "aiLlmId": "ai-llm-123",
          "aiLlm": {
            "id": "ai-llm-123",
            "orgId": "org-123",
            "workspaceId": "workspace-123",
            "userId": "user-123",
            "name": "OpenAI GPT-4",
            "aiType": "OPENAI",
            "endpoint": "https://api.openai.com/v1",
            "key": "sk-...",
            "createdAt": "2024-01-15T09:00:00Z"
          }
        }
      ],
      "aiApiKeys": [
        {
          "id": "ai-api-key-123",
          "name": "AI API Key for Repo",
          "repoId": "550e8400-e29b-41d4-a716-446655440000",
          "key": "ak-...",
          "aiType": "OPENAI",
          "createdAt": "2024-01-15T10:30:00Z",
          "deletedAt": null
        }
      ],
      "createdAt": "2024-01-15T10:00:00Z",
      "disabled": false
    }
  ]
}
```

#### Responses <a href="#get__repo-responses" id="get__repo-responses"></a>

| Status | Meaning                                                 | Description          | Schema |
| ------ | ------------------------------------------------------- | -------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | List of repositories | Inline |

#### Response Schema <a href="#get__repo-responseschema" id="get__repo-responseschema"></a>

Status Code **200**

| Name             | Type              | Required | Restrictions | Description                                              |
| ---------------- | ----------------- | -------- | ------------ | -------------------------------------------------------- |
| » success        | boolean           | false    | none         | Indicates if the request was successful                  |
| » repos          | \[object]         | false    | none         | Array of storage repositories with buckets               |
| »» id            | string            | false    | none         | Unique identifier for the repository                     |
| »» name          | string            | false    | none         | Human-readable name for the repository                   |
| »» storageType   | string            | false    | none         | Storage provider type (S3, GCS, AZURE)                   |
| »» mode          | string            | false    | none         | Repository mode (MIRROR, BACKUP)                         |
| »» workspaceId   | string            | false    | none         | Workspace ID for the repository                          |
| »» buckets       | \[object]         | false    | none         | Array of bucket information in the repository            |
| »»» folder       | string            | false    | none         | Folder path within the bucket                            |
| »»» master       | boolean           | false    | none         | Whether this is the master bucket                        |
| »»» bucketId     | string            | false    | none         | Unique identifier for the bucket                         |
| »»» bucket       | object            | false    | none         | Storage bucket details                                   |
| »»»» id          | string            | false    | none         | Unique identifier for the bucket                         |
| »»»» name        | string            | false    | none         | Human-readable name for the bucket                       |
| »»»» bucket      | string            | false    | none         | Actual bucket name in cloud storage                      |
| »»»» storageType | string            | false    | none         | Storage provider type (S3, GCS, AZURE)                   |
| »»»» key         | string            | false    | none         | Access key for the storage provider                      |
| »»»» secret      | object            | false    | none         | Encrypted secret key information                         |
| »»»»» key        | string            | false    | none         | Encrypted key data                                       |
| »»»»» iv         | string            | false    | none         | Initialization vector                                    |
| »»»»» authTag    | string            | false    | none         | Authentication tag                                       |
| »»»»» message    | string            | false    | none         | Encrypted message                                        |
| »»»» endpoint    | string            | false    | none         | Custom endpoint URL                                      |
| »»»» region      | string            | false    | none         | Storage region                                           |
| »»»» status      | string            | false    | none         | Bucket status                                            |
| »»»» projectId   | string            | false    | none         | Project identifier (for GCS)                             |
| »»»» createdAt   | string(date-time) | false    | none         | Creation timestamp for the bucket                        |
| »» apiKeys       | \[object]         | false    | none         | Array of API keys for the repository                     |
| »»» id           | string            | false    | none         | Unique identifier for the API key                        |
| »»» name         | string            | false    | none         | Human-readable name for the API key                      |
| »»» accessType   | string            | false    | none         | Access type (READ, WRITE, ADMIN)                         |
| »»» key          | string            | false    | none         | API key identifier                                       |
| »»» secret       | object            | false    | none         | Encrypted secret key information                         |
| »»»» key         | string            | false    | none         | Encrypted key data                                       |
| »»»» iv          | string            | false    | none         | Initialization vector                                    |
| »»»» authTag     | string            | false    | none         | Authentication tag                                       |
| »»»» message     | string            | false    | none         | Encrypted message                                        |
| »»» createdAt    | string(date-time) | false    | none         | Creation timestamp for the API key                       |
| »» aiLlms        | \[object]         | false    | none         | Array of AI LLM associations for the repository          |
| »»» aiLlmId      | string            | false    | none         | Unique identifier for the AI LLM association             |
| »»» aiLlm        | object            | false    | none         | AI LLM details                                           |
| »»»» id          | string            | false    | none         | Unique identifier for the AI LLM                         |
| »»»» orgId       | string            | false    | none         | Organization ID                                          |
| »»»» workspaceId | string            | false    | none         | Workspace ID                                             |
| »»»» userId      | string            | false    | none         | User ID who created the AI LLM                           |
| »»»» name        | string            | false    | none         | Human-readable name for the AI LLM                       |
| »»»» aiType      | string            | false    | none         | AI provider type (OPENAI, GOOGLE, ANTHROPIC, AWS, OTHER) |
| »»»» endpoint    | string            | false    | none         | API endpoint URL for the AI LLM                          |
| »»»» key         | string            | false    | none         | API key for the AI LLM (may be null)                     |
| »»»» createdAt   | string(date-time) | false    | none         | Creation timestamp for the AI LLM                        |
| »» aiApiKeys     | \[object]         | false    | none         | Array of AI API keys for the repository                  |
| »»» id           | string            | false    | none         | Unique identifier for the AI API key                     |
| »»» name         | string            | false    | none         | Human-readable name for the AI API key                   |
| »»» repoId       | string            | false    | none         | Repository ID this key belongs to                        |
| »»» key          | string            | false    | none         | AI API key identifier (may be null)                      |
| »»» aiType       | string            | false    | none         | AI provider type (OPENAI, GOOGLE, ANTHROPIC, AWS, OTHER) |
| »»» createdAt    | string(date-time) | false    | none         | Creation timestamp for the AI API key                    |
| »»» deletedAt    | string(date-time) | false    | none         | Deletion timestamp (null if not deleted)                 |
| »» createdAt     | string(date-time) | false    | none         | Creation timestamp for the repository                    |
| »» disabled      | boolean           | false    | none         | Whether the repository is disabled                       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.flashback.tech/support-reference/platform-api-reference/repo-management/get__repo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
