From a8febc00d3a640069d3077af49349f551d4d49cb Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 27 Feb 2025 16:57:25 -0800 Subject: [PATCH] chore: Add Swagger endpoint for updating custom attributes (#10995) - Add swagger endpoint for updating custom attributes in a conversation --- .gitignore | 1 + .../conversation/custom_attributes.yml | 36 +++++++++ swagger/paths/index.yml | 7 ++ swagger/swagger.json | 73 +++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 swagger/paths/application/conversation/custom_attributes.yml diff --git a/.gitignore b/.gitignore index 5eb883db0..77c4a4740 100644 --- a/.gitignore +++ b/.gitignore @@ -73,6 +73,7 @@ test/cypress/videos/* #ignore files under .vscode directory .vscode +.cursor # yalc for local testing .yalc diff --git a/swagger/paths/application/conversation/custom_attributes.yml b/swagger/paths/application/conversation/custom_attributes.yml new file mode 100644 index 000000000..bfd416138 --- /dev/null +++ b/swagger/paths/application/conversation/custom_attributes.yml @@ -0,0 +1,36 @@ +tags: + - Conversations +operationId: update-custom-attributes-of-a-conversation +summary: Update Custom Attributes +description: Updates the custom attributes of a conversation +security: + - userApiKey: [] + - agentBotApiKey: [] +parameters: + - name: data + in: body + required: true + schema: + type: object + required: + - custom_attributes + properties: + custom_attributes: + type: object + description: The custom attributes to be set for the conversation + example: + order_id: "12345" + previous_conversation: "67890" +responses: + 200: + description: Success + schema: + type: object + properties: + custom_attributes: + type: object + description: The custom attributes of the conversation + 404: + description: Conversation not found + 401: + description: Unauthorized \ No newline at end of file diff --git a/swagger/paths/index.yml b/swagger/paths/index.yml index 6df22d06e..769f38c27 100644 --- a/swagger/paths/index.yml +++ b/swagger/paths/index.yml @@ -354,6 +354,13 @@ post: $ref: ./application/conversation/toggle_priority.yml +/api/v1/accounts/{account_id}/conversations/{conversation_id}/custom_attributes: + parameters: + - $ref: '#/parameters/account_id' + - $ref: '#/parameters/conversation_id' + post: + $ref: ./application/conversation/custom_attributes.yml + # Conversations Assignments /api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments: diff --git a/swagger/swagger.json b/swagger/swagger.json index d5f94f730..19ef5c904 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -3514,6 +3514,79 @@ } } }, + "/api/v1/accounts/{account_id}/conversations/{conversation_id}/custom_attributes": { + "parameters": [ + { + "$ref": "#/parameters/account_id" + }, + { + "$ref": "#/parameters/conversation_id" + } + ], + "post": { + "tags": [ + "Conversations" + ], + "operationId": "update-custom-attributes-of-a-conversation", + "summary": "Update Custom Attributes", + "description": "Updates the custom attributes of a conversation", + "security": [ + { + "userApiKey": [ + + ] + }, + { + "agentBotApiKey": [ + + ] + } + ], + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "custom_attributes" + ], + "properties": { + "custom_attributes": { + "type": "object", + "description": "The custom attributes to be set for the conversation", + "example": { + "order_id": "12345", + "previous_conversation": "67890" + } + } + } + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object", + "properties": { + "custom_attributes": { + "type": "object", + "description": "The custom attributes of the conversation" + } + } + } + }, + "404": { + "description": "Conversation not found" + }, + "401": { + "description": "Unauthorized" + } + } + } + }, "/api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments": { "parameters": [ {