---
title: "Keep a social video to study"
description: "A public TikTok, Instagram, YouTube, X or Facebook post's video, fetched by a worker into Media as a reference. The same link again returns the same file. Other sites are refused (422 reference_link_unsupported). Needs the `videos:create` permission."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.mosio.me/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Mosio REST API › References

`POST /v1/media/links`

A public TikTok, Instagram, YouTube, X or Facebook post's video, fetched by a worker into Media as a reference. The same link again returns the same file. Other sites are refused (422 reference_link_unsupported). Needs the `videos:create` permission.

## Authentication

- `apiKey`, apiKey, in header, header `x-api-key`

## Request body

_Required._

- `url` (`importReferenceLink.url`; string, required)
  - minLength 1; maxLength 2000

## Example request

```json
{
  "url": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://app.mosio.me/v1/media/links \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "url": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://app.mosio.me/v1/media/links';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'x-api-key': '<x-api-key>'},
  body: JSON.stringify({url: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.mosio.me/v1/media/links"

payload = { "url": "string" }
headers = {
    "Content-Type": "application/json",
    "x-api-key": "<x-api-key>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 202

The reference, pending until fetched.

#### Example

```json
{
  "id": "string",
  "filename": "string",
  "content_type": "string",
  "kind": "image",
  "size_bytes": 0,
  "status": "pending",
  "url": "string",
  "edit": {
    "status": "processing",
    "path": "string",
    "url": "string",
    "poster_url": "string",
    "duration_seconds": 0,
    "width": 0,
    "height": 0,
    "has_audio": true,
    "error": "string"
  },
  "role": "media",
  "source_url": "string",
  "created_at": "string"
}
```

- `id` (`importReferenceLink.response.202.id`; string, required)
- `filename` (`importReferenceLink.response.202.filename`; string, required)
- `content_type` (`importReferenceLink.response.202.content_type`; string, required)
- `kind` (`importReferenceLink.response.202.kind`; string, required)
  - one of `"image"`, `"video"`, `"audio"`
- `size_bytes` (`importReferenceLink.response.202.size_bytes`; number, required)
- `status` (`importReferenceLink.response.202.status`; string, required)
  - one of `"pending"`, `"ready"`
- `url` (`importReferenceLink.response.202.url`; string | null, required)
- `edit` (`importReferenceLink.response.202.edit`; any of, required)
  - any of: `object`, `null`
- `role` (`importReferenceLink.response.202.role`; string, required)
  - one of `"media"`, `"reference"`
- `source_url` (`importReferenceLink.response.202.source_url`; string | null, required)
- `created_at` (`importReferenceLink.response.202.created_at`; string, required)

### 400

The request body is not valid JSON or does not match the schema.

#### Example

```json
{
  "error": "unauthorized",
  "message": "string",
  "details": null
}
```

- `error` (`importReferenceLink.response.400.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`importReferenceLink.response.400.message`; string, required) — A message for people, in Indonesian.
- `details` (`importReferenceLink.response.400.details`; unknown, optional) — More about the error, such as the fields to fix.

### 401

The API key is missing or not valid.

#### Example

```json
{
  "error": "unauthorized",
  "message": "Kirim API key di header x-api-key."
}
```

- `error` (`importReferenceLink.response.401.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`importReferenceLink.response.401.message`; string, required) — A message for people, in Indonesian.
- `details` (`importReferenceLink.response.401.details`; unknown, optional) — More about the error, such as the fields to fix.


Source: https://docs.mosio.me/api/import-reference-link/index.md
