> For the complete documentation index, see [llms.txt](https://docs.bird.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bird.com/api/collaborations-api/api-reference/capacity-rules.md).

# Capacity Rules

## List capacity rules

> Retrieve list of capacity rule

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"parameters":{"pagination.param.limit":{"description":"Limits the number of results to return.","in":"query","name":"limit","schema":{"default":25,"maximum":100,"type":"integer"}},"pagination.param.pageToken":{"description":"The cursor that keeps track of the current position in the results.","in":"query","name":"pageToken","schema":{"type":"string"}},"pagination.param.reverse":{"description":"Reverses the order in which the results are returned.","in":"query","name":"reverse","schema":{"default":false,"type":"boolean"}}},"schemas":{"CapacityRulesList":{"required":["results"],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CapacityRule"}}}},"CapacityRule":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","capacity"],"properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"capacity":{"type":"object","additionalProperties":false,"properties":{"messaging":{"type":"integer"},"email":{"type":"integer"}}},"assignedAgentIds":{"type":"array","nullable":true,"items":{"type":"string","format":"uuid"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}},"paths":{"/workspaces/{workspaceId}/inbox/capacity":{"get":{"description":"Retrieve list of capacity rule","operationId":"listCapacityRules","parameters":[{"$ref":"#/components/parameters/pagination.param.limit"},{"$ref":"#/components/parameters/pagination.param.pageToken"},{"$ref":"#/components/parameters/pagination.param.reverse"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapacityRulesList"}}},"description":"OK"}},"summary":"List capacity rules","tags":["capacity_rules"]}}}}
```

## POST /workspaces/{workspaceId}/inbox/capacity

> Create Capacity Rule

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"schemas":{"CreateCapacityRule":{"type":"object","additionalProperties":false,"required":["name","description","capacity"],"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","minLength":1,"maxLength":255},"default":{"type":"boolean"},"capacity":{"type":"object","additionalProperties":false,"required":["messaging","email"],"properties":{"messaging":{"type":"integer"},"email":{"type":"integer"}}},"agents":{"type":"array","items":{"type":"string","format":"uuid"}}}},"CapacityRule":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","capacity"],"properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"capacity":{"type":"object","additionalProperties":false,"properties":{"messaging":{"type":"integer"},"email":{"type":"integer"}}},"assignedAgentIds":{"type":"array","nullable":true,"items":{"type":"string","format":"uuid"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"error.validation":{"additionalProperties":false,"description":"A validation error returned from the API. The `details` map keys are JSON paths\npointing into the request body / parameters; values are arrays of human-readable\nmessages describing each problem with that path.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"description":"Per-field validation messages keyed by JSON path.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"ValidationError","type":"object"}},"responses":{"error.response.invalid_request":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.validation"}}},"description":"The request contains invalid parameters or body fields."}}},"paths":{"/workspaces/{workspaceId}/inbox/capacity":{"post":{"operationId":"createCapacityRule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCapacityRule"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapacityRule"}}},"description":"Created a Capacity Rule."},"409":{"$ref":"#/components/responses/error.response.invalid_request"},"422":{"$ref":"#/components/responses/error.response.invalid_request"}},"summary":"Create Capacity Rule","tags":["capacity_rules"]}}}}
```

## GET /workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}

> Get a Capacity Rule

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"schemas":{"CapacityRule":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","capacity"],"properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"capacity":{"type":"object","additionalProperties":false,"properties":{"messaging":{"type":"integer"},"email":{"type":"integer"}}},"assignedAgentIds":{"type":"array","nullable":true,"items":{"type":"string","format":"uuid"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"error.detailed":{"additionalProperties":false,"description":"An error returned from the API that includes additional details about the error. The `details` property can contain any additional information about the error that may be helpful for debugging or understanding the error.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":true,"description":"Any additional information about the error that may be helpful for debugging or understanding the error.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"DetailedError","type":"object"}},"responses":{"error.response.not_found":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.detailed"}}},"description":"The requested resource was not found."}}},"paths":{"/workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}":{"get":{"operationId":"getCapacityRule","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapacityRule"}}},"description":"ok"},"404":{"$ref":"#/components/responses/error.response.not_found"}},"summary":"Get a Capacity Rule","tags":["capacity_rules"]}}}}
```

## PATCH /workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}

> Update Capacity Rule

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"schemas":{"UpdateCapacityRule":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"capacity":{"type":"object","additionalProperties":false,"required":["messaging","email"],"properties":{"messaging":{"type":"integer"},"email":{"type":"integer"}}}}},"CapacityRule":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","capacity"],"properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"default":{"type":"boolean"},"capacity":{"type":"object","additionalProperties":false,"properties":{"messaging":{"type":"integer"},"email":{"type":"integer"}}},"assignedAgentIds":{"type":"array","nullable":true,"items":{"type":"string","format":"uuid"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"error.detailed":{"additionalProperties":false,"description":"An error returned from the API that includes additional details about the error. The `details` property can contain any additional information about the error that may be helpful for debugging or understanding the error.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":true,"description":"Any additional information about the error that may be helpful for debugging or understanding the error.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"DetailedError","type":"object"},"error.validation":{"additionalProperties":false,"description":"A validation error returned from the API. The `details` map keys are JSON paths\npointing into the request body / parameters; values are arrays of human-readable\nmessages describing each problem with that path.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"description":"Per-field validation messages keyed by JSON path.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"ValidationError","type":"object"}},"responses":{"error.response.not_found":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.detailed"}}},"description":"The requested resource was not found."},"error.response.invalid_request":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.validation"}}},"description":"The request contains invalid parameters or body fields."}}},"paths":{"/workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}":{"patch":{"operationId":"updateCapacityRule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCapacityRule"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapacityRule"}}},"description":"Updated"},"404":{"$ref":"#/components/responses/error.response.not_found"},"409":{"$ref":"#/components/responses/error.response.invalid_request"},"422":{"$ref":"#/components/responses/error.response.invalid_request"}},"summary":"Update Capacity Rule","tags":["capacity_rules"]}}}}
```

