Chatwoot/swagger/paths/index.yml
Sojan Jose 22d1c8baf2
Chore: Inbox Members API improvements (#3008)
- New Inbox Member APIs
- Return JSON errors for Platform APIs
2021-09-14 11:55:02 +05:30

361 lines
9.5 KiB
YAML

# ------------ Platform API routes ------------#
# Accounts
platform/api/v1/accounts:
post:
$ref: ./platform/accounts/create.yml
platform/api/v1/accounts/{id}:
parameters:
- $ref: '#/parameters/account_id'
get:
$ref: './platform/accounts/show.yml'
patch:
$ref: ./platform/accounts/update.yml
delete:
$ref: ./platform/accounts/delete.yml
# Account Users
platform/api/v1/accounts/{id}/account_users:
parameters:
- $ref: '#/parameters/account_id'
get:
$ref: './platform/account_users/index.yml'
post:
$ref: ./platform/account_users/create.yml
delete:
$ref: ./platform/account_users/delete.yml
# AgentBots
platform/api/v1/agent_bots:
get:
$ref: ./platform/agent_bots/index.yml
post:
$ref: ./platform/agent_bots/create.yml
platform/api/v1/agent_bots/{id}:
parameters:
- $ref: '#/parameters/agent_bot_id'
get:
$ref: './platform/agent_bots/show.yml'
patch:
$ref: ./platform/agent_bots/update.yml
delete:
$ref: ./platform/agent_bots/delete.yml
# Users
platform/api/v1/users:
post:
$ref: ./platform/users/create.yml
platform/api/v1/users/{id}:
parameters:
- $ref: '#/parameters/platform_user_id'
get:
$ref: './platform/users/show.yml'
patch:
$ref: ./platform/users/update.yml
delete:
$ref: ./platform/users/delete.yml
platform/api/v1/users/{id}/login:
parameters:
- $ref: '#/parameters/platform_user_id'
$ref: './platform/users/login.yml'
# ---------------- end of platform path -----------#
# ------------ Public API routes ------------#
# Contacts
public/api/v1/inboxes/{inbox_identifier}/contacts:
parameters:
- $ref: '#/parameters/public_inbox_identifier'
post:
$ref: ./public/inboxes/contacts/create.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}:
parameters:
- $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier'
get:
$ref: './public/inboxes/contacts/show.yml'
patch:
$ref: ./public/inboxes/contacts/update.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations:
parameters:
- $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier'
post:
$ref: ./public/inboxes/conversations/create.yml
get:
$ref: ./public/inboxes/conversations/index.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages:
parameters:
- $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier'
- $ref: '#/parameters/conversation_id'
post:
$ref: ./public/inboxes/messages/create.yml
get:
$ref: ./public/inboxes/messages/index.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}:
parameters:
- $ref: '#/parameters/public_inbox_identifier'
- $ref: '#/parameters/public_contact_identifier'
- $ref: '#/parameters/conversation_id'
- $ref: '#/parameters/message_id'
patch:
$ref: ./public/inboxes/messages/update.yml
# ---------------- end of public api routes-----------#
# ------------ Application API routes ------------#
# AgentBots
/api/v1/accounts/{account_id}/agent_bots:
parameters:
- $ref: '#/parameters/account_id'
get:
$ref: ./agent_bots/index.yml
post:
$ref: ./agent_bots/create.yml
/api/v1/accounts/{account_id}/agent_bots/{id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/agent_bot_id'
get:
$ref: './agent_bots/show.yml'
patch:
$ref: ./agent_bots/update.yml
delete:
$ref: ./agent_bots/delete.yml
# Contacts
/api/v1/accounts/{account_id}/contacts:
$ref: ./contact/list_create.yml
/api/v1/accounts/{account_id}/contacts/{id}:
$ref: ./contact/crud.yml
/api/v1/accounts/{account_id}/contacts/{id}/conversations:
$ref: ./contact/conversations.yml
/api/v1/accounts/{account_id}/contacts/search:
$ref: ./contact/search.yml
/api/v1/accounts/{account_id}/contacts/{id}/contact_inboxes:
$ref: ./contact_inboxes/create.yml
/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes:
$ref: ./contactable_inboxes/get.yml
# Conversations
/api/v1/accounts/{account_id}/conversations:
parameters:
- $ref: '#/parameters/account_id'
$ref: ./conversation/index.yml
/api/v1/accounts/{account_id}/conversations/:
parameters:
- $ref: '#/parameters/account_id'
$ref: ./conversation/create.yml
/api/v1/accounts/{account_id}/conversations/{converstion_id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id'
get:
$ref: ./conversation/show.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_status:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id'
post:
$ref: ./conversation/toggle_status.yml
# Conversations Assignments
/api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id'
post:
$ref: ./conversation/assignments.yml
# Conversation Labels
/api/v1/accounts/{account_id}/conversations/{conversation_id}/labels:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id'
get:
$ref: ./conversation/labels/index.yml
post:
$ref: ./conversation/labels/create.yml
# Inboxes
/api/v1/accounts/{account_id}/inboxes:
$ref: ./inboxes/index.yml
/api/v1/accounts/{account_id}/inboxes/{id}/:
$ref: ./inboxes/show.yml
/api/v1/accounts/{account_id}/inboxes/:
$ref: ./inboxes/create.yml
/api/v1/accounts/{account_id}/inboxes/{id}:
$ref: ./inboxes/update.yml
/api/v1/accounts/{account_id}/inboxes/{id}/agent_bot:
$ref: ./inboxes/get_agent_bot.yml
/api/v1/accounts/{account_id}/inboxes/{id}/set_agent_bot:
$ref: ./inboxes/set_agent_bot.yml
# Inbox Members
/api/v1/accounts/{account_id}/inbox_members:
get:
$ref: ./inboxes/inbox_members/show.yml
post:
$ref: ./inboxes/inbox_members/create.yml
patch:
$ref: ./inboxes/inbox_members/update.yml
delete:
$ref: ./inboxes/inbox_members/delete.yml
# Messages
/api/v1/accounts/{account_id}/conversations/{id}/messages:
$ref: ./conversation/messages/create_attachment.yml
/api/v1/accounts/{account_id}/conversations/{converstion_id}/messages:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id'
get:
$ref: ./conversation/messages/index.yml
post:
$ref: ./conversation/messages/create.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/conversation_id'
- $ref: '#/parameters/message_id'
delete:
$ref: ./conversation/messages/delete.yml
# Integrations
/api/v1/accounts/{account_id}/integrations/apps:
parameters:
- $ref: '#/parameters/account_id'
get:
$ref: './integrations/apps/show.yml'
/api/v1/accounts/{account_id}/integrations/hooks:
post:
$ref: './integrations/hooks/create.yml'
patch:
$ref: ./integrations/hooks/update.yml
delete:
$ref: ./integrations/hooks/delete.yml
# Profile
/profile:
$ref: ./profile/index.yml
# Teams
/api/v1/accounts/{account_id}/teams:
parameters:
- $ref: '#/parameters/account_id'
get:
$ref: ./teams/index.yml
post:
$ref: ./teams/create.yml
/api/v1/accounts/{account_id}/teams/{id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/team_id'
get:
$ref: './teams/show.yml'
patch:
$ref: ./teams/update.yml
delete:
$ref: ./teams/delete.yml
### Custom Filters goes here
# Custom Filters
/api/v1/accounts/{account_id}/custom_filters:
parameters:
- $ref: '#/parameters/account_id'
- in: query
name: filter_type
schema:
type: string
enum: ['conversation', 'contact', 'report']
required: false
description: The type of custom filter
get:
$ref: ./custom_filters/index.yml
post:
$ref: ./custom_filters/create.yml
/api/v1/accounts/{account_id}/custom_filters/{custom_filter_id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/custom_filter_id'
get:
$ref: './custom_filters/show.yml'
patch:
$ref: ./custom_filters/update.yml
delete:
$ref: ./custom_filters/delete.yml
### Reports
# List
/api/v1/accounts/{id}/reports:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/report_metric'
- $ref: '#/parameters/report_type'
- in: query
name: id
schema:
type: string
description: The Id of specific object in case of agent/inbox/label
- in: query
name: since
schema:
type: string
description: The timestamp from where report should start.
- in: query
name: until
schema:
type: string
description: The timestamp from where report should stop.
get:
$ref: './reports/index.yml'
# Summary
/api/v1/accounts/{id}/reports/summary:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/report_type'
- in: query
name: id
schema:
type: string
description: The Id of specific object in case of agent/inbox/label
- in: query
name: since
schema:
type: string
description: The timestamp from where report should start.
- in: query
name: until
schema:
type: string
description: The timestamp from where report should stop.
get:
$ref: './reports/summary.yml'