From 2187a3e566052c744198a575ae305b0dcbef9e71 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Tue, 20 May 2025 00:49:24 +0700 Subject: [PATCH] update user profile payload for developer docs --- developer-docs/docs.json | 2 +- swagger/definitions/resource/user.yml | 74 +++++++++-- .../application/integrations/apps/show.yml | 11 +- swagger/swagger.json | 120 +++++++++++++++--- 4 files changed, 170 insertions(+), 37 deletions(-) diff --git a/developer-docs/docs.json b/developer-docs/docs.json index 97e6008e2..ad2f4cb41 100644 --- a/developer-docs/docs.json +++ b/developer-docs/docs.json @@ -16,7 +16,7 @@ "tabs": [ { "tab": "API Documentation", - "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/ac94e34c723731ef7f9caf839c2616bd96ef89c1/swagger/swagger.json" + "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/2b043e54604b70715a9e7d0a9a7836763174a126/swagger/swagger.json" } ] }, diff --git a/swagger/definitions/resource/user.yml b/swagger/definitions/resource/user.yml index b788713ad..329dba12e 100644 --- a/swagger/definitions/resource/user.yml +++ b/swagger/definitions/resource/user.yml @@ -2,27 +2,77 @@ type: object properties: id: type: number - uid: - type: string - name: - type: string - available_name: - type: string - display_name: - type: string - email: + access_token: type: string account_id: type: number + available_name: + type: string + avatar_url: + type: string + confirmed: + type: boolean + display_name: + type: string + nullable: true + message_signature: + type: string + nullable: true + email: + type: string + hmac_identifier: + type: string + inviter_id: + type: number + name: + type: string + provider: + type: string + pubsub_token: + type: string role: type: string enum: ['agent', 'administrator'] - confirmed: - type: boolean + ui_settings: + type: object + uid: + type: string + type: + type: string + nullable: true custom_attributes: type: object description: Available for users who are created through platform APIs and has custom attributes associated. accounts: type: array items: - $ref: '#/components/schemas/account' + type: object + properties: + id: + type: number + name: + type: string + status: + type: string + active_at: + type: string + format: date-time + role: + type: string + enum: ['administrator', 'agent'] + permissions: + type: array + items: + type: string + availability: + type: string + availability_status: + type: string + auto_offline: + type: boolean + custom_role_id: + type: number + nullable: true + custom_role: + type: object + nullable: true diff --git a/swagger/paths/application/integrations/apps/show.yml b/swagger/paths/application/integrations/apps/show.yml index 96fab5b1b..ab5403bd6 100644 --- a/swagger/paths/application/integrations/apps/show.yml +++ b/swagger/paths/application/integrations/apps/show.yml @@ -11,10 +11,13 @@ responses: content: application/json: schema: - type: array - description: 'Array of Integration apps' - items: - $ref: '#/components/schemas/integrations_app' + type: object + properties: + payload: + type: array + description: 'Array of Integration apps' + items: + $ref: '#/components/schemas/integrations_app' '401': description: Unauthorized content: diff --git a/swagger/swagger.json b/swagger/swagger.json index 6b2026365..beb7d5ebc 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -6058,10 +6058,15 @@ "content": { "application/json": { "schema": { - "type": "array", - "description": "Array of Integration apps", - "items": { - "$ref": "#/components/schemas/integrations_app" + "type": "object", + "properties": { + "payload": { + "type": "array", + "description": "Array of Integration apps", + "items": { + "$ref": "#/components/schemas/integrations_app" + } + } } } } @@ -8485,24 +8490,47 @@ "id": { "type": "number" }, - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "available_name": { - "type": "string" - }, - "display_name": { - "type": "string" - }, - "email": { + "access_token": { "type": "string" }, "account_id": { "type": "number" }, + "available_name": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "confirmed": { + "type": "boolean" + }, + "display_name": { + "type": "string", + "nullable": true + }, + "message_signature": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string" + }, + "hmac_identifier": { + "type": "string" + }, + "inviter_id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "pubsub_token": { + "type": "string" + }, "role": { "type": "string", "enum": [ @@ -8510,8 +8538,15 @@ "administrator" ] }, - "confirmed": { - "type": "boolean" + "ui_settings": { + "type": "object" + }, + "uid": { + "type": "string" + }, + "type": { + "type": "string", + "nullable": true }, "custom_attributes": { "type": "object", @@ -8520,7 +8555,52 @@ "accounts": { "type": "array", "items": { - "$ref": "#/components/schemas/account" + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "active_at": { + "type": "string", + "format": "date-time" + }, + "role": { + "type": "string", + "enum": [ + "administrator", + "agent" + ] + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "availability": { + "type": "string" + }, + "availability_status": { + "type": "string" + }, + "auto_offline": { + "type": "boolean" + }, + "custom_role_id": { + "type": "number", + "nullable": true + }, + "custom_role": { + "type": "object", + "nullable": true + } + } } } }