Skip to main content

Limits

Fair usage
Link copied!

​The Amplience GraphQL Asset Management API is intended for backend applications and should not be used in production web applications.

Rate limits
Link copied!

The GraphQL Asset Management API is rate limited. The limits are: 60 requests per minute.

Requests to the API are tracked against the API keys assigned to your media hub.

Amplience reserves the right to modify rate limit. We will only do this to help guarantee service availability to all our customers.

Mutation limits
Link copied!

MutationLimit
deleteAssetsA maximum of 200 asset ids can be deleted in a single mutation.
unpublishAssetsA maximum of 200 asset ids can be unpublished in a single mutation.
publishAssetsA maximum of 200 asset ids can be published in a single mutation.
assets queryA maximum of 1000 asset ids can be passed through a single asset query.

Complexity limits
Link copied!

Amplience will apply a complexity limit to all requests made to the GraphQL Asset Management API. This used along side a rate limit to help guarantee service availability to all our customers.

What is the complexity limit?
Link copied!

A complexity limit of 10000 points is applied per request.

If the complexity limit is exceeded, the response will have the HTTP status code 400, and the following error will be returned:

{
"errors": [
{
"message": "Complexity limit exceeded",
"extensions": {
"code": "COMPLEXITY_LIMIT_EXCEEDED"
}
}
]
}

Amplience reserves the right to modify the complexity limit. We will only do this to help guarantee service availability to all our customers.

What is a complexity score and how is it calculated?
Link copied!

A complexity score is a way of calculating cost per query or mutation. The score is then applied for the whole request (since a request can contain multiple queries).

The rules used are described below:

RuleScoreNotes
Single node query1 point
Multiple node query1 point per requested nodeFor queries that support pagination, the first or last argument determines the number of requested nodes. For queries that accept an array of ids, the number of ids determines the number of requested nodes, for example for the assets query the length of the assetId array is used.
Connected node queries1 point per requested node across the whole graphThe number of requested nodes for a given connection is calculated by multiplying it’s score (according to the above rules) by each of it's parent connections' scores. The total score for the request is the sum of these scores.
Mutation2000 points5 mutations can be made per request.
Scalars and enums0 points
Objects and fields0 points

Amplience reserves the right to modify the complexity scoring rules. We will only do this to help guarantee service availability to all our customers.

Examples
Link copied!

All of the following examples would be under the complexity limit of 10000 points.

Single node query
Link copied!

A node query for a single asset has a score of 1 point.

node(id: "..."): 1 point

{
node(id: "QXNzZXQ6ZmZmZjIwZTktOTljMC00NTM1LWEzZDItNjE1ZDBmBHUY8aek") {
id
... on Asset {
id
name
createdDate
}
}
}

Multiple node query with pagination
Link copied!

The following assetSearch query requests a maximum of 100 nodes, so this is used for the score.

assetSearch(... first: 100): 100 points

{
assetSearch(keyword: "red* OR green*", first: 100) {
edges {
node {
id
name
createdDate
}
}
}
}

Query for multiple nodes by id
Link copied!

The following assets query requests 4 assets by id so the score is 4 points.

assetId.length = 4 points

query {
assets(
assetId: [
"ffda4b98-3baf-4a13-ab6c-ced47d80c3d8"
"ffb911bc-7299-4f33-a397-a0b5088f7f3e"
"f98153b6-90d5-4258-9c56-2ed5ef49badf"
"ffff20e9-99c0-4535-a3d2-615d0fe54b5b"
]
) {
edges {
node {
id
name
createdDate
}
}
}
}

Connected node queries
Link copied!

The following connected node query requests a maximum of 10 assetRepositories and for each assetRepository a maximum of 20 assetFolders. For each connection in this query the potential number of requested nodes is calculated, then the sum of all connections is used for the total score.

viewer: 1 point

mediaHubs: (1 x 1) = 1 point

assetRepositories(first: 10): (10 x 1 x 1) = 10 points

assetFolders(first: 20): (20 x 10 x 1 x 1) = 200 points

Total score: 200 + 10 + 1 + 1 = 211 points

{
viewer {
mediaHubs {
edges {
node {
assetRepositories(first: 10) {
edges {
node {
id
label
assetFolders(first: 20) {
edges {
node {
id
label
}
}
}
}
}
}
}
}
}
}
}

Mutation
Link copied!

All mutations have a score of 2000 points.

updateAsset mutation: 2000 points

mutation {
updateAsset(
input: {
id: "QXNzZXQ6ZmZmZjIwZTktOTljMC00NTM1LWEzZDItNjE1ZDBmBHUY8aek"
name: "XS_Blue_Bag"
tags: ["blue", "bag"]
}
) {
id
}
}