curl --request GET \
--url https://polza.ai/api/v1/storage/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://polza.ai/api/v1/storage/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://polza.ai/api/v1/storage/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://polza.ai/api/v1/storage/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://polza.ai/api/v1/storage/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://polza.ai/api/v1/storage/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://polza.ai/api/v1/storage/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "file_123abc",
"fileType": "IMAGE",
"mimeType": "image/jpeg",
"source": "USER_UPLOAD",
"storagePolicy": "TEMP_UPLOAD",
"url": "https://s3.polza.ai/f/211837/2026/01/t_c2446f3cf93ac9f5.png",
"size": 154832,
"createdAt": "2025-01-03T12:00:00.000Z",
"updatedAt": "2025-01-03T12:00:00.000Z",
"externalUserId": "external_user_456",
"expiresAt": "2025-01-03T14:00:00.000Z"
}
]{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Список файлов
Получение списка файлов с фильтрацией и пагинацией
curl --request GET \
--url https://polza.ai/api/v1/storage/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://polza.ai/api/v1/storage/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://polza.ai/api/v1/storage/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://polza.ai/api/v1/storage/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://polza.ai/api/v1/storage/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://polza.ai/api/v1/storage/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://polza.ai/api/v1/storage/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "file_123abc",
"fileType": "IMAGE",
"mimeType": "image/jpeg",
"source": "USER_UPLOAD",
"storagePolicy": "TEMP_UPLOAD",
"url": "https://s3.polza.ai/f/211837/2026/01/t_c2446f3cf93ac9f5.png",
"size": 154832,
"createdAt": "2025-01-03T12:00:00.000Z",
"updatedAt": "2025-01-03T12:00:00.000Z",
"externalUserId": "external_user_456",
"expiresAt": "2025-01-03T14:00:00.000Z"
}
]{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Недопустимое значение параметра",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"details": {},
"metadata": {
"reason": "noProvidersForModel",
"raw": "The parameter `duration` specified in the request is not valid",
"provider_name": "alibaba"
}
},
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Параметры запроса
Пагинация
| Параметр | Тип | По умолчанию | Описание |
|---|---|---|---|
page | integer | 1 | Номер страницы (от 1) |
limit | integer | 20 | Количество записей на странице (1-100) |
Фильтрация
| Параметр | Тип | Описание |
|---|---|---|
fileType | string | Тип файла: IMAGE, VIDEO, AUDIO |
source | string | Источник: USER_UPLOAD, AI_GENERATION |
storagePolicy | string | Политика: TEMP_UPLOAD, TEMP_GENERATION, PERMANENT |
externalUserId | string | ID внешнего пользователя (макс. 128 символов) |
Сортировка
| Параметр | Тип | По умолчанию | Описание |
|---|---|---|---|
sortBy | string | createdAt | Поле: createdAt, size, expiresAt, externalUserId |
sortOrder | string | desc | Направление: asc, desc |
Пример
curl "https://polza.ai/api/v1/storage/files?fileType=IMAGE&page=1&limit=10&sortBy=createdAt&sortOrder=desc" \
-H "Authorization: Bearer YOUR_API_KEY"
Ответ (200)
{
"data": [
{
"id": "file_abc123",
"fileType": "IMAGE",
"mimeType": "image/png",
"source": "USER_UPLOAD",
"storagePolicy": "PERMANENT",
"url": "https://cdn.polza.ai/files/file_abc123.png",
"size": 245760,
"externalUserId": null,
"expiresAt": null,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 42,
"totalPages": 5
}
}
Авторизации
API ключ передаётся в заголовке: Authorization: Bearer <POLZA_AI_API_KEY>
Параметры запроса
Номер страницы (начиная с 1)
1
Лимит записей на странице (1-100)
20
Фильтр по ID внешнего пользователя
"user_123"
Фильтр по типу файла
IMAGE, VIDEO, AUDIO "IMAGE"
Фильтр по источнику файла
USER_UPLOAD, AI_GENERATION "USER_UPLOAD"
Фильтр по политике хранения
TEMP_UPLOAD, TEMP_GENERATION, PERMANENT "TEMP_UPLOAD"
Поле для сортировки
createdAt, size, expiresAt, externalUserId "createdAt"
Порядок сортировки
asc, desc "desc"
Область видимости: all — все файлы организации, mine — только свои, others — только чужие (не текущего пользователя), только для admin/owner
all, mine, others "all"
Ответ
ID файла
"file_123abc"
Тип файла (IMAGE, VIDEO, AUDIO)
"IMAGE"
MIME-тип файла
"image/jpeg"
Источник файла (USER_UPLOAD, AI_GENERATION)
"USER_UPLOAD"
Политика хранения (TEMP_UPLOAD, TEMP_GENERATION, PERMANENT)
"TEMP_UPLOAD"
URL файла
"https://s3.polza.ai/f/211837/2026/01/t_c2446f3cf93ac9f5.png"
Размер файла в байтах
154832
Дата создания
"2025-01-03T12:00:00.000Z"
Дата обновления
"2025-01-03T12:00:00.000Z"
ID внешнего пользователя клиента (для группировки файлов)
"external_user_456"
Дата истечения срока действия файла
"2025-01-03T14:00:00.000Z"
Была ли эта страница полезной?