# Server Quota

CRUD for default / client server quota (on-demand)

## Create a new quota item

> Create a new quota item

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuotaItem":{"type":"object","description":"ServerQuotaItem object","required":["clientId","instanceTypeId","locationId","quota"],"properties":{"id":{"type":"integer","format":"int","minimum":0,"readOnly":true},"clientId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 for default quota"},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for default and basic client quota"},"locationId":{"type":"integer","format":"int16","minimum":0,"maximum":32767,"description":"Pass 0 combined with instanceTypeId 0 to define max quota for an entire client"},"instanceTypeId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 to define with locationId > 0 to define max quota for an entire location"},"quota":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}},"ErrorResponse":{"type":"object","description":"Error response object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/quota":{"post":{"tags":["Server Quota"],"summary":"Create a new quota item","description":"Create a new quota item","operationId":"createQuotaItem","requestBody":{"description":"Provide quota parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"409":{"description":"Conflict - resource exists"},"422":{"description":"Invalid body parameter(s) supplied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get a specific quota item

> Get a specfic quota item

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuotaItem":{"type":"object","description":"ServerQuotaItem object","required":["clientId","instanceTypeId","locationId","quota"],"properties":{"id":{"type":"integer","format":"int","minimum":0,"readOnly":true},"clientId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 for default quota"},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for default and basic client quota"},"locationId":{"type":"integer","format":"int16","minimum":0,"maximum":32767,"description":"Pass 0 combined with instanceTypeId 0 to define max quota for an entire client"},"instanceTypeId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 to define with locationId > 0 to define max quota for an entire location"},"quota":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}}}},"paths":{"/api/quota/{id}":{"get":{"tags":["Server Quota"],"summary":"Get a specific quota item","description":"Get a specfic quota item","operationId":"getQuotaItem","parameters":[{"name":"id","in":"path","description":"ID of the quota item","required":true,"schema":{"type":"integer","format":"int","minimum":0}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"404":{"description":"Quota item not found"}}}}}}
```

## Update a specific quota item

> Update a specific quota item

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuotaItem":{"type":"object","description":"ServerQuotaItem object","required":["clientId","instanceTypeId","locationId","quota"],"properties":{"id":{"type":"integer","format":"int","minimum":0,"readOnly":true},"clientId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 for default quota"},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for default and basic client quota"},"locationId":{"type":"integer","format":"int16","minimum":0,"maximum":32767,"description":"Pass 0 combined with instanceTypeId 0 to define max quota for an entire client"},"instanceTypeId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 to define with locationId > 0 to define max quota for an entire location"},"quota":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}},"ErrorResponse":{"type":"object","description":"Error response object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/quota/{id}":{"put":{"tags":["Server Quota"],"summary":"Update a specific quota item","description":"Update a specific quota item","operationId":"updateQuotaItem","parameters":[{"name":"id","in":"path","description":"ID of the quota item","required":true,"schema":{"type":"integer","format":"int","minimum":0}}],"requestBody":{"description":"Provide quota parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"404":{"description":"Quota item not found"},"422":{"description":"Invalid body parameter(s) supplied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete a specific quota item

> Delete a specific quota item

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}}},"paths":{"/api/quota/{id}":{"delete":{"tags":["Server Quota"],"summary":"Delete a specific quota item","description":"Delete a specific quota item","operationId":"deleteQuotaItem","parameters":[{"name":"id","in":"path","description":"ID of the quota item","required":true,"schema":{"type":"integer","format":"int","minimum":0}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"404":{"description":"Quota item not found"}}}}}}
```

## Get a list of client IDs that have custom quota

