Skip to content

Create an upload slot in the account library. contentType must be image/png, image/jpeg, image/gif, or image/webp. PUT the file to the returned uploadUrl with that Content-Type, then use the returned url in emails and the editor.

POST
/library/{useCase}
curl --request POST \
--url https://api.pingram.io/library/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "filename": "example", "contentType": "example" }'

Authorizations

Parameters

Path Parameters

useCase
required
string

Library use-case

Request Bodyrequired

Media typeapplication/json
object
filename
required

Original filename, including extension (e.g. hero.png).

string
contentType
required

Image MIME type. One of image/png, image/jpeg, image/gif, or image/webp.

string
Examplegenerated
{
"filename": "example",
"contentType": "example"
}

Responses

200

Successful response

Media typeapplication/json
object
id
required
string
useCase
required
string
Allowed values: media logos
filename
required
string
key
required
string
url
required

Public URL to use in emails after the file is uploaded to uploadUrl.

string
uploadUrl
required

Time-limited upload URL. PUT the file bytes with the same Content-Type.

string
contentType
required
string
Example
{
"useCase": "media"
}

400

Bad Request - validation errors, invalid input

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

401

Unauthorized

402

Payment Required - usage limits exceeded

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

500

Internal Server Error

502

Bad Gateway - provider error

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}