# Public Cloud › Project Management › Quota API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 2 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/quota/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/project-management/quota.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/project-management/quota.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/quota` — Get the project quota
- `PUT /publicCloud/project/{projectId}/quota` — Update the project quota

## Get the project quota

`GET /v2/publicCloud/project/{projectId}/quota`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/quota/#getQuota

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:quota/get`

Returns the project quota. When the `region` query parameter is set, the response narrows `targetSpec.regions` and `currentState.regions` to that single region. Omit it to get all regions.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `region` | query | string |  | Optional region filter |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.quota.Quota | successful operation |
| 400 | object | Error 400 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the quota |
| `currentState` | publicCloud.quota.QuotaCurrentState | read-only | Current state of the quota |
| `currentState.availableProfiles` | publicCloud.quota.QuotaProfile[] | read-only | Quota profiles available to this project |
| `currentState.availableProfiles[].compute` | publicCloud.quota.QuotaProfileCompute | read-only | Compute limits |
| `currentState.availableProfiles[].keyManager` | publicCloud.quota.QuotaProfileKeyManager | read-only | Key manager limits |
| `currentState.availableProfiles[].keypair` | publicCloud.quota.QuotaProfileKeypair | read-only | Keypair limits |
| `currentState.availableProfiles[].loadbalancer` | publicCloud.quota.QuotaProfileLoadbalancer | read-only | Loadbalancer limits |
| `currentState.availableProfiles[].name` | string | read-only | Profile name |
| `currentState.availableProfiles[].network` | publicCloud.quota.QuotaProfileNetwork | read-only | Network limits |
| `currentState.availableProfiles[].share` | publicCloud.quota.QuotaProfileShare | read-only | File storage limits |
| `currentState.availableProfiles[].volume` | publicCloud.quota.QuotaProfileVolume | read-only | Block storage limits |
| `currentState.preventAutomaticQuotaUpgrade` | boolean | read-only | When true, automatic quota upgrades are disabled for this project |
| `currentState.regions` | publicCloud.quota.QuotaRegionCurrentState[] | read-only | Current state per region |
| `currentState.regions[].location` | publicCloud.common.Location | read-only | Region where the quota applies |
| `currentState.regions[].profile` | string | read-only | Currently applied quota profile name |
| `currentState.regions[].usage` | publicCloud.quota.QuotaUsageDetails | read-only | Quota usage for this region |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the quota |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Project ID this quota belongs to |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Quota readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.quota.QuotaTargetSpec | read-only | Last target specification of the quota |
| `targetSpec.preventAutomaticQuotaUpgrade` | boolean | read-only | When true, automatic quota upgrades are disabled for this project |
| `targetSpec.regions` | publicCloud.quota.QuotaRegionTargetSpec[] | read-only | Target quota profile per region |
| `targetSpec.regions[].location` | publicCloud.common.Location | yes | Region where the profile applies |
| `targetSpec.regions[].profile` | string | yes | Quota profile to apply in this region. Available values are in currentState.availableProfiles. |
| `updatedAt` | string (date-time) | read-only | Last update date of the quota |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "availableProfiles": [
      {
        "compute": {
          "cores": 0,
          "instances": 0,
          "memory": 0
        },
        "keyManager": {
          "containers": 0,
          "secrets": 0
        },
        "keypair": {
          "keypairs": 0
        },
        "loadbalancer": {
          "healthMonitors": 0,
          "l7Policies": 0,
          "l7Rules": 0,
          "listeners": 0,
          "loadbalancers": 0,
          "members": 0,
          "pools": 0
        },
        "name": "string",
        "network": {
          "floatingIps": 0,
          "gateways": 0,
          "networks": 0,
          "securityGroupRules": 0,
          "securityGroups": 0,
          "subnets": 0
        },
        "share": {
          "backupSizeTotal": 0,
          "backups": 0,
          "shares": 0,
          "sizeTotal": 0,
          "snapshots": 0
        },
        "volume": {
          "backupSizeTotal": 0,
          "backups": 0,
          "sizeTotal": 0,
          "snapshots": 0,
          "volumes": 0
        }
      }
    ],
    "preventAutomaticQuotaUpgrade": true,
    "regions": [
      {
        "location": {
          "availabilityZone": "string",
          "region": "string"
        },
        "profile": "string",
        "usage": {
          "compute": {
            "cores": {
              "limit": null,
              "unit": null,
              "used": null
            },
            "instances": {
              "limit": null,
              "unit": null,
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/quota" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/quota")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/quota");

print_r($result);
?>
```

## Update the project quota

