Files
leadchat/swagger/index.yml
Shivam Mishra 9a9398b386 feat: validate OpenAPI spec using Skooma (#13623)
Adds Skooma-based OpenAPI validation so SDK-facing request specs can
assert that documented request and response contracts match real Rails
behavior. This also upgrades the spec to OpenAPI 3.1 and fixes contract
drift uncovered while validating core application and platform
resources.

Closes
None

Why
We want CI to catch OpenAPI drift before it reaches SDK consumers. While
wiring validation in, this PR surfaced several mismatches between the
documented contract and what the Rails endpoints actually accept or
return.

What this change does
- Adds Skooma-backed OpenAPI validation to the request spec flow and a
dedicated OpenAPI validation spec.
- Migrates nullable schema definitions to OpenAPI 3.1-compatible unions.
- Updates core SDK-facing schemas and payloads across accounts,
contacts, conversations, inboxes, messages, teams, reporting events, and
platform account resources.
- Documents concrete runtime cases that were previously missing or
inaccurate, including nested `profile` update payloads, multipart avatar
uploads, required profile update bodies, nullable inbox feature flags,
and message sender types that include both `Captain::Assistant` and
senderless activity-style messages.
- Regenerates the committed Swagger JSON and tag-group artifacts used by
CI sync checks.

Validation
- `bundle exec rake swagger:build`
- `bundle exec rspec spec/swagger/openapi_spec.rb`

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-03-10 18:33:55 -07:00

130 lines
3.8 KiB
YAML

openapi: '3.1.0'
info:
title: Chatwoot
description: This is the API documentation for Chatwoot server.
version: 1.1.0
termsOfService: https://www.chatwoot.com/terms-of-service/
contact:
email: hello@chatwoot.com
license:
name: MIT License
url: https://opensource.org/licenses/MIT
servers:
- url: https://app.chatwoot.com/
paths:
$ref: ./paths/index.yml
components:
schemas:
$ref: ./definitions/index.yml
parameters:
$ref: ./parameters/index.yml
securitySchemes:
userApiKey:
type: apiKey
in: header
name: api_access_token
description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
agentBotApiKey:
type: apiKey
in: header
name: api_access_token
description: This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis.
platformAppApiKey:
type: apiKey
in: header
name: api_access_token
description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles.
tags:
- name: Accounts
description: Account management APIs
- name: Account Users
description: Account user management APIs
- name: AgentBots
description: Bot integrations
- name: Users
description: User management APIs
- name: Account AgentBots
description: Account-specific Agent Bots
- name: Agents
description: Agent management APIs
- name: Canned Responses
description: Pre-defined responses for common queries
- name: Contacts
description: Contact management APIs
- name: Contact Labels
description: Manage contact labels
- name: Conversation Assignments
description: Manage conversation assignments
- name: Conversation Labels
description: Manage conversation labels
- name: Conversations
description: Conversation management APIs
- name: Custom Attributes
description: Custom fields for contacts and conversations
- name: Custom Filters
description: Saved filters for conversations
- name: Inboxes
description: Communication channels setup
- name: Integrations
description: Third-party integrations
- name: Messages
description: Message management APIs
- name: Profile
description: User profile APIs
- name: Reports
description: Analytics and reporting APIs
- name: Teams
description: Team management APIs
- name: Webhooks
description: Event notification webhooks
- name: Automation Rule
description: Workflow automation rules
- name: Help Center
description: Knowledge base management
- name: Contacts API
description: Public contact APIs
- name: Conversations API
description: Public conversation APIs
- name: Messages API
description: Public message APIs
- name: CSAT Survey Page
description: Customer satisfaction survey
x-tagGroups:
- name: Platform
tags:
- Accounts
- Account Users
- AgentBots
- Users
- name: Application
tags:
- Account AgentBots
- Account
- Agents
- Audit Logs
- Canned Responses
- Contacts
- Contact Labels
- Conversation Assignments
- Conversation Labels
- Conversations
- Custom Attributes
- Custom Filters
- Inboxes
- Integrations
- Messages
- Profile
- Reports
- Teams
- Webhooks
- Automation Rule
- Help Center
- name: Client
tags:
- Contacts API
- Conversations API
- Messages API
- name: Others
tags:
- CSAT Survey Page