Import an image or document from a public https URL
POST
/media/import
const url = 'https://api.motenya.app/v1/media/import';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com","filename":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.motenya.app/v1/media/import \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com", "filename": "example" }'Requires articles:write. Same limits as an upload. Useful when moving content from another help center.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
url
required
A public https URL.
string format: uri
filename
Defaults to the last segment of the URL.
string
Example generated
{ "url": "https://example.com", "filename": "example"}Responses
Section titled “Responses”Stored
Media typeapplication/json
object
id
required
string
url
required
Public URL to reference in Markdown.
string
filename
required
string
contentType
required
string
size
required
integer
Example generated
{ "id": "example", "url": "example", "filename": "example", "contentType": "example", "size": 1}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing, invalid, revoked or expired API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Missing scope, API turned off, published article without publish scope, or account suspended
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Not found, or outside the knowledge bases this key may use
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Slug or translation already exists
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Rejected by validation (e.g. unknown language or category)
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Rate limited; see Retry-After
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
field
string
details
Array<object>
object
code
required
string
message
required
string
field
string
Example
{ "error": { "code": "SLUG_TAKEN" }}Internal error