`PUT /v2/publicCloud/project/{projectId}/quota`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/project-management/quota/#editQuota

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:quota/edit`

Updates the project quota region by region. Each region listed in `targetSpec.regions` is added or updated, and the regions you omit are left unchanged, so raising the quota of one region does not require restating the others. Unlike the other update routes of this API, this list is merged, not replaced. `preventAutomaticQuotaUpgrade` is required.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.quota.QuotaUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). |
| `targetSpec` | publicCloud.quota.QuotaUpdateTargetSpec | yes | Update specification |
| `targetSpec.preventAutomaticQuotaUpgrade` | boolean | yes | When true, automatic quota upgrades are disabled for this project |
| `targetSpec.regions` | publicCloud.quota.QuotaRegionTargetSpec[] | yes | Target quota profile per region. Regions omitted are left unchanged. This is the one deliberate exception to the replace semantics every other update route on this API follows: the list is applied as an element-level upsert keyed by region, not as a whole-list replacement, so that raising the quota of one region does not force a caller to restate every other region of the project. |
| `targetSpec.regions[].location` | publicCloud.common.Location | yes | Region where the profile applies |
| `targetSpec.regions[].profile` | string | yes | Quota profile to apply in this region. Available values are in currentState.availableProfiles. |

```json
{
  "checksum": "string",
  "targetSpec": {
    "preventAutomaticQuotaUpgrade": true,
    "regions": [
      {
        "location": {
          "availabilityZone": "string",
          "region": "string"
        },
        "profile": "string"
      }
    ]
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.quota.Quota | successful operation |
| 400 | object | Error 400 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the quota |
| `currentState` | publicCloud.quota.QuotaCurrentState | read-only | Current state of the quota |
| `currentState.availableProfiles` | publicCloud.quota.QuotaProfile[] | read-only | Quota profiles available to this project |
| `currentState.availableProfiles[].compute` | publicCloud.quota.QuotaProfileCompute | read-only | Compute limits |
| `currentState.availableProfiles[].keyManager` | publicCloud.quota.QuotaProfileKeyManager | read-only | Key manager limits |
| `currentState.availableProfiles[].keypair` | publicCloud.quota.QuotaProfileKeypair | read-only | Keypair limits |
| `currentState.availableProfiles[].loadbalancer` | publicCloud.quota.QuotaProfileLoadbalancer | read-only | Loadbalancer limits |
| `currentState.availableProfiles[].name` | string | read-only | Profile name |
| `currentState.availableProfiles[].network` | publicCloud.quota.QuotaProfileNetwork | read-only | Network limits |
| `currentState.availableProfiles[].share` | publicCloud.quota.QuotaProfileShare | read-only | File storage limits |
| `currentState.availableProfiles[].volume` | publicCloud.quota.QuotaProfileVolume | read-only | Block storage limits |
| `currentState.preventAutomaticQuotaUpgrade` | boolean | read-only | When true, automatic quota upgrades are disabled for this project |
| `currentState.regions` | publicCloud.quota.QuotaRegionCurrentState[] | read-only | Current state per region |
| `currentState.regions[].location` | publicCloud.common.Location | read-only | Region where the quota applies |
| `currentState.regions[].profile` | string | read-only | Currently applied quota profile name |
| `currentState.regions[].usage` | publicCloud.quota.QuotaUsageDetails | read-only | Quota usage for this region |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the quota |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string | read-only | Project ID this quota belongs to |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Quota readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.quota.QuotaTargetSpec | read-only | Last target specification of the quota |
| `targetSpec.preventAutomaticQuotaUpgrade` | boolean | read-only | When true, automatic quota upgrades are disabled for this project |
| `targetSpec.regions` | publicCloud.quota.QuotaRegionTargetSpec[] | read-only | Target quota profile per region |
| `targetSpec.regions[].location` | publicCloud.common.Location | yes | Region where the profile applies |
| `targetSpec.regions[].profile` | string | yes | Quota profile to apply in this region. Available values are in currentState.availableProfiles. |
| `updatedAt` | string (date-time) | read-only | Last update date of the quota |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "availableProfiles": [
      {
        "compute": {
          "cores": 0,
          "instances": 0,
          "memory": 0
        },
        "keyManager": {
          "containers": 0,
          "secrets": 0
        },
        "keypair": {
          "keypairs": 0
        },
        "loadbalancer": {
          "healthMonitors": 0,
          "l7Policies": 0,
          "l7Rules": 0,
          "listeners": 0,
          "loadbalancers": 0,
          "members": 0,
          "pools": 0
        },
        "name": "string",
        "network": {
          "floatingIps": 0,
          "gateways": 0,
          "networks": 0,
          "securityGroupRules": 0,
          "securityGroups": 0,
          "subnets": 0
        },
        "share": {
          "backupSizeTotal": 0,
          "backups": 0,
          "shares": 0,
          "sizeTotal": 0,
          "snapshots": 0
        },
        "volume": {
          "backupSizeTotal": 0,
          "backups": 0,
          "sizeTotal": 0,
          "snapshots": 0,
          "volumes": 0
        }
      }
    ],
    "preventAutomaticQuotaUpgrade": true,
    "regions": [
      {
        "location": {
          "availabilityZone": "string",
          "region": "string"
        },
        "profile": "string",
        "usage": {
          "compute": {
            "cores": {
              "limit": null,
              "unit": null,
              "used": null
            },
            "instances": {
              "limit": null,
              "unit": null,
  …
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/quota" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.quota.QuotaUpdate
result = client.put("/v2/publicCloud/project/{projectId}/quota",
	checksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec = None, # Update specification (type: publicCloud.quota.QuotaUpdateTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.quota.QuotaUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/quota", array(
	checksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec => null, // Update specification (type: publicCloud.quota.QuotaUpdateTargetSpec)
));

print_r($result);
?>
```