## DELETE /workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}

> Delete a Capacity Rule

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"responses":{"error.response.not_found":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.detailed"}}},"description":"The requested resource was not found."}},"schemas":{"error.detailed":{"additionalProperties":false,"description":"An error returned from the API that includes additional details about the error. The `details` property can contain any additional information about the error that may be helpful for debugging or understanding the error.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":true,"description":"Any additional information about the error that may be helpful for debugging or understanding the error.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"DetailedError","type":"object"}}},"paths":{"/workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}":{"delete":{"operationId":"deleteCapacityRule","responses":{"204":{"description":"OK"},"404":{"$ref":"#/components/responses/error.response.not_found"}},"summary":"Delete a Capacity Rule","tags":["capacity_rules"]}}}}
```

## POST /workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}/agents

> Assign Capacity Rule

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"schemas":{"AssignCapacityRule":{"type":"object","additionalProperties":false,"required":["agents"],"properties":{"agents":{"type":"array","items":{"type":"string","format":"uuid"}}}},"error.detailed":{"additionalProperties":false,"description":"An error returned from the API that includes additional details about the error. The `details` property can contain any additional information about the error that may be helpful for debugging or understanding the error.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":true,"description":"Any additional information about the error that may be helpful for debugging or understanding the error.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"DetailedError","type":"object"},"error.validation":{"additionalProperties":false,"description":"A validation error returned from the API. The `details` map keys are JSON paths\npointing into the request body / parameters; values are arrays of human-readable\nmessages describing each problem with that path.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"description":"Per-field validation messages keyed by JSON path.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"ValidationError","type":"object"}},"responses":{"error.response.not_found":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.detailed"}}},"description":"The requested resource was not found."},"error.response.invalid_request":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.validation"}}},"description":"The request contains invalid parameters or body fields."}}},"paths":{"/workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}/agents":{"post":{"operationId":"assignCapacityRule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignCapacityRule"}}},"required":true},"responses":{"204":{"description":"Assigned a Capacity Rule."},"404":{"$ref":"#/components/responses/error.response.not_found"},"422":{"$ref":"#/components/responses/error.response.invalid_request"}},"summary":"Assign Capacity Rule","tags":["capacity_rules"]}}}}
```

## GET /workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}/agents

> get agents assigned to Capacity Rule

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}}},"paths":{"/workspaces/{workspaceId}/inbox/capacity/{capacityRuleId}/agents":{"get":{"operationId":"listAgentsAssignedCapacityRule","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"agents":{"items":{"format":"uuid","type":"string"},"type":"array"}},"type":"object"}}},"description":"Successful operation"}},"summary":"get agents assigned to Capacity Rule","tags":["capacity_rules"]}}}}
```
