Files
ed3059c1aa docs: Document API inbox webhook URL (#14593)
Documents the existing API inbox webhook_url request field and expands
inbox create/update request docs with channel-specific schemas and
examples.

Closes #14591

## Why
API inboxes already accept channel.webhook_url through Channel::Api
editable attributes, but the OpenAPI request schemas did not document
the field. The previous mixed channel object also made it hard to see
which fields belong to each supported channel type.

## What changed
- Added named channel payload schemas for supported inbox create channel
types.
- Added channel-specific create request samples in this order: Website
inbox, API channel, Email channel, LINE channel, Telegram channel,
WhatsApp channel, SMS channel.
- Added common inbox fields such as greeting_enabled, greeting_message,
enable_auto_assignment, working_hours_enabled, and timezone to request
samples.
- Kept website-only flags such as allow_messages_after_resolved and
enable_email_collect only in website inbox samples.
- Annotated inbox request field descriptions with channel availability
where Swagger UI cannot dynamically filter fields.
- Added channel-specific update settings schemas and request samples for
editable channel attributes.
- Documented channel.webhook_url for API inbox create/update payloads.
- Rebuilt generated Swagger JSON and tag-group specs.

## Screenshots

**Website inbox request sample**

Shows the request sample selector set to Website inbox, including
website-only fields such as enable_email_collect and
allow_messages_after_resolved.

<img width="3840" height="2160" alt="Website inbox request sample"
src="https://github.com/user-attachments/assets/ad130f04-b336-4cc3-aba1-e934b646d447"
/>

**API channel request sample**

Shows the selector switched to API channel, with API-specific fields
such as webhook_url, hmac_mandatory, and additional_attributes.

<img width="3840" height="2160" alt="API channel request sample"
src="https://github.com/user-attachments/assets/09484816-1d47-490f-9ab4-195835ed5cd3"
/>

**Expanded channel schema**

Shows the request-body schema with channel expanded, including the type
selector and channel-specific fields under it.

<img width="3840" height="2160" alt="Expanded channel schema"
src="https://github.com/user-attachments/assets/f6c4878e-ac34-40fe-8be3-5913f27cbdd8"
/>

## Validation
- bundle exec rake swagger:build
- bundle exec rspec spec/swagger/openapi_spec.rb
- Rendered the local Swagger page and verified the request sample
dropdown order and API channel payload.

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2026-06-01 12:37:07 +04:00

131 lines
4.1 KiB
YAML

type: object
properties:
name:
type: string
description: The name of the inbox.
example: 'Support'
avatar:
type: string
format: binary
description: Image file for avatar.
greeting_enabled:
type: boolean
description: Enable greeting message.
example: true
greeting_message:
type: string
description: Greeting message to send when greeting messages are enabled.
example: Hello, how can I help you?
enable_email_collect:
type: boolean
description: |
Enable email collection.
Available for: `Website`
example: true
csat_survey_enabled:
type: boolean
description: Enable CSAT survey.
example: true
csat_config:
type: object
description: CSAT survey configuration.
properties:
display_type:
type: string
description: Display style for the CSAT survey.
enum: ['emoji', 'star']
example: emoji
message:
type: string
description: Message shown with the CSAT survey.
example: Please rate your conversation
button_text:
type: string
description: Text shown on the CSAT survey button.
example: Please rate us
language:
type: string
description: Language code for the CSAT survey.
example: en
survey_rules:
type: object
description: Rules that decide when to show the CSAT survey.
properties:
operator:
type: string
example: contains
values:
type: array
items:
type: string
example: ['billing']
enable_auto_assignment:
type: boolean
description: Enable Auto Assignment.
example: true
working_hours_enabled:
type: boolean
description: Enable working hours.
example: true
out_of_office_message:
type: string
description: Out of office message to send outside working hours.
example: We are currently out of office. Please leave a message and we will get back to you.
timezone:
type: string
description: Timezone of the inbox.
example: 'America/New_York'
allow_messages_after_resolved:
type: boolean
description: |
Allow messages after conversation is resolved.
Available for: `Website`
example: true
lock_to_single_conversation:
type: boolean
description: |
Lock contact messages to a single active conversation.
Available for: `API` `LINE` `Telegram` `WhatsApp` `SMS`
example: true
portal_id:
type: integer
description: Id of the help center portal to attach to the inbox.
example: 1
sender_name_type:
type: string
description: |
Sender name type for outbound email replies.
Available for: `Website` `Email`
enum: ['friendly', 'professional']
example: 'friendly'
business_name:
type: string
description: |
Business name for outbound email replies.
Available for: `Website` `Email`
example: 'My Business'
channel:
oneOf:
- $ref: '#/components/schemas/inbox_create_web_widget_channel_payload'
- $ref: '#/components/schemas/inbox_create_api_channel_payload'
- $ref: '#/components/schemas/inbox_create_email_channel_payload'
- $ref: '#/components/schemas/inbox_create_line_channel_payload'
- $ref: '#/components/schemas/inbox_create_telegram_channel_payload'
- $ref: '#/components/schemas/inbox_create_whatsapp_channel_payload'
- $ref: '#/components/schemas/inbox_create_sms_channel_payload'
discriminator:
propertyName: type
mapping:
web_widget: '#/components/schemas/inbox_create_web_widget_channel_payload'
api: '#/components/schemas/inbox_create_api_channel_payload'
email: '#/components/schemas/inbox_create_email_channel_payload'
line: '#/components/schemas/inbox_create_line_channel_payload'
telegram: '#/components/schemas/inbox_create_telegram_channel_payload'
whatsapp: '#/components/schemas/inbox_create_whatsapp_channel_payload'
sms: '#/components/schemas/inbox_create_sms_channel_payload'