---
canonical: https://amplience.com/developers/docs/apis/asset-management/overview/limits/
title: Limits
description: Rate limits, mutation limits and complexity limits for the Amplience GraphQL Management API, including how complexity scores are calculated.
audience: Developer
date_published: 2022-09-08
date_modified: 2023-09-21
---

# Limits

## Fair usage

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

## Rate limits

The GraphQL 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

| 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 limits

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

### What is the complexity limit?

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:

```json
{
  "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?

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.

### Examples

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

### Single node query

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

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

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

#### Multiple node query with pagination

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

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

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

### Query for multiple nodes by id

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

> `assetId.length = 4 points `

```graphql
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

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`

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

#### Mutation

All mutations have a score of 2000 points.

> `updateAsset mutation: 2000 points`

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