> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Create or Update a Canned Response >
Enterprise
To create and update canned responses, the following permissions are required: * `save-canned-responses` * `save-all-canned-responses` ### Changelog | Version | Description | | ------------ | ------------| |1.0.0 | Added | ## OpenAPI ````json POST /api/v1/canned-responses { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Omnichannel" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Omnichannel Users" }, { "name": "Omnichannel Agents" }, { "name": "Omnichannel Monitors" }, { "name": "Omnichannel Visitors" }, { "name": "Omnichannel Contacts" }, { "name": "Omnichannel Rooms" }, { "name": "Omnichannel Departments" }, { "name": "Omnichannel Custom Fields" }, { "name": "Omnichannel Business Hours" }, { "name": "Omnichannel Priorities" }, { "name": "Omnichannel Tags" }, { "name": "Omnichannel Units" }, { "name": "SLA Policies" }, { "name": "Canned Responses" }, { "name": "Omnichannel Transcript" }, { "name": "Omnichannel Statistics" }, { "name": "Omnichannel Agent Stats" }, { "name": "Omnichannel Dashboards" }, { "name": "Reports" }, { "name": "Omnichannel Inquiries" }, { "name": "Omnichannel Webhooks" }, { "name": "Livechat" }, { "name": "Livechat Appearance" }, { "name": "Livechat Triggers" }, { "name": "Livechat Messages" }, { "name": "Livechat Page Visited" } ], "paths": { "/api/v1/canned-responses": { "post": { "tags": [ "Canned Responses" ], "summary": "Create or Update a Canned Response", "description": "
\"Enterprise\"
\n\nTo create and update canned responses, the following permissions are required:\n* `save-canned-responses`\n* `save-all-canned-responses`\n\n### Changelog\n| Version | Description |\n| ------------ | ------------|\n|1.0.0 | Added |", "operationId": "post-api-v1-canned-responses", "parameters": [ { "$ref": "#/components/parameters/AuthToken" }, { "$ref": "#/components/parameters/UserId" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "required": [ "shortcut", "text", "scope" ], "properties": { "shortcut": { "type": "string", "description": "The shortcut to trigger the message snippet." }, "text": { "type": "string", "description": "The message snippet." }, "scope": { "type": "string", "description": "The scope of the canned response. It can either be global, user or department." }, "tags": { "type": "array", "description": "The tags for your canned response.", "items": { "type": "string" } }, "departmentId": { "type": "string", "description": "The departmentId where the canned response belongs to. It is required if the scope is department." }, "_id": { "type": "string", "description": "The canned response's ID." } } }, "examples": { "Example 1": { "value": { "shortcut": "test-canned", "text": "This is an example test for canned response", "scope": "global", "tags": [ "tag1", "tag2" ] } } } } }, "description": "Note: To update a canned response, the `_id` parameter is required along with the other required parameters. This parameter is not used to create a canned response." }, "responses": { "200": { "$ref": "#/components/responses/trueSuccess" }, "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": "must have required property 'shortcut' [invalid-params]", "errorType": "invalid-params" } }, "Example 2": { "value": { "success": "false", "error": "must have required property 'scope' [invalid-params]", "errorType": "invalid-params" } }, "Example 3": { "value": { "success": "false", "error": "Shortcut provided already exists [error-invalid-shortcut]", "errorType": "error-invalid-shortcut", "details": { "method": "saveCannedResponse" } } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" }, "403": { "$ref": "#/components/responses/permissionError" } } } } }, "components": { "parameters": { "AuthToken": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": "true", "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" } }, "responses": { "trueSuccess": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }, "examples": { "Success": { "value": { "success": "true" } } } } } }, "authorizationError": { "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." } } } } } }, "permissionError": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Permission Error": { "value": { "success": "false", "error": "User does not have the permissions required for this action [error-unauthorized]" } }, "Unauthorized": { "value": { "success": "false", "error": "unauthorized" } } } } } } } } } ````