Import Image From URL
POST
/api/v1/workspaces/{workspace_id}/image_imports
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/image_imports';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://cdn.example.com/assets/cat.jpg","name":"My Image"}'};
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://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/image_imports \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://cdn.example.com/assets/cat.jpg", "name": "My Image" }'Downloads an image from a publicly accessible URL and adds it to the image library.
The URL must be reachable from the public internet over https, without authentication. Supported types are JPEG, PNG, GIF and WebP, up to 5MB.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”workspace_id
required
integer
Workspace ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
url
required
The publicly accessible URL of the image to import.
string
Example
https://cdn.example.com/assets/cat.jpgname
The name of the image in the library. Defaults to the filename in the URL.
string
Example
My ImageResponses
Section titled “ Responses ”Successful
Media typeapplication/json
object
id
required
string
name
required
string
filename
required
string
width
required
integer
height
required
integer
file_size
required
integer
created_at
required
string format: date-time
updated_at
required
string format: date-time
organization_id
required
integer
public_url
required
string
description
required
string | null
extension
required
string
archived
required
boolean
Example
{ "id": "bd1c1b82-1a7b-4f0f-b079-30c1d4189bed", "name": "My Image", "filename": "image.png", "width": 100, "height": 100, "file_size": 1000, "created_at": "2023-08-23T10:30:00.000Z", "updated_at": "2023-08-23T10:30:00.000Z", "organization_id": 12345, "public_url": "https://www.example.com/image.png", "description": "A beautiful image of a cat", "extension": "png", "archived": false}Unauthorized
Media typeapplication/json
object
message
required
string
code
string
Example
{ "message": "Record not found", "code": "share_link_expired"}Forbidden
Media typeapplication/json
object
message
required
string
code
string
Example
{ "message": "Record not found", "code": "share_link_expired"}Not Found
Media typeapplication/json
object
message
required
string
code
string
Example
{ "message": "Record not found", "code": "share_link_expired"}Unprocessable Entity
Media typeapplication/json
object
message
required
string
errors
required
object
key
additional properties
Array<string>
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}