Clips API for authors

Publish and edit clips from scripts: key, permissions, limits, requests and errors.

The Clips API lets you upload videos from your own scripts and services, set the title, description and cover right away, and change them later.

How to get access

Access is granted manually by the administration — there is no “Request” button. Write to support or to the official “Команда Мрій” community and tell us what you want to publish. An administrator sets your permissions and limits, you get a notification, and an API tab appears in Studio (the Studio button on the Clips page).

The API tab

  • Limits and usage — how many uploads and edits you used today and this month, and what is left.
  • Keys — create a key (up to 5). It is generated in your browser and shown once; the server stores only a fingerprint and can’t recover it. Revoke a lost key and create a new one.
  • Documentation — request examples.

Permissions

Permission Allows
read Read your clips and limits
upload_public Upload clips for everyone
upload_private Upload clips for friends and “only me”
edit Edit title, description, cover, categories and 18+

An administrator may grant only some of them, e.g. uploading to private only.

Requests

Base URL: https://mriyu.com/api/open/v1. Every request carries Authorization: Bearer mk_your_key.

# limits and usage
curl -H "Authorization: Bearer $KEY" https://mriyu.com/api/open/v1/limits

# upload a clip
curl -H "Authorization: Bearer $KEY" https://mriyu.com/api/open/v1/clips \
  -F video=@clip.mp4 -F title="My clip" -F description="Description" \
  -F thumbnail=@cover.jpg -F audience=all -F "categories[]=humor"

# change title and description
curl -X PATCH -H "Authorization: Bearer $KEY" https://mriyu.com/api/open/v1/clips/123 \
  -d title="New title" -d description="New description"
Method and path Purpose
GET /limits Permissions, limits and usage
GET /clips Your clips
GET /clips/{id} One clip
POST /clips Upload (video, title, description, thumbnail, audience: all/friends/me, categories[], adult, comments_disabled)
POST or PATCH /clips/{id} Change fields; the cover (thumbnail) only via POST

Big files: upload straight to storage

Files over 100 MB are not accepted through the site (use_direct_upload): upload them straight to storage so the site never holds them in memory. This works when the new video scheme is switched on.

  1. POST /clips/uploads (JSON or multipart) with filename, size (bytes) and the same title, description, thumbnail, audience, categories[], adult, comments_disabled, publish_at. The response has upload.parts — a link per part (part_size bytes each).
  2. PUT each part to its link (no Authorization header) and keep the ETag response header.
  3. POST /clips/uploads/{id}/complete with {"parts": [{"n": 1, "etag": "…"}, …]}. The clip goes into processing and the “Uploads” limit is counted here.

After an interruption GET /clips/uploads/{id} returns fresh links so you can send the remaining parts. Only one unfinished clip can exist at a time.

Responses

All responses are JSON. Successful ones use 200 (read, edit) or 201 (upload).

GET /limits — permissions, limits and usage:

{
  "status": "active",
  "scopes": ["read", "upload_public", "upload_private", "edit"],
  "limits": {"uploads_per_day": 10, "uploads_per_month": 100, "edits_per_day": 100, "max_file_mb": 200, "requests_per_minute": 30},
  "usage": {
    "today": {"uploads": 2, "edits": 5, "requests": 9, "bytes": 31457280},
    "month": {"uploads": 14, "edits": 40, "requests": 120, "bytes": 450887680},
    "days": [{"day": "2026-11-13", "uploads": 2, "edits": 5, "requests": 9}]
  }
}

POST /clips (201), GET /clips/{id} and POST/PATCH /clips/{id} return one clip:

{
  "clip": {
    "id": 123,
    "url": "https://mriyu.com/clips/123",
    "title": "Мій кліп",
    "description": "Опис #тег",
    "thumbnail": "/uploads/videos/abc.jpg",
    "status": "ready",
    "audience": "all",
    "adult": false,
    "comments_disabled": false,
    "categories": ["humor"],
    "duration": 24,
    "views": 0,
    "publish_at": null,
    "created_at": "2026-11-13T09:15:00+01:00"
  }
}

Після POST /clips у відповіді є ще "limits": витрата за сьогодні.

The status field: ready, queued / processing (still being processed), failed, hidden (hidden by a moderator). GET /clips returns {"clips": [...], "more": true}; get the next page with ?before=<last id>&limit=20 (up to 50). The X-RateLimit-Limit and X-RateLimit-Remaining headers show the per-minute request limit.

Errors

The response is JSON {"error": {"code": "...", "message": "..."}}.

Besides the codes below: validation_failed (422) — invalid fields, error.fields says what exactly; method_not_allowed (405); server_error (500) — an unexpected failure, error.request_id is the number to quote to support. Errors always come as JSON, even without an Accept header.

Code Meaning
invalid_key (401) Key is wrong or revoked
no_access (403) Access is switched off
forbidden_scope (403) Missing permission
rate_limited (429) Too many requests per minute
validation_failed (422) Invalid fields (error.fields)
server_error (500) Server error (error.request_id)
not_found (404) Clip not found
daily_limit, monthly_limit (429) Upload or edit limit used up
file_too_large (413) File exceeds the allowed size
use_direct_upload (413) File over 100 MB: use POST /clips/uploads

Counters reset at midnight server time; monthly ones on the 1st.