Limits
Fair usageLink copied!
The Amplience GraphQL Asset Management API is intended for backend applications and should not be used in production web applications.
Rate limitsLink 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 limitsLink copied!
Mutation | Limit |
---|---|
deleteAssets | A maximum of 200 asset ids can be deleted in a single mutation. |
unpublishAssets | A maximum of 200 asset ids can be unpublished in a single mutation. |
publishAssets | A maximum of 200 asset ids can be published in a single mutation. |
assets query | A maximum of 1000 asset ids can be passed through a single asset query. |
Complexity limitsLink 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:
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:
Rule | Score | Notes |
---|---|---|
Single node query | 1 point | |
Multiple node query | 1 point per requested node | For 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 queries | 1 point per requested node across the whole graph | The 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. |
Mutation | 2000 points | 5 mutations can be made per request. |
Scalars and enums | 0 points | |
Objects and fields | 0 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.
ExamplesLink copied!
All of the following examples would be under the complexity limit of 10000 points.
Single node queryLink copied!
A node query for a single asset has a score of 1 point.
node(id: "..."): 1 point
Multiple node query with paginationLink copied!
The following assetSearch query requests a maximum of 100 nodes, so this is used for the score.
assetSearch(... first: 100): 100 points
Query for multiple nodes by idLink copied!
The following assets query requests 4 assets by id so the score is 4 points.
assetId.length = 4 points
Connected node queriesLink 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
MutationLink copied!
All mutations have a score of 2000 points.
updateAsset mutation: 2000 points