Skip to content

Cut an area of a PDF's page into an asset

POST
/api/v1/assets/{id}/cut
curl --request POST \
--url http://localhost:3000/api/v1/assets/example/cut \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "page": 1, "box": [ "example" ], "filename": "example", "collections": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "tags": [ "example" ] }'

A logo or a figure drawn in a brand book, as an asset of its own: what is mostly inside box (fractions of the page) comes out as an SVG of its vectors, the page’s background and neighbours left out, or as a PNG when nothing there is drawn as vectors. Its parent is the PDF. The same bytes as an asset already here dedupe.

Scope: propose.

id
required
string

A PDF asset’s id

Media typeapplication/json
object
page
required

The page, from 1

integer
>= 1 <= 10000
box
required

The area as fractions of the page: left, top, right, bottom, from its top-left corner. What is mostly inside it is cut

array
>= 4 items <= 4 items
filename

The new asset’s name; its extension is the cut’s (svg, or png)

string
>= 1 characters <= 200 characters
collections
Array<string>
<= 50 items
tags
Array<string>
<= 100 items
Examplegenerated
{
"page": 1,
"box": [
"example"
],
"filename": "example",
"collections": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
],
"tags": [
"example"
]
}

The new asset

Media typeapplication/json
object
data
required
object
id
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
projectId
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
sha256
required
string
filename
required
string
mime
required
string
size
required
integer
>= -9007199254740991 <= 9007199254740991
width
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
height
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
probe
required
Any of:
object
key
additional properties
metadata
required
Any of:
object
title
string
description
string
keywords
Array<string>
creator
string
copyright
string
capturedAt
string
camera
string
lens
string
gps
object
lat
required
number
lon
required
number
focus

The point crops keep in frame, 0 to 1 from the top left

object
x
required
number
y
required
number
tags
required
Array<string>
fields
required

The asset’s own values

object
key
additional properties
string | number | boolean
inherited
required

Values inherited from its collections; own values win

object
key
additional properties
string | number | boolean
status
required

Draft, proposed (in review), active (approved), archived or rejected

string
Allowed values: draft proposed active archived rejected
state
required

The status; expired for an approved asset past its last day of use; deleted, until restored or purged

string
Allowed values: draft proposed active expired archived rejected deleted
deletedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
stackId
required
Any of:
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
version
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
current
required

Its stack’s current approved version: the others are superseded by it

boolean
proposedBy
required

For a proposal: who made it, a person’s or an API key’s name

string | null
reviewNote
required

Why a person rejected it

string | null
proposedTags
required
Array<string>
proposedFields
required

Custom field values an agent suggested, waiting for a person to accept or dismiss

object
key
additional properties
string | number | boolean
working
required
Any of:
object
label
required
string
by
required

The agent’s name

string
until
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
rights
required
Any of:
object
license
required
string | null
territories
required

ISO 3166-1 alpha-2; empty: anywhere

Array<string>
channels
required

Empty: any use

Array<string>
embargo
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
expires
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
modelRelease
required
Any of:
string
Allowed values: released missing not-needed
downloadable

Set by a person; null or missing follows the license (see downloadable on its description)

boolean | null
origin
required
Any of:
string
Allowed values: shot licensed generated
parentAssetId
required
Any of:
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
generator
required
string | null
prompt
required
string | null
c2pa
required
Any of:
object
manifests
required
integer
>= -9007199254740991 <= 9007199254740991
generator
required

The app that signed it

string | null
title
required
string | null
signedBy
required

The signing certificate’s organization, as the file claims it; not verified

string | null
actions
required
Array<string>
digitalSourceType
required

IPTC: digitalCapture, trainedAlgorithmicMedia…

string | null
softwareAgent
required

The tool the actions name, often the model

string | null
ingredients
required
integer
>= -9007199254740991 <= 9007199254740991
via
required
Any of:
string
Allowed values: agent import
supersededBy
required
Any of:
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
private
required

Its own flag; it is private too when every collection it is in is

boolean
public
required

Served at /a/{id} to anyone while it may be used; otherwise to people who can see it, and signed URLs

boolean
collections
required
Array<string>
createdAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
updatedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
Example
{
"data": {
"status": "draft",
"state": "draft",
"rights": {
"modelRelease": "released"
},
"origin": "shot",
"via": "agent"
}
}

An error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"detail": "example"
}
}