Import uploads from a link
Imports media from a link (YouTube, a cloud drive, a direct file URL…): one upload per selection, downloaded in the background; answers 202 with the new uploads. Each selection names an assetId and a qualityId from discovery, which this REST API does not offer: ask GraphQL (POST https://api.streamloop.app/graphql, the same X-API-Key) with query { externalLinkContents(url: "<link>") { provider items { id name durationSeconds qualities { id label height } } } } — an item’s id is the assetId, a quality’s id the qualityId — or use the MCP tool discover_external_media. Then poll GET /uploads/: externalSource.state.status goes PENDING, RESOLVING, DOWNLOADING, UPLOADING, then COMPLETED (uploaded true) or FAILED (state.error says why). The Location header is the first upload’s; the body has every id.
Authorizations
OAuth 2.1 authorization-code flow with PKCE.
Headers
Workspace this request operates in — the workspace id (wksp_…) or the organization id, from GET /workspaces. Required with an API key, which carries no workspace (400 WORKSPACE_REQUIRED without it). With an OAuth token it defaults to the workspace the token was issued for. Responds 403 WORKSPACE_FORBIDDEN when the caller is not a current member, rather than falling back to another workspace.
Optional client-generated key. A repeated request with the same key, method and path (by the same caller in the same workspace) replays the original response, with Idempotency-Replayed: true, for 24 hours instead of running again — safe retries. The same key with a different body is refused with 422 IDEMPOTENCY_KEY_REUSED (nothing runs): use a new key for each new request. A 5xx answer is not remembered (a retry runs).
Response
Accepted — the work goes on in the background; the body has its ids and Location is where to poll for the result.
audio, video, image