> Get a list of client IDs that have custom quota, with optional contract ID

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuotaClients":{"type":"object","description":"ServerQuotaClients containing a list of client IDs that have custom quota","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ServerQuotaClient"}}}},"ServerQuotaClient":{"type":"object","description":"ServerQuotaClient containing a client ID and optional contract ID","required":["clientId"],"properties":{"clientId":{"type":"integer","format":"int","minimum":1},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for on-demand client quota"}}}}},"paths":{"/api/quota/clients":{"get":{"tags":["Server Quota"],"summary":"Get a list of client IDs that have custom quota","description":"Get a list of client IDs that have custom quota, with optional contract ID","operationId":"getQuotaClients","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaClients"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"}}}}}}
```

## Get all default quota items

> Get all default quota items

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuota":{"type":"object","description":"ServerQuota object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"ServerQuotaItem":{"type":"object","description":"ServerQuotaItem object","required":["clientId","instanceTypeId","locationId","quota"],"properties":{"id":{"type":"integer","format":"int","minimum":0,"readOnly":true},"clientId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 for default quota"},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for default and basic client quota"},"locationId":{"type":"integer","format":"int16","minimum":0,"maximum":32767,"description":"Pass 0 combined with instanceTypeId 0 to define max quota for an entire client"},"instanceTypeId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 to define with locationId > 0 to define max quota for an entire location"},"quota":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}}}},"paths":{"/api/quota/default":{"get":{"tags":["Server Quota"],"summary":"Get all default quota items","description":"Get all default quota items","operationId":"getDefaultQuota","responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuota"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"}}}}}}
```

## Get all quota for a client

> Get all the quota for a client, of all types

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuota":{"type":"object","description":"ServerQuota object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"ServerQuotaItem":{"type":"object","description":"ServerQuotaItem object","required":["clientId","instanceTypeId","locationId","quota"],"properties":{"id":{"type":"integer","format":"int","minimum":0,"readOnly":true},"clientId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 for default quota"},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for default and basic client quota"},"locationId":{"type":"integer","format":"int16","minimum":0,"maximum":32767,"description":"Pass 0 combined with instanceTypeId 0 to define max quota for an entire client"},"instanceTypeId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 to define with locationId > 0 to define max quota for an entire location"},"quota":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}}}},"paths":{"/api/client/{clientId}/quota":{"get":{"tags":["Server Quota"],"summary":"Get all quota for a client","description":"Get all the quota for a client, of all types","operationId":"getClientQuota","parameters":[{"name":"clientId","in":"path","description":"ID of the client to get quota for","required":true,"schema":{"type":"integer","format":"int"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuota"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"404":{"description":"Client not found"}}}}}}
```

## Set all quota for a client

> Set all the quota for a client in 1 go

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuotaBulk":{"type":"object","description":"ServerQuotaBulk to update all (client) quota for a contract ID in 1 go","required":["items"],"properties":{"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for on-demand client quota"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"ServerQuotaItem":{"type":"object","description":"ServerQuotaItem object","required":["clientId","instanceTypeId","locationId","quota"],"properties":{"id":{"type":"integer","format":"int","minimum":0,"readOnly":true},"clientId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 for default quota"},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for default and basic client quota"},"locationId":{"type":"integer","format":"int16","minimum":0,"maximum":32767,"description":"Pass 0 combined with instanceTypeId 0 to define max quota for an entire client"},"instanceTypeId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 to define with locationId > 0 to define max quota for an entire location"},"quota":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}},"ServerQuota":{"type":"object","description":"ServerQuota object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ServerQuotaItem"}}}},"ErrorResponse":{"type":"object","description":"Error response object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/client/{clientId}/quota":{"post":{"tags":["Server Quota"],"summary":"Set all quota for a client","description":"Set all the quota for a client in 1 go","operationId":"setClientQuotaBulk","parameters":[{"name":"clientId","in":"path","description":"ID of the client to get quota for","required":true,"schema":{"type":"integer","format":"int"}}],"requestBody":{"description":"Provide quota parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaBulk"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuota"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"404":{"description":"Client not found"},"422":{"description":"Invalid body parameter(s) supplied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete all quota of a client

> Delete the quota of a client. If contractId is passed, only the quota for that contract is deleted. Client ID may not be 0 (denoting default quota)

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}}},"paths":{"/api/client/{clientId}/quota":{"delete":{"tags":["Server Quota"],"summary":"Delete all quota of a client","description":"Delete the quota of a client. If contractId is passed, only the quota for that contract is deleted. Client ID may not be 0 (denoting default quota)","operationId":"deleteClientQuota","parameters":[{"name":"clientId","in":"path","description":"ID of the client to delete quota for","required":true,"schema":{"type":"integer","format":"int","minimum":1}},{"name":"contractId","in":"query","required":false,"description":"contract id","schema":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"406":{"description":"Not Acceptable"}}}}}}
```

## Get all quota + usage for a client

> Get all the quota + usage for a client, of all types

```json
{"openapi":"3.0.3","info":{"title":"Inventory Service - OpenAPI 3.0","version":"0.1.0"},"tags":[{"name":"Server Quota","description":"CRUD for default / client server quota (on-demand)"}],"security":[{"ApiKeyAuth":["read:server","write:server"]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-Api-Key","in":"header"}},"schemas":{"ServerQuotaUsage":{"type":"object","description":"ServerQuotaUsage object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ServerQuotaUsageItem"}}}},"ServerQuotaUsageItem":{"type":"object","description":"ServerQuotaItem response object with usage number","required":["usage"],"allOf":[{"$ref":"#/components/schemas/ServerQuotaItem"},{"type":"object","required":["usage"],"properties":{"usage":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}}]},"ServerQuotaItem":{"type":"object","description":"ServerQuotaItem object","required":["clientId","instanceTypeId","locationId","quota"],"properties":{"id":{"type":"integer","format":"int","minimum":0,"readOnly":true},"clientId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 for default quota"},"contractId":{"type":"string","pattern":"^[A-Z0-9_\\-.]{0,240}$","description":"Can be empty or null for default and basic client quota"},"locationId":{"type":"integer","format":"int16","minimum":0,"maximum":32767,"description":"Pass 0 combined with instanceTypeId 0 to define max quota for an entire client"},"instanceTypeId":{"type":"integer","format":"int","minimum":0,"description":"Pass 0 to define with locationId > 0 to define max quota for an entire location"},"quota":{"type":"integer","format":"int16","minimum":0,"maximum":32767}}}}},"paths":{"/api/client/{clientId}/quota/usage":{"get":{"tags":["Server Quota"],"summary":"Get all quota + usage for a client","description":"Get all the quota + usage for a client, of all types","operationId":"getClientQuotaUsage","parameters":[{"name":"clientId","in":"path","description":"ID of the client to get quota + usage for","required":true,"schema":{"type":"integer","format":"int"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerQuotaUsage"}}}},"400":{"description":"Invalid json body supplied"},"401":{"description":"Invalid authentication"},"404":{"description":"Client not found"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/api-references/inventory/server-quota.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
