From 7a8aa4ca2e29cda09217f590eb09dcc1edfa44b5 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Tue, 5 Apr 2022 16:05:49 +0530 Subject: [PATCH] chore: Add Swagger Doc for Team Members (#4390) Add swagger documentation for Team Members APIs --- .../team_members/create.json.jbuilder | 8 +- swagger/index.yml | 12 +- swagger/parameters/team_id.yml | 2 +- swagger/paths/application/agents/create.yml | 2 +- swagger/paths/application/agents/delete.yml | 2 +- swagger/paths/application/agents/index.yml | 2 +- swagger/paths/application/agents/update.yml | 2 +- .../application/canned_responses/create.yml | 2 +- .../application/canned_responses/delete.yml | 2 +- .../application/canned_responses/index.yml | 2 +- .../application/contacts/conversations.yml | 2 +- swagger/paths/application/contacts/crud.yml | 6 +- swagger/paths/application/contacts/filter.yml | 2 +- .../application/contacts/list_create.yml | 4 +- swagger/paths/application/contacts/search.yml | 2 +- .../paths/application/conversation/filter.yml | 2 +- .../paths/application/conversation/index.yml | 4 +- .../paths/application/conversation/show.yml | 2 +- .../conversation/toggle_status.yml | 2 +- .../conversation/update_last_seen.yml | 2 +- .../application/custom_filters/create.yml | 2 +- .../application/custom_filters/delete.yml | 2 +- .../application/custom_filters/index.yml | 2 +- .../paths/application/custom_filters/show.yml | 2 +- .../application/custom_filters/update.yml | 2 +- swagger/paths/application/inboxes/create.yml | 2 +- .../application/inboxes/get_agent_bot.yml | 2 +- .../inboxes/inbox_members/create.yml | 2 +- .../inboxes/inbox_members/delete.yml | 2 +- .../inboxes/inbox_members/show.yml | 2 +- .../inboxes/inbox_members/update.yml | 2 +- swagger/paths/application/inboxes/index.yml | 2 +- .../application/inboxes/set_agent_bot.yml | 2 +- swagger/paths/application/inboxes/show.yml | 2 +- swagger/paths/application/inboxes/update.yml | 2 +- .../paths/application/team_members/create.yml | 35 ++ .../paths/application/team_members/delete.yml | 31 ++ .../paths/application/team_members/index.yml | 21 ++ .../paths/application/team_members/update.yml | 35 ++ swagger/paths/index.yml | 16 +- swagger/swagger.json | 302 +++++++++++++++--- 41 files changed, 440 insertions(+), 94 deletions(-) create mode 100644 swagger/paths/application/team_members/create.yml create mode 100644 swagger/paths/application/team_members/delete.yml create mode 100644 swagger/paths/application/team_members/index.yml create mode 100644 swagger/paths/application/team_members/update.yml diff --git a/app/views/api/v1/accounts/team_members/create.json.jbuilder b/app/views/api/v1/accounts/team_members/create.json.jbuilder index e4924f6a2..d8c0d209f 100644 --- a/app/views/api/v1/accounts/team_members/create.json.jbuilder +++ b/app/views/api/v1/accounts/team_members/create.json.jbuilder @@ -1,7 +1,3 @@ -if @team_member - json.partial! 'api/v1/models/agent.json.jbuilder', resource: @team_member -elsif @team_members.present? - json.array! @team_members do |team_member| - json.partial! 'api/v1/models/agent.json.jbuilder', resource: team_member - end +json.array! @team_members do |team_member| + json.partial! 'api/v1/models/agent.json.jbuilder', resource: team_member end diff --git a/swagger/index.yml b/swagger/index.yml index 28f20ce5a..181fed1a8 100644 --- a/swagger/index.yml +++ b/swagger/index.yml @@ -53,18 +53,18 @@ x-tagGroups: - name: Application tags: - Account AgentBots - - Agent - - Canned Response - - Contact - - Conversation + - Agents + - Canned Responses + - Contacts + - Conversations - Conversation Assignment - Conversation Labels - - Inbox + - Inboxes - Messages - Integrations - Profile - Teams - - Custom Filter + - Custom Filters - Reports - name: Client tags: diff --git a/swagger/parameters/team_id.yml b/swagger/parameters/team_id.yml index 805c32c2d..c18532b75 100644 --- a/swagger/parameters/team_id.yml +++ b/swagger/parameters/team_id.yml @@ -1,5 +1,5 @@ in: path -name: id +name: team_id type: integer required: true description: The ID of the team to be updated diff --git a/swagger/paths/application/agents/create.yml b/swagger/paths/application/agents/create.yml index b206eb306..dd191d81f 100644 --- a/swagger/paths/application/agents/create.yml +++ b/swagger/paths/application/agents/create.yml @@ -1,5 +1,5 @@ tags: - - Agent + - Agents operationId: add-new-agent-to-account summary: Add a New Agent description: Add a new Agent to Account diff --git a/swagger/paths/application/agents/delete.yml b/swagger/paths/application/agents/delete.yml index 1872fd8ea..118ddf234 100644 --- a/swagger/paths/application/agents/delete.yml +++ b/swagger/paths/application/agents/delete.yml @@ -1,5 +1,5 @@ tags: - - Agent + - Agents operationId: delete-agent-from-account summary: Remove an Agent from Account description: Remove an Agent from Account diff --git a/swagger/paths/application/agents/index.yml b/swagger/paths/application/agents/index.yml index 026893a4b..7961ad3b0 100644 --- a/swagger/paths/application/agents/index.yml +++ b/swagger/paths/application/agents/index.yml @@ -1,5 +1,5 @@ tags: - - Agent + - Agents operationId: get-account-agents summary: List Agents in Account description: Get Details of Agents in an Account diff --git a/swagger/paths/application/agents/update.yml b/swagger/paths/application/agents/update.yml index 693bef5b2..a72f5ed4e 100644 --- a/swagger/paths/application/agents/update.yml +++ b/swagger/paths/application/agents/update.yml @@ -1,5 +1,5 @@ tags: - - Agent + - Agents operationId: update-agent-in-account summary: Update Agent in Account description: Update an Agent in Account diff --git a/swagger/paths/application/canned_responses/create.yml b/swagger/paths/application/canned_responses/create.yml index 69b3673bc..95eacafb1 100644 --- a/swagger/paths/application/canned_responses/create.yml +++ b/swagger/paths/application/canned_responses/create.yml @@ -1,5 +1,5 @@ tags: - - Canned Response + - Canned Responses operationId: add-new-canned-response-to-account summary: Add a New Canned Response description: Add a new Canned Response to Account diff --git a/swagger/paths/application/canned_responses/delete.yml b/swagger/paths/application/canned_responses/delete.yml index 4b82e5068..2b1d08238 100644 --- a/swagger/paths/application/canned_responses/delete.yml +++ b/swagger/paths/application/canned_responses/delete.yml @@ -1,5 +1,5 @@ tags: - - Canned Response + - Canned Responses operationId: delete-canned-response-from-account summary: Remove a Canned Response from Account description: Remove a Canned Response from Account diff --git a/swagger/paths/application/canned_responses/index.yml b/swagger/paths/application/canned_responses/index.yml index 4e4a24c5d..3094a23a6 100644 --- a/swagger/paths/application/canned_responses/index.yml +++ b/swagger/paths/application/canned_responses/index.yml @@ -1,5 +1,5 @@ tags: - - Canned Response + - Canned Responses operationId: get-account-canned-response summary: List all Canned Responses in an Account description: Get Details of Canned Responses in an Account diff --git a/swagger/paths/application/contacts/conversations.yml b/swagger/paths/application/contacts/conversations.yml index 7d4b507b9..d08235f5e 100644 --- a/swagger/paths/application/contacts/conversations.yml +++ b/swagger/paths/application/contacts/conversations.yml @@ -1,6 +1,6 @@ get: tags: - - Contact + - Contacts operationId: contactConversations summary: Contact Conversations description: Get conversations associated to that contact diff --git a/swagger/paths/application/contacts/crud.yml b/swagger/paths/application/contacts/crud.yml index af9fecff7..3c982dfe9 100644 --- a/swagger/paths/application/contacts/crud.yml +++ b/swagger/paths/application/contacts/crud.yml @@ -8,7 +8,7 @@ parameters: get: tags: - - Contact + - Contacts operationId: contactDetails summary: Show Contact description: Get a contact belonging to the account using ID @@ -24,7 +24,7 @@ get: put: tags: - - Contact + - Contacts operationId: contactUpdate summary: Update Contact description: Update a contact belonging to the account using ID @@ -46,7 +46,7 @@ put: delete: tags: - - Contact + - Contacts operationId: contactDelete summary: Delete Contact responses: diff --git a/swagger/paths/application/contacts/filter.yml b/swagger/paths/application/contacts/filter.yml index 27adfbb9f..39aa269d9 100644 --- a/swagger/paths/application/contacts/filter.yml +++ b/swagger/paths/application/contacts/filter.yml @@ -1,5 +1,5 @@ tags: - - Contact + - Contacts operationId: contactFilter description: Filter contacts with custom filter options and pagination summary: Contact Filter diff --git a/swagger/paths/application/contacts/list_create.yml b/swagger/paths/application/contacts/list_create.yml index a80311d32..4329ed3b7 100644 --- a/swagger/paths/application/contacts/list_create.yml +++ b/swagger/paths/application/contacts/list_create.yml @@ -1,6 +1,6 @@ get: tags: - - Contact + - Contacts operationId: contactList description: Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number summary: List Contacts @@ -20,7 +20,7 @@ get: post: tags: - - Contact + - Contacts operationId: contactCreate description: Create a new Contact summary: Create Contact diff --git a/swagger/paths/application/contacts/search.yml b/swagger/paths/application/contacts/search.yml index e413863bd..63cc11903 100644 --- a/swagger/paths/application/contacts/search.yml +++ b/swagger/paths/application/contacts/search.yml @@ -1,6 +1,6 @@ get: tags: - - Contact + - Contacts operationId: contactSearch description: Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number summary: Search Contacts diff --git a/swagger/paths/application/conversation/filter.yml b/swagger/paths/application/conversation/filter.yml index 8f7e642c7..3ef141145 100644 --- a/swagger/paths/application/conversation/filter.yml +++ b/swagger/paths/application/conversation/filter.yml @@ -1,5 +1,5 @@ tags: - - Conversation + - Conversations operationId: conversationFilter description: Filter conversations with custom filter options and pagination summary: Conversations Filter diff --git a/swagger/paths/application/conversation/index.yml b/swagger/paths/application/conversation/index.yml index d5f8f9c0c..8041a7af6 100644 --- a/swagger/paths/application/conversation/index.yml +++ b/swagger/paths/application/conversation/index.yml @@ -3,7 +3,7 @@ parameters: get: tags: - - Conversation + - Conversations operationId: conversationList description: List all the conversations with pagination summary: Conversations List @@ -43,7 +43,7 @@ get: post: tags: - - Conversation + - Conversations operationId: newConversation summary: Create New Conversation description: "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://github.com/chatwoot/chatwoot/wiki/Building-on-Top-of-Chatwoot:-Importing-Existing-Contacts-and-Creating-Conversations" diff --git a/swagger/paths/application/conversation/show.yml b/swagger/paths/application/conversation/show.yml index 81782702c..56c3a292b 100644 --- a/swagger/paths/application/conversation/show.yml +++ b/swagger/paths/application/conversation/show.yml @@ -1,5 +1,5 @@ tags: - - Conversation + - Conversations operationId: get-details-of-a-conversation summary: Conversation Details description: Get all details regarding a conversation with all messages in the conversation diff --git a/swagger/paths/application/conversation/toggle_status.yml b/swagger/paths/application/conversation/toggle_status.yml index 14172e27c..20b18d6aa 100644 --- a/swagger/paths/application/conversation/toggle_status.yml +++ b/swagger/paths/application/conversation/toggle_status.yml @@ -1,5 +1,5 @@ tags: - - Conversation + - Conversations operationId: toggle-status-of-a-conversation summary: Toggle Status description: Toggles the status of the conversation between open and resolved diff --git a/swagger/paths/application/conversation/update_last_seen.yml b/swagger/paths/application/conversation/update_last_seen.yml index 2f26df879..0f542dd7f 100644 --- a/swagger/paths/application/conversation/update_last_seen.yml +++ b/swagger/paths/application/conversation/update_last_seen.yml @@ -1,6 +1,6 @@ post: tags: - - Conversation + - Conversations operationId: conversationUpdateLastSeen summary: Update Last Seen description: Updates the last seen of the conversation so that conversations will have the bubbles in the agents screen diff --git a/swagger/paths/application/custom_filters/create.yml b/swagger/paths/application/custom_filters/create.yml index 6fbc4c7f8..9d9534976 100644 --- a/swagger/paths/application/custom_filters/create.yml +++ b/swagger/paths/application/custom_filters/create.yml @@ -1,5 +1,5 @@ tags: - - Custom Filter + - Custom Filters operationId: create-a-custom-filter summary: Create a custom filter description: Create a custom filter in the account diff --git a/swagger/paths/application/custom_filters/delete.yml b/swagger/paths/application/custom_filters/delete.yml index 3ae042e9b..e66748858 100644 --- a/swagger/paths/application/custom_filters/delete.yml +++ b/swagger/paths/application/custom_filters/delete.yml @@ -1,5 +1,5 @@ tags: - - Custom Filter + - Custom Filters operationId: delete-a-custom-filter summary: Delete a custom filter description: Delete a custom filter from the account diff --git a/swagger/paths/application/custom_filters/index.yml b/swagger/paths/application/custom_filters/index.yml index b66e7b6f8..b77949dc3 100644 --- a/swagger/paths/application/custom_filters/index.yml +++ b/swagger/paths/application/custom_filters/index.yml @@ -1,5 +1,5 @@ tags: - - Custom Filter + - Custom Filters operationId: list-all-filters summary: List all custom filters description: List all custom filters in a category of a user diff --git a/swagger/paths/application/custom_filters/show.yml b/swagger/paths/application/custom_filters/show.yml index e2e2bf529..14de07d85 100644 --- a/swagger/paths/application/custom_filters/show.yml +++ b/swagger/paths/application/custom_filters/show.yml @@ -1,5 +1,5 @@ tags: - - Custom Filter + - Custom Filters operationId: get-details-of-a-single-custom-filter summary: Get a custom filter details description: Get the details of a custom filter in the account diff --git a/swagger/paths/application/custom_filters/update.yml b/swagger/paths/application/custom_filters/update.yml index 23ff97781..a058b81f8 100644 --- a/swagger/paths/application/custom_filters/update.yml +++ b/swagger/paths/application/custom_filters/update.yml @@ -1,5 +1,5 @@ tags: - - Custom Filter + - Custom Filters operationId: update-a-custom-filter summary: Update a custom filter description: Update a custom filter's attributes diff --git a/swagger/paths/application/inboxes/create.yml b/swagger/paths/application/inboxes/create.yml index 2a63775e7..3d649e820 100644 --- a/swagger/paths/application/inboxes/create.yml +++ b/swagger/paths/application/inboxes/create.yml @@ -1,6 +1,6 @@ post: tags: - - Inbox + - Inboxes operationId: inboxCreation summary: Create an inbox description: You can create more than one website inbox in each account diff --git a/swagger/paths/application/inboxes/get_agent_bot.yml b/swagger/paths/application/inboxes/get_agent_bot.yml index b77e7e06a..178151dd3 100644 --- a/swagger/paths/application/inboxes/get_agent_bot.yml +++ b/swagger/paths/application/inboxes/get_agent_bot.yml @@ -1,6 +1,6 @@ get: tags: - - Inbox + - Inboxes operationId: getInboxAgentBot summary: Show Inbox Agent Bot description: See if an agent bot is associated to the Inbox diff --git a/swagger/paths/application/inboxes/inbox_members/create.yml b/swagger/paths/application/inboxes/inbox_members/create.yml index 2cbbb4598..9ca5641e6 100644 --- a/swagger/paths/application/inboxes/inbox_members/create.yml +++ b/swagger/paths/application/inboxes/inbox_members/create.yml @@ -1,5 +1,5 @@ tags: - - Inbox + - Inboxes operationId: add-new-agent-to-inbox summary: Add a New Agent description: Add a new Agent to Inbox diff --git a/swagger/paths/application/inboxes/inbox_members/delete.yml b/swagger/paths/application/inboxes/inbox_members/delete.yml index 3167b28c6..78f1435b5 100644 --- a/swagger/paths/application/inboxes/inbox_members/delete.yml +++ b/swagger/paths/application/inboxes/inbox_members/delete.yml @@ -1,5 +1,5 @@ tags: - - Inbox + - Inboxes operationId: delete-agent-in-inbox summary: Remove an Agent from Inbox description: Remove an Agent from Inbox diff --git a/swagger/paths/application/inboxes/inbox_members/show.yml b/swagger/paths/application/inboxes/inbox_members/show.yml index af358f78f..57793f520 100644 --- a/swagger/paths/application/inboxes/inbox_members/show.yml +++ b/swagger/paths/application/inboxes/inbox_members/show.yml @@ -1,5 +1,5 @@ tags: - - Inbox + - Inboxes operationId: get-inbox-members summary: List Agents in Inbox description: Get Details of Agents in an Inbox diff --git a/swagger/paths/application/inboxes/inbox_members/update.yml b/swagger/paths/application/inboxes/inbox_members/update.yml index 3a06cef27..483b8f6ab 100644 --- a/swagger/paths/application/inboxes/inbox_members/update.yml +++ b/swagger/paths/application/inboxes/inbox_members/update.yml @@ -1,5 +1,5 @@ tags: - - Inbox + - Inboxes operationId: update-agents-in-inbox summary: Update Agents in Inbox description: All agents except the one passed in params will be removed diff --git a/swagger/paths/application/inboxes/index.yml b/swagger/paths/application/inboxes/index.yml index 714ff87e7..233488228 100644 --- a/swagger/paths/application/inboxes/index.yml +++ b/swagger/paths/application/inboxes/index.yml @@ -1,6 +1,6 @@ get: tags: - - Inbox + - Inboxes operationId: listAllInboxes summary: List all inboxes description: List all inboxes available in the current account diff --git a/swagger/paths/application/inboxes/set_agent_bot.yml b/swagger/paths/application/inboxes/set_agent_bot.yml index b37b06915..56a37d165 100644 --- a/swagger/paths/application/inboxes/set_agent_bot.yml +++ b/swagger/paths/application/inboxes/set_agent_bot.yml @@ -1,6 +1,6 @@ post: tags: - - Inbox + - Inboxes operationId: updateAgentBot summary: Add or remove agent bot description: To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null diff --git a/swagger/paths/application/inboxes/show.yml b/swagger/paths/application/inboxes/show.yml index a0d44c1d2..6bb2e84a5 100644 --- a/swagger/paths/application/inboxes/show.yml +++ b/swagger/paths/application/inboxes/show.yml @@ -1,6 +1,6 @@ get: tags: - - Inbox + - Inboxes operationId: GetInbox summary: Get an inbox description: Get an inbox available in the current account diff --git a/swagger/paths/application/inboxes/update.yml b/swagger/paths/application/inboxes/update.yml index d44822114..c5b3aaebf 100644 --- a/swagger/paths/application/inboxes/update.yml +++ b/swagger/paths/application/inboxes/update.yml @@ -1,6 +1,6 @@ patch: tags: - - Inbox + - Inboxes operationId: updateInbox summary: Update Inbox description: Add avatar and disable auto assignment for an inbox diff --git a/swagger/paths/application/team_members/create.yml b/swagger/paths/application/team_members/create.yml new file mode 100644 index 000000000..724769319 --- /dev/null +++ b/swagger/paths/application/team_members/create.yml @@ -0,0 +1,35 @@ +tags: + - Teams +operationId: add-new-agent-to-team +summary: Add a New Agent +description: Add a new Agent to Team +security: + - userApiKey: [] +parameters: + - name: data + in: body + required: true + schema: + type: object + required: + - user_ids + properties: + user_ids: + type: array + items: + type: integer + description: IDs of users to be added to the team +responses: + 200: + description: Success + schema: + type: array + description: 'Array of all active agents' + items: + $ref: '#/definitions/agent' + 404: + description: Team not found + 403: + description: Access denied + 422: + description: User must exist diff --git a/swagger/paths/application/team_members/delete.yml b/swagger/paths/application/team_members/delete.yml new file mode 100644 index 000000000..ac7dbb451 --- /dev/null +++ b/swagger/paths/application/team_members/delete.yml @@ -0,0 +1,31 @@ +tags: + - Teams +operationId: delete-agent-in-team +summary: Remove an Agent from Team +description: Remove an Agent from Team +security: + - userApiKey: [] +parameters: + - name: data + in: body + required: true + schema: + type: object + required: + - team_id + - user_ids + properties: + user_ids: + type: array + items: + type: integer + description: IDs of users to be deleted from the team +responses: + 200: + description: Success + 404: + description: Team not found + 403: + description: Access denied + 422: + description: User must exist diff --git a/swagger/paths/application/team_members/index.yml b/swagger/paths/application/team_members/index.yml new file mode 100644 index 000000000..dc28f2e99 --- /dev/null +++ b/swagger/paths/application/team_members/index.yml @@ -0,0 +1,21 @@ +tags: + - Teams +operationId: get-team-members +summary: List Agents in Team +description: Get Details of Agents in an Team +security: + - userApiKey: [] +parameters: + - $ref: '#/parameters/team_id' +responses: + 200: + description: Success + schema: + type: array + description: 'Array of all agents in the team' + items: + $ref: '#/definitions/agent' + 404: + description: Inbox not found + 403: + description: Access denied diff --git a/swagger/paths/application/team_members/update.yml b/swagger/paths/application/team_members/update.yml new file mode 100644 index 000000000..81034b9c7 --- /dev/null +++ b/swagger/paths/application/team_members/update.yml @@ -0,0 +1,35 @@ +tags: + - Teams +operationId: update-agents-in-team +summary: Update Agents in Team +description: All agents except the one passed in params will be removed +security: + - userApiKey: [] +parameters: + - name: data + in: body + required: true + schema: + type: object + required: + - user_ids + properties: + user_ids: + type: array + items: + type: integer + description: IDs of users to be added to the team +responses: + 200: + description: Success + schema: + type: array + description: 'Array of all agents in the team' + items: + $ref: '#/definitions/agent' + 404: + description: Team not found + 403: + description: Access denied + 422: + description: User must exist diff --git a/swagger/paths/index.yml b/swagger/paths/index.yml index 279ebb7bc..dc00c9b24 100644 --- a/swagger/paths/index.yml +++ b/swagger/paths/index.yml @@ -154,7 +154,7 @@ delete: $ref: ./application/agents/delete.yml -# Agents +# Canned Responses /api/v1/accounts/{account_id}/canned_responses: parameters: - $ref: '#/parameters/account_id' @@ -315,7 +315,7 @@ $ref: ./application/teams/index.yml post: $ref: ./application/teams/create.yml -/api/v1/accounts/{account_id}/teams/{id}: +/api/v1/accounts/{account_id}/teams/{team_id}: parameters: - $ref: '#/parameters/account_id' - $ref: '#/parameters/team_id' @@ -325,6 +325,18 @@ $ref: ./application/teams/update.yml delete: $ref: ./application/teams/delete.yml +/accounts/{account-id}/teams/{team_id}/team_members: + parameters: + - $ref: '#/parameters/account_id' + - $ref: '#/parameters/team_id' + get: + $ref: ./application/team_members/index.yml + post: + $ref: ./application/team_members/create.yml + patch: + $ref: ./application/team_members/update.yml + delete: + $ref: ./application/team_members/delete.yml ### Custom Filters goes here diff --git a/swagger/swagger.json b/swagger/swagger.json index 4de4db49d..6e188ad5e 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -1118,7 +1118,7 @@ ], "get": { "tags": [ - "Agent" + "Agents" ], "operationId": "get-account-agents", "summary": "List Agents in Account", @@ -1148,7 +1148,7 @@ }, "post": { "tags": [ - "Agent" + "Agents" ], "operationId": "add-new-agent-to-account", "summary": "Add a New Agent", @@ -1227,7 +1227,7 @@ ], "patch": { "tags": [ - "Agent" + "Agents" ], "operationId": "update-agent-in-account", "summary": "Update Agent in Account", @@ -1299,7 +1299,7 @@ }, "delete": { "tags": [ - "Agent" + "Agents" ], "operationId": "delete-agent-from-account", "summary": "Remove an Agent from Account", @@ -1341,7 +1341,7 @@ ], "get": { "tags": [ - "Canned Response" + "Canned Responses" ], "operationId": "get-account-canned-response", "summary": "List all Canned Responses in an Account", @@ -1371,7 +1371,7 @@ }, "post": { "tags": [ - "Canned Response" + "Canned Responses" ], "operationId": "add-new-canned-response-to-account", "summary": "Add a New Canned Response", @@ -1460,7 +1460,7 @@ }, "delete": { "tags": [ - "Canned Response" + "Canned Responses" ], "operationId": "delete-canned-response-from-account", "summary": "Remove a Canned Response from Account", @@ -1497,7 +1497,7 @@ "/api/v1/accounts/{account_id}/contacts": { "get": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactList", "description": "Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number", @@ -1530,7 +1530,7 @@ }, "post": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactCreate", "description": "Create a new Contact", @@ -1579,7 +1579,7 @@ ], "get": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactDetails", "summary": "Show Contact", @@ -1601,7 +1601,7 @@ }, "put": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactUpdate", "summary": "Update Contact", @@ -1633,7 +1633,7 @@ }, "delete": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactDelete", "summary": "Delete Contact", @@ -1653,7 +1653,7 @@ "/api/v1/accounts/{account_id}/contacts/{id}/conversations": { "get": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactConversations", "summary": "Contact Conversations", @@ -1689,7 +1689,7 @@ "/api/v1/accounts/{account_id}/contacts/search": { "get": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactSearch", "description": "Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number", @@ -1740,7 +1740,7 @@ ], "post": { "tags": [ - "Contact" + "Contacts" ], "operationId": "contactFilter", "description": "Filter contacts with custom filter options and pagination", @@ -1947,7 +1947,7 @@ ], "get": { "tags": [ - "Conversation" + "Conversations" ], "operationId": "conversationList", "description": "List all the conversations with pagination", @@ -2013,7 +2013,7 @@ }, "post": { "tags": [ - "Conversation" + "Conversations" ], "operationId": "newConversation", "summary": "Create New Conversation", @@ -2110,7 +2110,7 @@ ], "post": { "tags": [ - "Conversation" + "Conversations" ], "operationId": "conversationFilter", "description": "Filter conversations with custom filter options and pagination", @@ -2221,7 +2221,7 @@ ], "get": { "tags": [ - "Conversation" + "Conversations" ], "operationId": "get-details-of-a-conversation", "summary": "Conversation Details", @@ -2253,7 +2253,7 @@ ], "post": { "tags": [ - "Conversation" + "Conversations" ], "operationId": "toggle-status-of-a-conversation", "summary": "Toggle Status", @@ -2438,7 +2438,7 @@ "/api/v1/accounts/{account_id}/inboxes": { "get": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "listAllInboxes", "summary": "List all inboxes", @@ -2471,7 +2471,7 @@ "/api/v1/accounts/{account_id}/inboxes/{id}/": { "get": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "GetInbox", "summary": "Get an inbox", @@ -2507,7 +2507,7 @@ "/api/v1/accounts/{account_id}/inboxes/": { "post": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "inboxCreation", "summary": "Create an inbox", @@ -2586,7 +2586,7 @@ "/api/v1/accounts/{account_id}/inboxes/{id}": { "patch": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "updateInbox", "summary": "Update Inbox", @@ -2673,7 +2673,7 @@ "/api/v1/accounts/{account_id}/inboxes/{id}/agent_bot": { "get": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "getInboxAgentBot", "summary": "Show Inbox Agent Bot", @@ -2709,7 +2709,7 @@ "/api/v1/accounts/{account_id}/inboxes/{id}/set_agent_bot": { "post": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "updateAgentBot", "summary": "Add or remove agent bot", @@ -2767,7 +2767,7 @@ ], "get": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "get-inbox-members", "summary": "List Agents in Inbox", @@ -2805,7 +2805,7 @@ }, "patch": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "update-agents-in-inbox", "summary": "Update Agents in Inbox", @@ -2868,7 +2868,7 @@ }, "delete": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "delete-agent-in-inbox", "summary": "Remove an Agent from Inbox", @@ -2931,7 +2931,7 @@ ], "post": { "tags": [ - "Inbox" + "Inboxes" ], "operationId": "add-new-agent-to-inbox", "summary": "Add a New Agent", @@ -3333,7 +3333,7 @@ } } }, - "/api/v1/accounts/{account_id}/teams/{id}": { + "/api/v1/accounts/{account_id}/teams/{team_id}": { "parameters": [ { "$ref": "#/parameters/account_id" @@ -3413,6 +3413,222 @@ } } }, + "/accounts/{account-id}/teams/{team_id}/team_members": { + "parameters": [ + { + "$ref": "#/parameters/account_id" + }, + { + "$ref": "#/parameters/team_id" + } + ], + "get": { + "tags": [ + "Teams" + ], + "operationId": "get-team-members", + "summary": "List Agents in Team", + "description": "Get Details of Agents in an Team", + "security": [ + { + "userApiKey": [ + + ] + } + ], + "parameters": [ + { + "$ref": "#/parameters/team_id" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "description": "Array of all agents in the team", + "items": { + "$ref": "#/definitions/agent" + } + } + }, + "404": { + "description": "Inbox not found" + }, + "403": { + "description": "Access denied" + } + } + }, + "post": { + "tags": [ + "Teams" + ], + "operationId": "add-new-agent-to-team", + "summary": "Add a New Agent", + "description": "Add a new Agent to Team", + "security": [ + { + "userApiKey": [ + + ] + } + ], + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "user_ids" + ], + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be added to the team" + } + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "description": "Array of all active agents", + "items": { + "$ref": "#/definitions/agent" + } + } + }, + "404": { + "description": "Team not found" + }, + "403": { + "description": "Access denied" + }, + "422": { + "description": "User must exist" + } + } + }, + "patch": { + "tags": [ + "Teams" + ], + "operationId": "update-agents-in-team", + "summary": "Update Agents in Team", + "description": "All agents except the one passed in params will be removed", + "security": [ + { + "userApiKey": [ + + ] + } + ], + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "user_ids" + ], + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be added to the team" + } + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "array", + "description": "Array of all agents in the team", + "items": { + "$ref": "#/definitions/agent" + } + } + }, + "404": { + "description": "Team not found" + }, + "403": { + "description": "Access denied" + }, + "422": { + "description": "User must exist" + } + } + }, + "delete": { + "tags": [ + "Teams" + ], + "operationId": "delete-agent-in-team", + "summary": "Remove an Agent from Team", + "description": "Remove an Agent from Team", + "security": [ + { + "userApiKey": [ + + ] + } + ], + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "team_id", + "user_ids" + ], + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be deleted from the team" + } + } + } + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Team not found" + }, + "403": { + "description": "Access denied" + }, + "422": { + "description": "User must exist" + } + } + } + }, "/api/v1/accounts/{account_id}/custom_filters": { "parameters": [ { @@ -3433,7 +3649,7 @@ ], "get": { "tags": [ - "Custom Filter" + "Custom Filters" ], "operationId": "list-all-filters", "summary": "List all custom filters", @@ -3456,7 +3672,7 @@ }, "post": { "tags": [ - "Custom Filter" + "Custom Filters" ], "operationId": "create-a-custom-filter", "summary": "Create a custom filter", @@ -3498,7 +3714,7 @@ ], "get": { "tags": [ - "Custom Filter" + "Custom Filters" ], "operationId": "get-details-of-a-single-custom-filter", "summary": "Get a custom filter details", @@ -3520,7 +3736,7 @@ }, "patch": { "tags": [ - "Custom Filter" + "Custom Filters" ], "operationId": "update-a-custom-filter", "summary": "Update a custom filter", @@ -3549,7 +3765,7 @@ }, "delete": { "tags": [ - "Custom Filter" + "Custom Filters" ], "operationId": "delete-a-custom-filter", "summary": "Delete a custom filter", @@ -5084,7 +5300,7 @@ }, "team_id": { "in": "path", - "name": "id", + "name": "team_id", "type": "integer", "required": true, "description": "The ID of the team to be updated" @@ -5221,18 +5437,18 @@ "name": "Application", "tags": [ "Account AgentBots", - "Agent", - "Canned Response", - "Contact", - "Conversation", + "Agents", + "Canned Responses", + "Contacts", + "Conversations", "Conversation Assignment", "Conversation Labels", - "Inbox", + "Inboxes", "Messages", "Integrations", "Profile", "Teams", - "Custom Filter", + "Custom Filters", "Reports" ] },