chatwoot/swagger/definitions/resource/agent.yml
Sojan Jose 1d7a9093d2
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`
2026-05-22 11:33:19 +05:30

42 lines
1.1 KiB
YAML

type: object
properties:
id:
type: integer
account_id:
type: integer
availability_status:
type: string
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 agent is automatically marked offline when they are away.
confirmed:
type: boolean
description: Whether the agent has confirmed their email address.
email:
type: string
description: The email of the agent
available_name:
type: string
description: The available name of the agent
name:
type: string
description: The name of the agent
role:
type: string
enum: ['agent', 'administrator']
description: The role of the agent
thumbnail:
type: string
description: The thumbnail of the agent
custom_role_id:
type:
- integer
- 'null'
description: The custom role id of the agent