Workspace API

Biblioteka mediów

Endpointy „Biblioteka mediów” Zanfia Workspace API — ze schematami i przykładami kodu.

6 min czytaniaOstatnia aktualizacja: 26 lip 2026

Wgrywaj pliki i wideo do lekcji oraz stron. Wideo jest transkodowane po wgraniu — odpytuj element media, aż uploadStatus będzie ready. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.

Lista mediów

GET/media

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Query Parameters

folder?string

Response Body

application/json

application/json

curl -X GET "https://example.com/media"
{  "count": 0,  "media": [    {      "id": "string",      "name": "string",      "type": "string",      "mimeType": "string",      "size": 0,      "url": "string",      "folder": "string",      "uploadStatus": "string",      "createdAt": "string"    }  ]}
{  "error": "string"}

Prześlij plik

POST/media

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/media" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "mimeType": "string",    "data": "string"  }'
{  "mediaId": "string",  "url": "string",  "storagePath": "string"}
{  "error": "string"}

Rozpocznij przesyłanie wideo

POST/media/videos/initiate-upload

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Begin a Bunny video upload: provisions a Bunny video object + a Pending MediaDocument, and returns a signed TUS credential. The caller then uploads the bytes DIRECTLY to Bunny (the file never passes through the API), and polls GET /media/:mediaId until uploadStatus is ready (Bunny finalizes via webhook).

Response Body

application/json

application/json

curl -X POST "https://example.com/media/videos/initiate-upload" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "sourceSizeBytes": 0  }'
{  "mediaId": "string",  "bunnyVideoId": "string",  "bunnyLibraryId": "string",  "signature": "string",  "expire": 0}
{  "error": "string"}

Przenieś media do folderu

POST/media/move

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Files the items into folder (by NAME); folder: null unfiles them.

Response Body

application/json

application/json

curl -X POST "https://example.com/media/move" \  -H "Content-Type: application/json" \  -d '{    "mediaIds": [      "string"    ],    "folder": "string"  }'
{  "updatedCount": 0}
{  "error": "string"}

Szczegóły pliku

GET/media/{mediaId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

mediaId*string

Media id

Response Body

application/json

application/json

curl -X GET "https://example.com/media/string"
{  "media": {    "id": "string",    "name": "string",    "type": "string",    "mimeType": "string",    "size": 0,    "url": "string",    "folder": "string",    "uploadStatus": "string",    "createdAt": "string"  }}
{  "error": "string"}

Edytuj szczegóły pliku

PATCH/media/{mediaId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

mediaId*string

Media id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/media/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "mediaId": "string",  "updated": true}
{  "error": "string"}

Usuń plik z mediów

DELETE/media/{mediaId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

mediaId*string

Media id

Response Body

application/json

application/json

curl -X DELETE "https://example.com/media/string"
{  "status": "ok"}
{  "error": "string"}

Transkrypcja wideo

GET/media/{mediaId}/transcript

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

mediaId*string

Media id

Query Parameters

includeWords?boolean

true includes word-level timings (large payload).

Response Body

application/json

application/json

curl -X GET "https://example.com/media/string/transcript"
{  "transcription": {    "text": "string",    "language": "string",    "createdAt": "string",    "updatedAt": "string",    "words": [      {        "word": "string",        "start": 0,        "end": 0      }    ]  }}
{  "error": "string"}

Lista folderów

GET/media-folders

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/media-folders"
{  "count": 0,  "folders": [    {      "id": "string",      "name": "string"    }  ]}
{  "error": "string"}

Utwórz folder

POST/media-folders

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/media-folders" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "folder": {    "id": "string",    "name": "string"  }}
{  "error": "string"}

Zmień nazwę folderu

PATCH/media-folders/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

name*string

Folder name

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Renaming onto an existing folder MERGES into it (the old folder is removed).

Response Body

application/json

application/json

curl -X PATCH "https://example.com/media-folders/string" \  -H "Content-Type: application/json" \  -d '{    "newName": "string"  }'
{  "folder": {    "id": "string",    "name": "string"  },  "updatedItemCount": 0}
{  "error": "string"}

Usuń folder

DELETE/media-folders/{name}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

name*string

Folder name

Response Body

application/json

application/json

curl -X DELETE "https://example.com/media-folders/string"
{  "docDeleted": true,  "unfiledItemCount": 0}
{  "error": "string"}

Czy ten artykuł był pomocny?

Powiązane artykuły

Coś się nie zgadza? Napisz do nas na support@zanfia.com.