fix: clarify agent availability swagger fields (#14533)

Clarifies the agent availability API documentation so request payloads
use the writable `availability` field, while `availability_status`
remains documented as a read-only response field.

## Closes

Closes #13873

## Why

The backend already supports updating an agent's configured availability
through `availability`, but the Swagger request payloads documented
`availability_status`. That made clients follow a read-only response
field and see successful requests without the intended availability
change.

## What changed

- Replaces `availability_status` with `availability` in agent
create/update request schemas.
- Updates the availability enum to `online`, `busy`, and `offline`.
- Marks response `availability_status` as read-only and explains that it
is derived from configured availability, auto-offline, and presence.
- Regenerates the combined and tag-group Swagger JSON files.

## Validation

- `bundle exec rails swagger:build`
- `bundle exec rspec spec/swagger/openapi_spec.rb`
- `git diff --check`
This commit is contained in:
Sojan Jose
2026-05-22 11:33:19 +05:30
committed by GitHub
parent 3c67c41544
commit 1d7a9093d2
8 changed files with 87 additions and 78 deletions
@@ -17,12 +17,12 @@ properties:
enum: ['agent', 'administrator']
description: Whether its administrator or agent
example: 'agent'
availability_status:
availability:
type: string
enum: ['available', 'busy', 'offline']
description: The availability setting of the agent.
example: 'available'
enum: ['online', 'busy', 'offline']
description: The configured availability of the agent.
example: 'online'
auto_offline:
type: boolean
description: Whether the availability status of agent is configured to go offline automatically when away.
description: Whether the agent is automatically marked offline when they are away.
example: true
@@ -7,12 +7,12 @@ properties:
enum: ['agent', 'administrator']
description: Whether its administrator or agent
example: 'agent'
availability_status:
availability:
type: string
enum: ['available', 'busy', 'offline']
description: The availability status of the agent.
example: 'available'
enum: ['online', 'busy', 'offline']
description: The configured availability of the agent.
example: 'online'
auto_offline:
type: boolean
description: Whether the availability status of agent is configured to go offline automatically when away.
description: Whether the agent is automatically marked offline when they are away.
example: true
+7 -3
View File
@@ -6,11 +6,15 @@ properties:
type: integer
availability_status:
type: string
enum: ['available', 'busy', 'offline']
description: The availability status of the agent computed by Chatwoot.
enum: ['online', 'busy', 'offline']
readOnly: true
description: >-
The effective availability status of the agent, derived from the configured availability,
auto-offline setting, and current presence. To update an agent's configured availability,
use the availability field in create or update requests.
auto_offline:
type: boolean
description: Whether the availability status of agent is configured to go offline automatically when away.
description: Whether the agent is automatically marked offline when they are away.
confirmed:
type: boolean
description: Whether the agent has confirmed their email address.
+14 -13
View File
@@ -9892,15 +9892,16 @@
"availability_status": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent computed by Chatwoot."
"readOnly": true,
"description": "The effective availability status of the agent, derived from the configured availability, auto-offline setting, and current presence. To update an agent's configured availability, use the availability field in create or update requests."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
"description": "Whether the agent is automatically marked offline when they are away."
},
"confirmed": {
"type": "boolean",
@@ -11595,19 +11596,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability setting of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
@@ -11627,19 +11628,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
+14 -13
View File
@@ -8399,15 +8399,16 @@
"availability_status": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent computed by Chatwoot."
"readOnly": true,
"description": "The effective availability status of the agent, derived from the configured availability, auto-offline setting, and current presence. To update an agent's configured availability, use the availability field in create or update requests."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
"description": "Whether the agent is automatically marked offline when they are away."
},
"confirmed": {
"type": "boolean",
@@ -10102,19 +10103,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability setting of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
@@ -10134,19 +10135,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
+14 -13
View File
@@ -1664,15 +1664,16 @@
"availability_status": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent computed by Chatwoot."
"readOnly": true,
"description": "The effective availability status of the agent, derived from the configured availability, auto-offline setting, and current presence. To update an agent's configured availability, use the availability field in create or update requests."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
"description": "Whether the agent is automatically marked offline when they are away."
},
"confirmed": {
"type": "boolean",
@@ -3367,19 +3368,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability setting of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
@@ -3399,19 +3400,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
+14 -13
View File
@@ -1079,15 +1079,16 @@
"availability_status": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent computed by Chatwoot."
"readOnly": true,
"description": "The effective availability status of the agent, derived from the configured availability, auto-offline setting, and current presence. To update an agent's configured availability, use the availability field in create or update requests."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
"description": "Whether the agent is automatically marked offline when they are away."
},
"confirmed": {
"type": "boolean",
@@ -2782,19 +2783,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability setting of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
@@ -2814,19 +2815,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
+14 -13
View File
@@ -1840,15 +1840,16 @@
"availability_status": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent computed by Chatwoot."
"readOnly": true,
"description": "The effective availability status of the agent, derived from the configured availability, auto-offline setting, and current presence. To update an agent's configured availability, use the availability field in create or update requests."
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away."
"description": "Whether the agent is automatically marked offline when they are away."
},
"confirmed": {
"type": "boolean",
@@ -3543,19 +3544,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability setting of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}
@@ -3575,19 +3576,19 @@
"description": "Whether its administrator or agent",
"example": "agent"
},
"availability_status": {
"availability": {
"type": "string",
"enum": [
"available",
"online",
"busy",
"offline"
],
"description": "The availability status of the agent.",
"example": "available"
"description": "The configured availability of the agent.",
"example": "online"
},
"auto_offline": {
"type": "boolean",
"description": "Whether the availability status of agent is configured to go offline automatically when away.",
"description": "Whether the agent is automatically marked offline when they are away.",
"example": true
}
}