Skip to main content
POST
Request signed upload URL (recommended)

Authorizations

Authorization
string
header
required

Personal Access Token or OAuth2 JWT. Create a PAT at app.layer.ai → Settings → Personal Access Tokens.

Path Parameters

workspace_id
string<uuid>
required

Body

application/json
content_type
string
required

MIME type of the file to upload.

file_size_bytes
integer
required

Expected file size in bytes. Used to enforce upload limits.

file_name
string | null

Optional file name.

source_type
enum<string> | null

Optional source type for the file. Use 'mask' to upload a mask for inpainting/masked-edit, then pass the returned file_id as the mask in a generation request. Mask uploads must be image files.

Available options:
pose,
reference,
mask,
composite,
google_drive,
transformed_reference

Response

Successful Response

file_id
string<uuid>
required

Unique identifier for the file. Use as input to generation endpoints after upload completes.

upload_url
string
required

Signed upload URL. POST to this URL to initiate a resumable upload, then PUT file chunks to the session URI returned in the Location header. Expires in 15 minutes.

content_type
string
required

MIME type to use when uploading.

source_type
enum<string> | null

Source type the file was created with, echoed from the request.

Available options:
pose,
reference,
mask,
composite,
google_drive,
transformed_reference