diff --git a/.github/workflows/enrich.yml b/.github/workflows/enrich.yml new file mode 100644 index 0000000..f9e49b1 --- /dev/null +++ b/.github/workflows/enrich.yml @@ -0,0 +1,40 @@ +name: Enrich OpenAPI specs for Document360 + +on: + push: + branches: [main] + paths: + - "*.yaml" + - "tools/enrich_openapi.py" + workflow_dispatch: + +permissions: + contents: write + +jobs: + enrich: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: pip install pyyaml + + - name: Regenerate dist/ + run: python3 tools/enrich_openapi.py . dist + + - name: Commit enriched specs + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add dist/ + if git diff --cached --quiet; then + echo "dist/ unchanged - nothing to commit" + else + git commit -m "chore: regenerate enriched specs in dist/ [skip ci]" + git push + fi diff --git a/dist/authentication.yaml b/dist/authentication.yaml new file mode 100644 index 0000000..c5fec9b --- /dev/null +++ b/dist/authentication.yaml @@ -0,0 +1,1454 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Authentication +servers: +- url: https://apiexplorer.support.rocket.chat +paths: + /api/v1/login: + post: + tags: + - Authentication + summary: Login with Username and Password + description: "- Although none of the body parameters are required, it's mandatory to include either the `user` AND `password` or only the `resume` parameter.\n\n- To authenticate a request, you need to pass the `userId` and `authToken` values from this JSON response object as headers in the request. The `authToken` is passed as `X-Auth-Token` header, while the `userId` as `X-User-Id` header.\n\n- If LDAP authentication is enabled, you must maintain the login in the same way as you normally do. Similarly, if 2FA is enabled for an LDAP user, everything stays the same.\n \n### Changelog\n| Version | Description | \n | ---------------- | ------------|\n |1.0.0 | Added `avatarUrl` property to response |\n |0.64.0 | Added `me` property. |\n |0.60.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/login \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"user\": \"test@rocket.test\",\n \"password\": \"vanvica32\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"status\": \"success\",\n \"data\": {\n \"authToken\": \"9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq\",\n \"userId\": \"aobEdbYhXfu5hkeqG\",\n \"me\": {\n \"_id\": \"aYjNnig8BEAWeQzMh\",\n \"name\": \"Rocket Cat\",\n \"emails\": [\n {\n \"address\": \"rocket.cat@rocket.chat\",\n \"verified\": false\n }\n ],\n \"status\": \"offline\",\n \"statusConnection\": \"offline\",\n \"username\": \"rocket.cat\",\n \"utcOffset\": -3,\n \"active\": true,\n \"roles\": [\n \"admin\"\n ],\n \"settings\": {\n \"preferences\": {}\n },\n \"avatarUrl\": \"http://localhost:3000/avatar/test\"\n }\n }\n}\n```" + operationId: post-api-v1-login + requestBody: + description: '' + content: + application/json: + schema: + type: object + properties: + user: + type: string + description: Your user name or email. + example: myusername + password: + type: string + description: Your pasword. + example: my$up3erP@ssw0rd + resume: + type: string + description: Your previously issued `authToken`. + example: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + code: + type: string + description: The 2FA code. It is required if your account has two-factor authentication enabled . + example: 2246d10 + examples: + Example: + value: + user: test@rocket.test + password: vanvica32 + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + properties: + status: + type: string + data: + type: object + properties: + authToken: + type: string + userId: + type: string + me: + type: object + properties: + _id: + type: string + name: + type: string + emails: + type: array + items: + type: object + properties: + address: + type: string + verified: + type: boolean + status: + type: string + statusConnection: + type: string + username: + type: string + utcOffset: + type: integer + active: + type: boolean + roles: + type: array + items: + type: string + settings: + type: object + properties: + preferences: + type: object + avatarUrl: + type: string + x-examples: + Example: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + examples: + Login successful: + value: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + /api/v1/login - with Facebook: + post: + tags: + - Authentication + summary: Login with Facebook + description: "### Changelog\n| Version | Description | \n | ---------------- | ------------|\n |1.0.0 | Added `avatarUrl` property to response |\n |0.64.0 | Added `me` property. |\n |0.63.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/login - with Facebook \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"serviceName\": \"facebook\",\n \"accessToken\": \"hash\",\n \"secret\": \"hash\",\n \"expiresIn\": 200\n}'\n```\n\n### Example success response\n\n```json\n{\n \"status\": \"success\",\n \"data\": {\n \"authToken\": \"9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq\",\n \"userId\": \"aobEdbYhXfu5hkeqG\",\n \"me\": {\n \"_id\": \"aYjNnig8BEAWeQzMh\",\n \"name\": \"Rocket Cat\",\n \"emails\": [\n {\n \"address\": \"rocket.cat@rocket.chat\",\n \"verified\": false\n }\n ],\n \"status\": \"offline\",\n \"statusConnection\": \"offline\",\n \"username\": \"rocket.cat\",\n \"utcOffset\": -3,\n \"active\": true,\n \"roles\": [\n \"admin\"\n ],\n \"settings\": {\n \"preferences\": {}\n },\n \"avatarUrl\": \"http://localhost:3000/avatar/test\"\n }\n }\n}\n```" + operationId: post-api-v1-login-facebook + requestBody: + description: '' + content: + application/json: + schema: + type: object + properties: + serviceName: + type: string + description: The desired OAuth service name. In this case, `facebook`. + example: facebook + accessToken: + type: string + description: Access token provided by Facebook oauth. + example: hash + secret: + type: string + description: The secret provided by Facebook. + example: hash + expiresIn: + type: integer + description: Lifetime of token (in seconds). + example: 200 + required: + - serviceName + - accessToken + - secret + - expiresIn + x-examples: + Example: + serviceName: facebook + accessToken: hash + secret: hash + expiresIn: 200 + examples: + Example: + value: + serviceName: facebook + accessToken: hash + secret: hash + expiresIn: 200 + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + properties: + status: + type: string + data: + type: object + properties: + authToken: + type: string + userId: + type: string + me: + type: object + properties: + _id: + type: string + name: + type: string + emails: + type: array + items: + type: object + properties: + address: + type: string + verified: + type: boolean + status: + type: string + statusConnection: + type: string + username: + type: string + utcOffset: + type: integer + active: + type: boolean + roles: + type: array + items: + type: string + settings: + type: object + properties: + preferences: + type: object + avatarUrl: + type: string + x-examples: + Example: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + examples: + Success Example: + value: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + /api/v1/login - with Twitter: + post: + tags: + - Authentication + summary: Login with Twitter + description: "### Changelog\n| Version | Description | \n | ---------------- | ------------|\n |1.0.0 | Added `avatarUrl` property to response |\n |0.64.0 | Added `me` property. |\n |0.63.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/login - with Twitter \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"serviceName\": \"twitter\",\n \"accessToken\": \"hash\",\n \"accessTokenSecret\": \"hash\",\n \"appSecret\": \"hash\",\n \"appId\": \"hash\",\n \"expiresIn\": 200\n}'\n```\n\n### Example success response\n\n```json\n{\n \"status\": \"success\",\n \"data\": {\n \"authToken\": \"9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq\",\n \"userId\": \"aobEdbYhXfu5hkeqG\",\n \"me\": {\n \"_id\": \"aYjNnig8BEAWeQzMh\",\n \"name\": \"Rocket Cat\",\n \"emails\": [\n {\n \"address\": \"rocket.cat@rocket.chat\",\n \"verified\": false\n }\n ],\n \"status\": \"offline\",\n \"statusConnection\": \"offline\",\n \"username\": \"rocket.cat\",\n \"utcOffset\": -3,\n \"active\": true,\n \"roles\": [\n \"admin\"\n ],\n \"settings\": {\n \"preferences\": {}\n },\n \"avatarUrl\": \"http://localhost:3000/avatar/test\"\n }\n }\n}\n```" + operationId: post-api-v1-login-twitter + requestBody: + description: '' + content: + application/json: + schema: + type: object + properties: + serviceName: + type: string + description: The desired OAuth service name. In this case, `twitter`. + example: twitter + accessToken: + type: string + description: Access token provided by Twitter OAuth. + example: hash + accessTokenSecret: + type: string + description: The access token secret provided by Twitter OAuth. + example: hash + appSecret: + type: string + description: The app secret provided by Twitter. + example: hash + appId: + type: string + description: The app ID provided by Twitter. + example: hash + expiresIn: + type: integer + description: Lifetime of token (in seconds). + example: 200 + required: + - serviceName + - accessToken + - accessTokenSecret + - appSecret + - appId + - expiresIn + x-examples: + Example: + serviceName: twitter + accessToken: hash + accessTokenSecret: hash + appSecret: hash + appId: hash + expiresIn: 200 + examples: + Example: + value: + serviceName: twitter + accessToken: hash + accessTokenSecret: hash + appSecret: hash + appId: hash + expiresIn: 200 + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + properties: + status: + type: string + data: + type: object + properties: + authToken: + type: string + userId: + type: string + me: + type: object + properties: + _id: + type: string + name: + type: string + emails: + type: array + items: + type: object + properties: + address: + type: string + verified: + type: boolean + status: + type: string + statusConnection: + type: string + username: + type: string + utcOffset: + type: integer + active: + type: boolean + roles: + type: array + items: + type: string + settings: + type: object + properties: + preferences: + type: object + avatarUrl: + type: string + x-examples: + Example: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + examples: + Success Example: + value: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + /api/v1/login - with Google: + post: + tags: + - Authentication + summary: Login with Google + description: "### Changelog\n| Version | Description | \n | ---------------- | ------------|\n |1.0.0 | Added `avatarUrl` property to response |\n |0.64.0 | Added `me` property. |\n |0.60.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/login - with Google \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"serviceName\": \"google\",\n \"accessToken\": \"hash\",\n \"idToken\": \"hash\",\n \"expiresIn\": 200,\n \"scope\": \"profile\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"status\": \"success\",\n \"data\": {\n \"authToken\": \"9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq\",\n \"userId\": \"aobEdbYhXfu5hkeqG\",\n \"me\": {\n \"_id\": \"aYjNnig8BEAWeQzMh\",\n \"name\": \"Rocket Cat\",\n \"emails\": [\n {\n \"address\": \"rocket.cat@rocket.chat\",\n \"verified\": false\n }\n ],\n \"status\": \"offline\",\n \"statusConnection\": \"offline\",\n \"username\": \"rocket.cat\",\n \"utcOffset\": -3,\n \"active\": true,\n \"roles\": [\n \"admin\"\n ],\n \"settings\": {\n \"preferences\": {}\n },\n \"avatarUrl\": \"http://localhost:3000/avatar/test\"\n }\n }\n}\n```" + operationId: post-api-v1-login-google + requestBody: + description: '' + content: + application/json: + schema: + type: object + properties: + serviceName: + type: string + description: The desired OAuth service name. In this case, `google`. + accessToken: + type: string + description: Access token provided by Google OAuth. + idToken: + type: string + description: The ID token provided by Google OAuth. + expiresIn: + type: integer + description: Lifetime of token (in seconds). + scope: + type: string + description: Google scopes for API. + required: + - serviceName + - accessToken + - idToken + - expiresIn + x-examples: + Example: + serviceName: google + accessToken: hash + idToken: hash + expiresIn: 200 + scope: profile + examples: + Example: + value: + serviceName: google + accessToken: hash + idToken: hash + expiresIn: 200 + scope: profile + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + properties: + status: + type: string + data: + type: object + properties: + authToken: + type: string + userId: + type: string + me: + type: object + properties: + _id: + type: string + name: + type: string + emails: + type: array + items: + type: object + properties: + address: + type: string + verified: + type: boolean + status: + type: string + statusConnection: + type: string + username: + type: string + utcOffset: + type: integer + active: + type: boolean + roles: + type: array + items: + type: string + settings: + type: object + properties: + preferences: + type: object + avatarUrl: + type: string + x-examples: + Login successful: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + examples: + Success Example: + value: + status: success + data: + authToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + me: + _id: aYjNnig8BEAWeQzMh + name: Rocket Cat + emails: + - address: rocket.cat@rocket.chat + verified: false + status: offline + statusConnection: offline + username: rocket.cat + utcOffset: -3 + active: true + roles: + - admin + settings: + preferences: {} + avatarUrl: http://localhost:3000/avatar/test + /api/v1/logout: + post: + tags: + - Authentication + summary: Logout + description: "Invalidate your REST API authentication token.\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/logout \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\"\n```\n\n### Example success response\n\n```json\n{\n \"status\": \"success\",\n \"data\": {\n \"message\": \"You've been logged out!\"\n }\n}\n```" + operationId: post-api-v1-logout + parameters: + - name: X-Auth-Token + in: header + description: The authorization token of the user + required: true + schema: + type: string + - name: X-User-Id + in: header + description: The user id of the user + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + properties: + status: + type: string + data: + type: object + properties: + message: + type: string + examples: + Example: + value: + status: success + data: + message: You've been logged out! + /api/v1/loginCode.redeem: + post: + tags: + - Authentication + summary: Redeem Login Code + description: "Redeems a one-time OAuth login code and returns the `loginToken` and `userId`. Use these values as the `X-Auth-Token` and `X-User-Id` headers in authenticated requests.\n\nThis endpoint does not require authentication. Each code is single-use, expires after 60 seconds, and is limited to 10 redemption requests per minute per caller.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.7.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/loginCode.redeem \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"code\": \"4f1d2c3b4a5968778695a4b3c2d1e0f1123456789abcdef00fedcba987654321\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"loginToken\": \"9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq\",\n \"userId\": \"aobEdbYhXfu5hkeqG\",\n \"success\": true\n}\n```" + operationId: post-api-v1-loginCode.redeem + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + code: + type: string + minLength: 64 + maxLength: 64 + description: The one-time login code issued by the server-side OAuth flow. + example: 4f1d2c3b4a5968778695a4b3c2d1e0f1123456789abcdef00fedcba987654321 + required: + - code + examples: + Redeem login code: + value: + code: 4f1d2c3b4a5968778695a4b3c2d1e0f1123456789abcdef00fedcba987654321 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + loginToken: + type: string + userId: + type: string + success: + type: boolean + required: + - loginToken + - userId + - success + examples: + Redemption successful: + value: + loginToken: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq + userId: aobEdbYhXfu5hkeqG + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + errorType: + type: string + examples: + Invalid request: + value: + success: false + error: must NOT have fewer than 64 characters [invalid-params] + errorType: invalid-params + Invalid or expired code: + value: + success: false + error: error-invalid-code + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + x-examples: + Authorization Error: + status: error + message: You must be logged in to do this. + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/me: + get: + tags: + - Authentication + summary: Get Profile Information + description: "Quick information about the authenticated user.\n### Changelog\n | Version | Description | \n | ---------------- | ------------|\n |1.0.0 | Added `avatarUrl` property to response |\n |0.68.0 | Added `customFields` property. |\n |0.48.0 | Added |\n\n### Example call\n\n```bash\ncurl -X GET https:///api/v1/me \\\n -H \"X-User-Id: your-user-id\" \\\n -H \"X-Auth-Token: your-auth-token\"\n```\n\n### Example success response\n\n```json\n{\n \"_id\": \"aobEdbYhXfu5hkeqG\",\n \"name\": \"Example User\",\n \"emails\": [\n {\n \"address\": \"example@example.com\",\n \"verified\": true\n }\n ],\n \"status\": \"offline\",\n \"statusConnection\": \"offline\",\n \"username\": \"example\",\n \"utcOffset\": 0,\n \"active\": true,\n \"roles\": [\n \"user\",\n \"admin\"\n ],\n \"settings\": {\n \"preferences\": {\n \"enableAutoAway\": false,\n \"idleTimeoutLimit\": 300,\n \"desktopNotificationDuration\": 0,\n \"audioNotifications\": \"mentions\",\n \"desktopNotifications\": \"mentions\",\n \"mobileNotifications\": \"mentions\",\n \"unreadAlert\": true,\n \"useEmojis\": true,\n \"convertAsciiEmoji\": true,\n \"autoImageLoad\": true,\n \"saveMobileBandwidth\": true,\n \"collapseMediaByDefault\": false,\n \"hideUsernames\": false,\n \"hideRoles\": false,\n \"hideFlexTab\": false,\n \"hideAvatars\": false,\n \"roomsListExhibitionMode\": \"category\",\n \"sidebarViewMode\": \"medium\",\n \"sidebarHideAvatar\": false,\n \"sidebarShowUnread\": false,\n \"sidebarShowFavorites\": true,\n \"sendOnEnter\": \"normal\",\n \"messageViewMode\": 0,\n \"emailNotificationMode\": \"all\",\n \"roomCounterSidebar\": false,\n \"newRoomNotification\": \"door\",\n \"newMessageNotification\": \"chime\",\n \"muteFocusedConversations\": true,\n \"notificationsSoundVolume\": 100\n }\n },\n \"customFields\": {\n \"twitter\": \"@userstwi\"\n },\n \"avatarUrl\": \"http://localhost:3000/avatar/test\",\n \"success\": true\n}\n```" + operationId: get-api-v1-me + parameters: + - name: X-User-Id + in: header + description: The user ID of the user. + required: true + schema: + type: string + - name: X-Auth-Token + in: header + description: The authorization token of the user. + required: true + schema: + type: string + responses: + '200': + description: "OK \n\nThe `customFields` parameter won't be returned if it doesn't exist on the workspace." + content: + application/json: + schema: + type: object + properties: + _id: + type: string + name: + type: string + emails: + type: array + items: + type: object + properties: + address: + type: string + verified: + type: boolean + status: + type: string + statusConnection: + type: string + username: + type: string + utcOffset: + type: integer + active: + type: boolean + roles: + type: array + items: + type: string + settings: + type: object + properties: + preferences: + type: object + properties: + enableAutoAway: + type: boolean + idleTimeoutLimit: + type: integer + desktopNotificationDuration: + type: integer + audioNotifications: + type: string + desktopNotifications: + type: string + mobileNotifications: + type: string + unreadAlert: + type: boolean + useEmojis: + type: boolean + convertAsciiEmoji: + type: boolean + autoImageLoad: + type: boolean + saveMobileBandwidth: + type: boolean + collapseMediaByDefault: + type: boolean + hideUsernames: + type: boolean + hideRoles: + type: boolean + hideFlexTab: + type: boolean + hideAvatars: + type: boolean + roomsListExhibitionMode: + type: string + sidebarViewMode: + type: string + sidebarHideAvatar: + type: boolean + sidebarShowUnread: + type: boolean + sidebarShowFavorites: + type: boolean + sendOnEnter: + type: string + messageViewMode: + type: integer + emailNotificationMode: + type: string + roomCounterSidebar: + type: boolean + newRoomNotification: + type: string + newMessageNotification: + type: string + muteFocusedConversations: + type: boolean + notificationsSoundVolume: + type: integer + customFields: + type: object + properties: + twitter: + type: string + avatarUrl: + type: string + success: + type: boolean + x-examples: + Example 1: + _id: aobEdbYhXfu5hkeqG + name: Example User + emails: + - address: example@example.com + verified: true + status: offline + statusConnection: offline + username: example + utcOffset: 0 + active: true + roles: + - user + - admin + settings: + preferences: + enableAutoAway: false + idleTimeoutLimit: 300 + desktopNotificationDuration: 0 + audioNotifications: mentions + desktopNotifications: mentions + mobileNotifications: mentions + unreadAlert: true + useEmojis: true + convertAsciiEmoji: true + autoImageLoad: true + saveMobileBandwidth: true + collapseMediaByDefault: false + hideUsernames: false + hideRoles: false + hideFlexTab: false + hideAvatars: false + roomsListExhibitionMode: category + sidebarViewMode: medium + sidebarHideAvatar: false + sidebarShowUnread: false + sidebarShowFavorites: true + sendOnEnter: normal + messageViewMode: 0 + emailNotificationMode: all + roomCounterSidebar: false + newRoomNotification: door + newMessageNotification: chime + muteFocusedConversations: true + notificationsSoundVolume: 100 + customFields: + twitter: '@userstwi' + avatarUrl: http://localhost:3000/avatar/test + success: true + examples: + User profile: + value: + _id: aobEdbYhXfu5hkeqG + name: Example User + emails: + - address: example@example.com + verified: true + status: offline + statusConnection: offline + username: example + utcOffset: 0 + active: true + roles: + - user + - admin + settings: + preferences: + enableAutoAway: false + idleTimeoutLimit: 300 + desktopNotificationDuration: 0 + audioNotifications: mentions + desktopNotifications: mentions + mobileNotifications: mentions + unreadAlert: true + useEmojis: true + convertAsciiEmoji: true + autoImageLoad: true + saveMobileBandwidth: true + collapseMediaByDefault: false + hideUsernames: false + hideRoles: false + hideFlexTab: false + hideAvatars: false + roomsListExhibitionMode: category + sidebarViewMode: medium + sidebarHideAvatar: false + sidebarShowUnread: false + sidebarShowFavorites: true + sendOnEnter: normal + messageViewMode: 0 + emailNotificationMode: all + roomCounterSidebar: false + newRoomNotification: door + newMessageNotification: chime + muteFocusedConversations: true + notificationsSoundVolume: 100 + customFields: + twitter: '@userstwi' + avatarUrl: http://localhost:3000/avatar/test + success: true + /api/v1/users.2fa.enableEmail: + post: + tags: + - Two-Factor Authentication + summary: Enable 2FA via Email + description: "Enable email two-factor authentication for your account. This endpoint only works if the user has at least one verified email.\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/users.2fa.enableEmail \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\"\n```\n\n### Example success response\n\n```json\n{\n \"success\": true\n}\n```" + operationId: post-api-v1-users.2fa.enableEmail + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + x-examples: + Success: + success: true + examples: + Success: + value: + success: true + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + x-examples: + Authorization Error: + status: error + message: You must be logged in to do this. + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/users.2fa.sendEmailCode: + parameters: [] + post: + summary: Send 2FA Email Code + operationId: post-api-v1-users.2fa.sendEmailCode + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + x-examples: + Success: + success: true + examples: + Success: + value: + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + errorType: + type: string + examples: + Example 1: + value: + success: false + error: emailOrUsername is required [error-parameter-required] + errorType: error-parameter-required + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + x-examples: + Authorization Error: + status: error + message: You must be logged in to do this. + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + description: "\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/users.2fa.sendEmailCode \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\" \\\n -d '{\n \"emailOrUsername\": \"test@email.com\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"success\": true\n}\n```" + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: false + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: false + schema: + type: string + example: rbAXPnMktTFbNpwtJ + tags: + - Two-Factor Authentication + requestBody: + content: + application/json: + schema: + type: object + properties: + emailOrUsername: + type: string + description: Enter the email or username. + example: test@email.com + required: + - emailOrUsername + examples: + Example 1: + value: + emailOrUsername: test@email.com + /api/v1/users.2fa.disableEmail: + post: + tags: + - Two-Factor Authentication + summary: Disable 2FA via Email + description: "Disable two-factor authentication via email. The 2FA code is required.\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/users.2fa.disableEmail \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\" \\\n -H \"X-2fa-Code: example\" \\\n -H \"X-2fa-method: example\"\n```\n\n### Example success response\n\n```json\n{\n \"success\": true\n}\n```" + operationId: post-api-v1-users.2fa.disableEmail + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + - name: X-2fa-Code + in: header + description: 'The 2FA code. ' + required: true + schema: + type: string + - schema: + type: string + in: header + name: X-2fa-method + description: The 2FA method. It can be `email`, `totp`, or `password`. + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + x-examples: + Success: + success: true + examples: + Success: + value: + success: true + '400': + description: "TOTP Required \n\nThe 2FA code is passed as the `X-2fa-Code` query parameter.\n\nIt's important to note the **required TOTP method** returned from the response.\n\n- If it's `password`, add the hashed password of the user as the `X-2fa-Code` header parameter. \n- If it's `email`, add the 2FA code sent via email as the `X-2fa-Code` header parameter.\n- If it's `totp`, add the code from your authenticator app as the `X-2fa-Code` header parameter." + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + errorType: + type: string + details: + type: object + properties: + method: + type: string + codeGenerated: + type: boolean + availableMethods: + type: array + items: + type: object + examples: + TOTP Required: + value: + success: false + error: TOTP Required [totp-required] + errorType: totp-required + details: + method: password + codeGenerated: false + availableMethods: [] + /api/v1/twoFactorChallenges.sendEmailCode: + post: + tags: + - Two-Factor Authentication + summary: Send Two-Factor Challenge Email Code + description: "Sends a new email code for an OAuth two-factor authentication challenge.\n\nThis endpoint does not require authentication. The challenge must exist, must not be expired, and must use the `email` method. Requests are limited to 5 per minute per caller.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.7.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/twoFactorChallenges.sendEmailCode \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"challengeId\": \"8f4c2d1e9a7b6c5d3e2f1a0b\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"success\": true\n}\n```" + operationId: post-api-v1-twoFactorChallenges.sendEmailCode + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + challengeId: + type: string + description: The ID of the pending two-factor challenge returned by the login flow. + example: 8f4c2d1e9a7b6c5d3e2f1a0b + required: + - challengeId + examples: + Send email code: + value: + challengeId: 8f4c2d1e9a7b6c5d3e2f1a0b + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + x-examples: + Success: + success: true + examples: + Success: + value: + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + errorType: + type: string + examples: + Missing challengeId: + value: + success: false + error: challengeId is required + errorType: error-parameter-required + Challenge not found: + value: + success: false + error: challenge not found + errorType: error-challenge-not-found + Challenge expired: + value: + success: false + error: challenge expired + errorType: error-challenge-expired + Invalid challenge method: + value: + success: false + error: invalid challenge method + errorType: error-invalid-challenge-method + User not found: + value: + success: false + error: user not found + errorType: error-user-not-found + /api/v1/twoFactorChallenges.verifyChallenge: + post: + tags: + - Two-Factor Authentication + summary: Verify Two-Factor Challenge + description: "Verifies the email or TOTP code for an OAuth two-factor authentication challenge and returns the `loginToken` and `userId`.\n\nThis endpoint does not require authentication. Requests are limited to 5 per minute per caller. The challenge is removed when the maximum number of failed attempts is reached.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.7.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/twoFactorChallenges.verifyChallenge \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"challengeId\": \"8f4c2d1e9a7b6c5d3e2f1a0b\",\n \"code\": \"482913\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"loginToken\": \"exampleLoginTokenString123\",\n \"userId\": \"aobEdbYhXfu5hkeqG\",\n \"success\": true\n}\n```" + operationId: post-api-v1-twoFactorChallenges.verifyChallenge + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + challengeId: + type: string + description: The ID of the pending two-factor challenge returned by the login flow. + example: 8f4c2d1e9a7b6c5d3e2f1a0b + code: + type: string + description: The two-factor code provided by the user for the challenge. + example: '482913' + required: + - challengeId + - code + examples: + Verify challenge: + value: + challengeId: 8f4c2d1e9a7b6c5d3e2f1a0b + code: '482913' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + loginToken: + type: string + userId: + type: string + success: + type: boolean + required: + - loginToken + - userId + - success + examples: + Verification successful: + value: + loginToken: exampleLoginTokenString123 + userId: aobEdbYhXfu5hkeqG + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + errorType: + type: string + examples: + Missing parameters: + value: + success: false + error: challengeId and code are required + errorType: error-parameter-required + Invalid code: + value: + success: false + error: Invalid code + errorType: error-invalid-code + Challenge not found: + value: + success: false + error: challenge not found + errorType: error-challenge-not-found + Challenge expired: + value: + success: false + error: challenge expired + errorType: error-challenge-expired + User not found: + value: + success: false + error: user not found + errorType: error-user-not-found + Max attempts reached: + value: + success: false + error: TOTP Maximun Failed Attempts Reached + errorType: totp-max-attempts +tags: +- name: Authentication +- name: Two-Factor Authentication +components: + parameters: + Auth-Token: + name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + Auth-TokenNotRequired: + name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: false + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + UserId: + name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + UserIdNotRequired: + name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: false + schema: + type: string + example: rbAXPnMktTFbNpwtJ + responses: + trueSuccess: + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + x-examples: + Success: + success: true + examples: + Success: + value: + success: true + authorizationError: + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + x-examples: + Authorization Error: + status: error + message: You must be logged in to do this. + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. diff --git a/dist/content-management.yaml b/dist/content-management.yaml new file mode 100644 index 0000000..101c1a5 --- /dev/null +++ b/dist/content-management.yaml @@ -0,0 +1,1895 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Content Management +servers: +- url: https://apiexplorer.support.rocket.chat +paths: + /api/v1/emoji-custom.all: + get: + tags: + - Custom Emoji + summary: List All Custom Emojis + description: "List all custom emojis.\n\n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n|7.11.0 | Added the `name` query parameter |\n|0.63.0 | Added |\n\n### Example call\n\n```bash\ncurl -X GET 'https:///api/v1/emoji-custom.all?name=emoji-one&offset=50&count=50' \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\"\n```\n\n### Example success response\n\n```json\n{\n \"emojis\": [\n {\n \"_id\": \"6542e83aa2f73c7460e18efb\",\n \"name\": \"happy\",\n \"aliases\": [\n \"happy-gang\"\n ],\n \"extension\": \"png\",\n \"_updatedAt\": \"2023-11-02T00:07:22.433Z\"\n }\n ],\n \"count\": 1,\n \"offset\": 0,\n \"total\": 1,\n \"success\": true\n}\n```" + operationId: get-api-v1-emoji-custom.all + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + - schema: + type: string + example: emoji-one + in: query + name: name + description: Enter the emoji name you want to find. This parameter is optional. + - name: offset + in: query + description: Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#paginations) to learn more. + required: false + schema: + type: integer + example: 50 + - name: count + in: query + description: The number of items to return. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more. + required: false + schema: + type: integer + example: 50 + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + emojis: + type: array + items: + type: object + properties: + _id: + type: string + name: + type: string + aliases: + type: array + items: + type: string + extension: + type: string + _updatedAt: + type: string + count: + type: integer + offset: + type: integer + total: + type: integer + success: + type: boolean + examples: + Example: + value: + emojis: + - _id: 6542e83aa2f73c7460e18efb + name: happy + aliases: + - happy-gang + extension: png + _updatedAt: '2023-11-02T00:07:22.433Z' + count: 1 + offset: 0 + total: 1 + success: true + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/emoji-custom.create: + post: + tags: + - Custom Emoji + summary: Create an Emoji + description: "Upload a custom emoji to the workspace. Make sure that you have configured the storage system. For details, refer to the [Manage Custom Sounds and Emojis](https://docs.rocket.chat/docs/manage-custom-sounds-and-emojis) document.\n\nPermission required: `manage-emoji`\n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n|0.74.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/emoji-custom.create \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\" \\\n -d '{\n \"emoji\": \"example\",\n \"name\": \"example\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"success\": true\n}\n```" + operationId: post-api-v1-emoji-custom.create + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + requestBody: + content: + multipart/form-data: + schema: + type: object + required: + - emoji + - name + properties: + emoji: + type: string + description: The image file to use as the new custom emoji. + format: binary + name: + type: string + description: The name of the new custom emoji. + aliases: + type: string + description: The alias of the new custom emoji. You can enter more than one alias as comma-separated values. + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + examples: + Success: + value: + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + examples: + Example 1: + value: + success: false + error: Missing Content-Type + Example 2: + value: + success: false + error: '[No file uploaded]' + errorType: No file uploaded + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/emoji-custom.delete: + post: + tags: + - Custom Emoji + summary: Delete a Custom Emoji + description: "Delete a custom emoji. Permission required: `manage-emoji`\n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n|0.74.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/emoji-custom.delete \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\" \\\n -d '{\n \"emojiId\": \"6542e83aa2f73c7460e18efb\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"success\": true\n}\n```" + operationId: post-api-v1-emoji-custom.delete + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + requestBody: + content: + application/json: + schema: + type: object + required: + - emojiId + properties: + emojiId: + type: string + description: Enter the emoji ID to delete. + examples: + Example: + value: + emojiId: 6542e83aa2f73c7460e18efb + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + examples: + Success: + value: + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + examples: + Example 1: + value: + success: false + error: The "emojiId" params is required! + Example 2: + value: + success: false + error: Invalid emoji [Custom_Emoji_Error_Invalid_Emoji] + errorType: Custom_Emoji_Error_Invalid_Emoji + details: + method: deleteEmojiCustom + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/emoji-custom.list: + get: + tags: + - Custom Emoji + summary: Get Updated List of Custom Emojis + description: "Get a list of updated and removed emojis.\n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n|7.0.0 | Added `_id` and `_updatedAt` query parameter |\n|0.75.0 | Added |\n\n### Example call\n\n```bash\ncurl -X GET 'https:///api/v1/emoji-custom.list?updatedSince=2017-11-25T15:08:17.248Z&_updatedAt=2024-11-02T06:40:43.751Z&_id=6725ca0a101755229a8cb3bf' \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\"\n```\n\n### Example success response\n\n```json\n{\n \"emojis\": {\n \"update\": [\n {\n \"_id\": \"S5XvYppoLrLd9JvQm\",\n \"name\": \"teste\",\n \"aliases\": [],\n \"extension\": \"jpg\",\n \"_updatedAt\": \"2019-02-18T16:48:35.119Z\"\n }\n ],\n \"remove\": [\n {\n \"_id\": \"2dbVBG434dnsdh23\",\n \"name\": \"teste3\",\n \"aliases\": [],\n \"extension\": \"jpg\",\n \"_updatedAt\": \"2019-02-18T16:48:35.119Z\"\n }\n ]\n },\n \"success\": true\n}\n```" + operationId: get-api-v1-emoji-custom.list + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + - name: updatedSince + in: query + description: 'Date since the emojis were updated. Format: ISO string. When you provide the `updatedSince` query parameter in the URL then the `update` and `remove` in the response will contain only those updated and removed since this date and time.' + schema: + type: string + example: '2017-11-25T15:08:17.248Z' + - name: _updatedAt + in: query + description: '' + schema: + type: string + example: '2024-11-02T06:40:43.751Z' + - name: _id + in: query + description: Filter list by custom emoji id. + schema: + type: string + example: 6725ca0a101755229a8cb3bf + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + properties: + emojis: + type: object + properties: + update: + type: array + items: + type: object + properties: + _id: + type: string + name: + type: string + aliases: + type: array + items: + type: object + extension: + type: string + _updatedAt: + type: string + remove: + type: array + items: + type: object + properties: + _id: + type: string + name: + type: string + aliases: + type: array + items: + type: object + extension: + type: string + _updatedAt: + type: string + success: + type: boolean + examples: + Success Example: + value: + emojis: + update: + - _id: S5XvYppoLrLd9JvQm + name: teste + aliases: [] + extension: jpg + _updatedAt: '2019-02-18T16:48:35.119Z' + remove: + - _id: 2dbVBG434dnsdh23 + name: teste3 + aliases: [] + extension: jpg + _updatedAt: '2019-02-18T16:48:35.119Z' + success: true + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/emoji-custom.update: + post: + tags: + - Custom Emoji + summary: Update a Custom Emoji + description: "Update a custom emoji. Permission required: `manage-emoji`\n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n|0.74.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/emoji-custom.update \\\n -H \"Content-Type: application/json\" \\\n -H \"X-User-Id: your-user-id\" \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -d '{\n \"name\": \"my-custom-emoji\",\n \"_id\": \"AG7DSB2H32YHS\",\n \"aliases\": \"emoji-alias\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"success\": true\n}\n```" + operationId: post-api-v1-emoji-custom.update + parameters: + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + requestBody: + description: '' + content: + multipart/form-data: + schema: + type: object + required: + - name + - _id + properties: + emoji: + type: string + description: Upload the emoji file that you want to update as form-data. + name: + type: string + description: Enter the name of the emoji that you want to update. + example: my-custom-emoji + _id: + type: string + description: Enter the emoji ID to be updated. + example: AG7DSB2H32YHS + aliases: + type: string + description: The alias of the custom emoji. You can enter more than one alias as comma-separated values. + example: emoji-alias + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + examples: + Success: + value: + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + errorType: + type: string + examples: + Example 1: + value: + success: false + error: '[The required "_id" query param is missing.]' + errorType: The required "_id" query param is missing. + Example 2: + value: + success: false + error: '[Emoji not found.]' + errorType: Emoji not found. + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/custom-sounds.list: + get: + tags: + - Custom Sounds + summary: List Custom Sounds + description: "List all custom sounds. \n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n| 2.4.0 | Added |\n| 2.4.0 | Added `name` query parameter for filtering. |\n\n### Example call\n\n```bash\ncurl -X GET 'https:///api/v1/custom-sounds.list?offset=50&count=50&name=drill' \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\"\n```\n\n### Example success response\n\n```json\n{\n \"sounds\": [\n {\n \"_id\": \"65462caea2f73c7460e18f83\",\n \"name\": \"doremi\",\n \"extension\": \"mp3\",\n \"_updatedAt\": \"2023-11-04T11:36:14.171Z\"\n }\n ],\n \"count\": 1,\n \"offset\": 0,\n \"total\": 1,\n \"success\": true\n}\n```" + operationId: get-api-v1-custom-sounds.list + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + - name: offset + in: query + description: Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#paginations) to learn more. + required: false + schema: + type: integer + example: 50 + - name: count + in: query + description: The number of items to return. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more. + required: false + schema: + type: integer + example: 50 + - name: query + in: query + description: 'This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": query={ "name": { "$regex": "g" } }. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#query-and-fields) to learn more.' + required: false + schema: {} + - name: name + in: query + description: Filter list by the name of the custom sound. + schema: + type: string + example: drill + - schema: {} + in: query + name: sort + description: "Sort the results in ascending (`1`) or descending (`-1`) order. The options are:\n * `name`: Sort the results by name. For example, `sort={\"name\": 1}` (default) or `sort={\"name\": -1}`.\n * `_id`: Sort by ID. For example, `sort={\"_id\": 1}` or `sort={\"_id\": -1}`." + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + sounds: + type: array + items: + type: object + properties: + _id: + type: string + name: + type: string + extension: + type: string + _updatedAt: + type: string + count: + type: integer + offset: + type: integer + total: + type: integer + success: + type: boolean + examples: + Success: + value: + sounds: + - _id: 65462caea2f73c7460e18f83 + name: doremi + extension: mp3 + _updatedAt: '2023-11-04T11:36:14.171Z' + count: 1 + offset: 0 + total: 1 + success: true + '401': + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + status: + type: string + message: + type: string + examples: + Authorization Error: + value: + status: error + message: You must be logged in to do this. + /api/v1/custom-sounds.create: + post: + tags: + - Custom Sounds + summary: Create Custom Sound + description: "Upload a new custom sound to the workspace.\n\n- The request must be sent as `multipart/form-data` and contain the audio file in the `sound` field and the display name in the `name` field.\n\n- The file size must not exceed `5 MB` (5242880 bytes), and the file MIME type must be one of `audio/mpeg`, `audio/mp3`, `audio/wav`, or `audio/x-wav`.\n\nThis endpoint replaces the deprecated DDP methods `insertOrUpdateSound` and `uploadCustomSound`, which will be removed in `9.0.0`.\n\nPermission required: `manage-sounds`\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.5.0 | Added |\n\n### Example call\n\n```bash\ncurl -X POST https:///api/v1/custom-sounds.create \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Auth-Token: your-auth-token\" \\\n -H \"X-User-Id: your-user-id\" \\\n -d '{\n \"name\": \"doremi\"\n}'\n```\n\n### Example success response\n\n```json\n{\n \"sound\": {\n \"_id\": \"65462caea2f73c7460e18f83\"\n },\n \"success\": true\n}\n```" + operationId: post-api-v1-custom-sounds.create + parameters: + - name: X-Auth-Token + in: header + description: The `authToken` of the authenticated user. + required: true + schema: + type: string + example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f + - name: X-User-Id + in: header + description: The `userId` of the authenticated user. + required: true + schema: + type: string + example: rbAXPnMktTFbNpwtJ + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + sound: + type: string + format: binary + description: The audio file to upload. Allowed MIME types are `audio/mpeg`, `audio/mp3`, `audio/wav`, and `audio/x-wav`. Maximum size is `5 MB` (5242880 bytes). + name: + type: string + description: The display name of the custom sound. Must be at least one character long and must not contain colons, whitespace, or the characters `,`, `>`, `<`, `&`, `"`, `'`, `/`, `\`, `(`, or `)`. + example: doremi + required: + - sound + - name + examples: + Example: + value: + name: doremi + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + sound: + type: object + properties: + _id: + type: string + success: + type: boolean + examples: + Success Example: + value: + sound: + _id: 65462caea2f73c7460e18f83 + success: true + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + error: + type: string + errorType: + type: string + examples: + MIME type not allowed: + value: + success: false + error: MIME type not allowed + File too large: + value: + success: false + error: '[error-file-too-large]' + Name already in use: + value: + success: false + error: The custom sound name is already in use [Custom_Sound_Error_Name_Already_In_Use] + Invalid name: + value: + success: false + error: