Add a file to the media library from a public URL

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/ref-media-importurl"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/ad9abaf3-e851-4c44-9076-40bb3fa52c4e/social-card.svg?v=3e7ae33eec8b" alt="Add a file to the media library from a public URL" width="600" height="315"></a>
POST http://localhost:4000/api/v1/media/import

The answer's id goes into a post part's mediaIds. To send the bytes yourself, POST multipart/form-data with one file to /media/upload on the API's origin (same bearer, media:write).

Request body

application/json
url
string
required
clientId
string
folderId
string
credit
string
sourceUrl
string
alt
string
note
string
{
  "url": "string",
  "clientId": "string",
  "folderId": "string",
  "credit": "string",
  "sourceUrl": "string",
  "alt": "string",
  "note": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/media/import" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"string","clientId":"string","folderId":"string","credit":"string","sourceUrl":"string","alt":"string","note":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{
  "id": "string",
  "organizationId": "string",
  "name": "string",
  "mime": "string",
  "size": 0,
  "alt": "string",
  "width": 0,
  "height": 0,
  "durationMs": 0,
  "frames": 0,
  "clientId": "string",
  "createdAt": "2024-01-01T00:00:00Z",
  "url": "string",
  "thumbnailUrl": "string"
}
Schema
id
string
required
organizationId
string
required
name
string
required
mime
string
required
size
number
required
alt
string
required
width
number
required
height
number
required
durationMs
number
required
frames
number
required
clientId
string
required
createdAt
string
required
url
string
required
thumbnailUrl
string
required
Updated