Skip to content

Add to the creative library

POST
/api/v1/ads/assets
curl --request POST \
--url https://digize.com/api/v1/ads/assets \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "kind": "image", "name": "example", "imageId": "example", "fileKey": "example", "contentType": "example", "bytes": 1, "width": 1, "height": 1, "seconds": 1, "sound": true }'

Keeps an uploaded image or video in the creative library, once its upload has finished.

Needs the ads:write permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
kind
required
string
Allowed values: image video
name
required
string
>= 1 characters <= 120 characters
imageId
Any of:
string
<= 200 characters
fileKey
Any of:
string
<= 200 characters
contentType
required
string
<= 100 characters
bytes
required
integer
<= 9007199254740991
width
Any of:
integer
>= 1 <= 9007199254740991
height
Any of:
integer
>= 1 <= 9007199254740991
seconds
Any of:
integer
<= 9007199254740991
sound
boolean

Done

Media typeapplication/json
object
id
required
string
media
required
object
kind
required
string
Allowed values: image video
name
required
string
<= 120 characters
tone
required
string
Allowed values: primary accent secondary success warning info destructive
seconds
required
number | null
sound
required
boolean
assetId
Any of:
string
<= 64 characters
thumbnail
Any of:
string
<= 2000 characters
addedAt
required
string format: date-time
contentType
required
string
bytes
required
number
width
required
number | null
height
required
number | null

Example

{
"media": {
"kind": "image",
"tone": "primary"
}
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}