> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://esendex.ferndocs.com/api-reference/templates/patch-template/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://esendex.ferndocs.com/_mcp/server. # Patch template PATCH http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/{templateId} Content-Type: application/json Reference: https://esendex.ferndocs.com/api-reference/templates/patch-template ## Authentication - `X-API-Key` header (required) — Your Esendex API key. ## Request ### Path parameters - `templateId` (string, required) ### Headers - `AccountReference` (string, required) — Mandatory AccountReference header ### Body (application/json) This endpoint expects a list of PatchTemplateV3Operation. - `list of PatchTemplateV3Operation` ## Response ### 200 OK - `data` (PatchTemplateV3Response, optional, nullable) - `errors` (list of ErrorDto, optional, nullable) ## Errors ### 400 Bad Request Error Bad Request - `errors` (list of ErrorDto, optional, nullable) ### 404 Not Found Error Not Found - `errors` (list of ErrorDto, optional, nullable) ### 409 Conflict Error Conflict - `errors` (list of ErrorDto, optional, nullable) ## Types ### PatchTemplateV3Operation - `op` (string, optional, nullable) - `path` (string, optional, nullable) - `from` (string, optional, nullable) - `value` (any, optional, nullable) — Arbitrary JSON value. ### PatchTemplateV3Response - `id` (string, optional) - `createTimestamp` (datetime, optional) - `lastUpdateTimestamp` (datetime, optional) - `name` (string, optional, nullable) - `content` (PatchTemplateV3ResponseContent, optional) - `accountReference` (string, optional, nullable) - `createdBy` (string, optional) - `lastUpdatedBy` (string, optional) - `type` (enum, optional) - Allowed values: `None`, `Text`, `RichCard`, `Media` - `messageType` (enum, optional) - Allowed values: `None`, `MarketingAndResearch`, `NotificationsAndReminders`, `AuthenticationAndSecurity`, `PaymentsAndCollections`, `InternalOperations`, `CustomerSupport`, `Unknown` - `channelSettings` (list of PatchTemplateV3ResponseChannelSettingsItems, optional, nullable) - `variables` (list of PatchTemplateV3ResponseVariablesItems, optional) - `isLocked` (boolean, optional) - `tags` (list of PatchTemplateV3ResponseTagsItems, optional) - `approvalState` (enum, optional) - Allowed values: `Pending`, `Approved`, `Rejected` - `smsFallbackSettings` (PatchTemplateV3ResponseSmsFallbackSettings, optional) ### ErrorDto - `errorCode` (string, required) - `errorMessage` (string, required) - `metadata` (map from string to string, optional, nullable) ### PatchTemplateV3ResponseContent - `text` (PatchTemplateV3ResponseContentText, optional) - `richCard` (PatchTemplateV3ResponseContentRichCard, optional) - `file` (PatchTemplateV3ResponseContentFile, optional) - `conversationButtons` (list of PatchTemplateV3ResponseContentConversationButtonsItems, optional) ### PatchTemplateV3ResponseChannelSettingsItems - `channel` (enum, optional) - Allowed values: `None`, `Sms`, `Rcs`, `Whatsapp` - `settings` (string, optional, nullable) ### PatchTemplateV3ResponseVariablesItems - `key` (string, optional, nullable) ### PatchTemplateV3ResponseTagsItems - `id` (string, optional) - `text` (string, optional, nullable) ### PatchTemplateV3ResponseSmsFallbackSettings - `characterSet` (string, optional, nullable) - `fallbackMessage` (string, optional, nullable) - `shortenUrlBrand` (string, optional, nullable) ### PatchTemplateV3ResponseContentText - `value` (string, optional, nullable) ### PatchTemplateV3ResponseContentRichCard - `config` (any, optional) - `cards` (list of PatchTemplateV3ResponseContentRichCardCardsItems, optional) - `preferredStyling` (map from string to string, optional, nullable) ### PatchTemplateV3ResponseContentFile - `fileUrl` (string, optional, nullable) - `fileName` (string, optional, nullable) - `text` (string, optional, nullable) - `sizeBytes` (PatchTemplateV3ResponseContentFileSizeBytes, optional) - `contentType` (string, optional, nullable) ### PatchTemplateV3ResponseContentConversationButtonsItems - `id` (string, optional, nullable) - `web` (PatchTemplateV3ResponseContentConversationButtonsItemsWeb, optional) - `phone` (PatchTemplateV3ResponseContentConversationButtonsItemsPhone, optional) - `location` (PatchTemplateV3ResponseContentConversationButtonsItemsLocation, optional) - `calendar` (PatchTemplateV3ResponseContentConversationButtonsItemsCalendar, optional) - `text` (string, optional, nullable) - `payment` (PatchTemplateV3ResponseContentConversationButtonsItemsPayment, optional) - `reply` (PatchTemplateV3ResponseContentConversationButtonsItemsReply, optional) - `reportTag` (string, optional, nullable) - `preferredStyling` (map from string to string, optional, nullable) - `order` (PatchTemplateV3ResponseContentConversationButtonsItemsOrder, optional) - `metadata` (PatchTemplateV3ResponseContentConversationButtonsItemsMetadata, optional) ### PatchTemplateV3ResponseContentRichCardCardsItems - `header` (PatchTemplateV3ResponseContentRichCardCardsItemsHeader, optional) - `title` (string, optional, nullable) - `description` (string, optional, nullable) - `buttons` (list of PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItems, optional) ### PatchTemplateV3ResponseContentFileSizeBytes ### PatchTemplateV3ResponseContentConversationButtonsItemsWeb - `url` (string, optional, nullable) ### PatchTemplateV3ResponseContentConversationButtonsItemsPhone - `msisdn` (string, optional, nullable) ### PatchTemplateV3ResponseContentConversationButtonsItemsLocation - `label` (string, optional, nullable) - `lat` (string, optional, nullable) - `lng` (string, optional, nullable) - `variableName` (string, optional, nullable) ### PatchTemplateV3ResponseContentConversationButtonsItemsCalendar - `title` (string, optional, nullable) - `description` (string, optional, nullable) - `startAtUtc` (string, optional, nullable) - `endAtUtc` (string, optional, nullable) - `variableName` (string, optional, nullable) ### PatchTemplateV3ResponseContentConversationButtonsItemsPayment - `requestId` (string, optional, nullable) - `lineItems` (list of PatchTemplateV3ResponseContentConversationButtonsItemsPaymentLineItemsItems, optional) - `currency` (string, optional, nullable) - `paymentMethod` (PatchTemplateV3ResponseContentConversationButtonsItemsPaymentPaymentMethod, optional) ### PatchTemplateV3ResponseContentConversationButtonsItemsReply - `text` (string, optional, nullable) ### PatchTemplateV3ResponseContentConversationButtonsItemsOrder ### PatchTemplateV3ResponseContentConversationButtonsItemsMetadata - `public` (map from string to string, optional, nullable) - `private` (any, optional) ### PatchTemplateV3ResponseContentRichCardCardsItemsHeader - `adaptiveCard` (any, optional) - `file` (PatchTemplateV3ResponseContentRichCardCardsItemsHeaderFile, optional) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItems - `id` (string, optional, nullable) - `web` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsWeb, optional) - `phone` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPhone, optional) - `location` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsLocation, optional) - `calendar` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsCalendar, optional) - `text` (string, optional, nullable) - `payment` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPayment, optional) - `reply` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsReply, optional) - `reportTag` (string, optional, nullable) - `preferredStyling` (map from string to string, optional, nullable) - `order` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsOrder, optional) - `metadata` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsMetadata, optional) ### PatchTemplateV3ResponseContentConversationButtonsItemsPaymentLineItemsItems - `type` (string, optional, nullable) - `text` (string, optional, nullable) - `subText` (string, optional, nullable) - `amount` (PatchTemplateV3ResponseContentConversationButtonsItemsPaymentLineItemsItemsAmount, optional) ### PatchTemplateV3ResponseContentConversationButtonsItemsPaymentPaymentMethod - `merchantId` (string, optional, nullable) - `merchantName` (string, optional, nullable) - `acceptedCards` (list of string, optional) - `countryCodes` (list of string, optional) - `billingAddressRequired` (boolean, optional) - `tokenisationData` (PatchTemplateV3ResponseContentConversationButtonsItemsPaymentPaymentMethodTokenisationData, optional) ### PatchTemplateV3ResponseContentRichCardCardsItemsHeaderFile - `fileUrl` (string, optional, nullable) - `fileName` (string, optional, nullable) - `text` (string, optional, nullable) - `sizeBytes` (PatchTemplateV3ResponseContentRichCardCardsItemsHeaderFileSizeBytes, optional) - `contentType` (string, optional, nullable) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsWeb - `url` (string, optional, nullable) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPhone - `msisdn` (string, optional, nullable) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsLocation - `label` (string, optional, nullable) - `lat` (string, optional, nullable) - `lng` (string, optional, nullable) - `variableName` (string, optional, nullable) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsCalendar - `title` (string, optional, nullable) - `description` (string, optional, nullable) - `startAtUtc` (string, optional, nullable) - `endAtUtc` (string, optional, nullable) - `variableName` (string, optional, nullable) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPayment - `requestId` (string, optional, nullable) - `lineItems` (list of PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentLineItemsItems, optional) - `currency` (string, optional, nullable) - `paymentMethod` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentPaymentMethod, optional) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsReply - `text` (string, optional, nullable) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsOrder ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsMetadata - `public` (map from string to string, optional, nullable) - `private` (any, optional) ### PatchTemplateV3ResponseContentConversationButtonsItemsPaymentLineItemsItemsAmount ### PatchTemplateV3ResponseContentConversationButtonsItemsPaymentPaymentMethodTokenisationData - `type` (string, optional, nullable) - `tokenisationParameters` (map from string to string, optional, nullable) ### PatchTemplateV3ResponseContentRichCardCardsItemsHeaderFileSizeBytes ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentLineItemsItems - `type` (string, optional, nullable) - `text` (string, optional, nullable) - `subText` (string, optional, nullable) - `amount` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentLineItemsItemsAmount, optional) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentPaymentMethod - `merchantId` (string, optional, nullable) - `merchantName` (string, optional, nullable) - `acceptedCards` (list of string, optional) - `countryCodes` (list of string, optional) - `billingAddressRequired` (boolean, optional) - `tokenisationData` (PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentPaymentMethodTokenisationData, optional) ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentLineItemsItemsAmount ### PatchTemplateV3ResponseContentRichCardCardsItemsButtonsItemsPaymentPaymentMethodTokenisationData - `type` (string, optional, nullable) - `tokenisationParameters` (map from string to string, optional, nullable) ## Examples **Request** ```json [ {} ] ``` **Response** ```json { "data": null, "errors": null } ``` **SDK Code** ```python import requests url = "http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId" payload = [{}] headers = { "AccountReference": "AccountReference", "X-API-Key": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId'; const options = { method: 'PATCH', headers: { AccountReference: 'AccountReference', 'X-API-Key': '', 'Content-Type': 'application/json' }, body: '[{}]' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId" payload := strings.NewReader("[\n {}\n]") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("AccountReference", "AccountReference") req.Header.Add("X-API-Key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Patch.new(url) request["AccountReference"] = 'AccountReference' request["X-API-Key"] = '' request["Content-Type"] = 'application/json' request.body = "[\n {}\n]" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId") .header("AccountReference", "AccountReference") .header("X-API-Key", "") .header("Content-Type", "application/json") .body("[\n {}\n]") .asString(); ``` ```php request('PATCH', 'http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId', [ 'body' => '[ {} ]', 'headers' => [ 'AccountReference' => 'AccountReference', 'Content-Type' => 'application/json', 'X-API-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId"); var request = new RestRequest(Method.PATCH); request.AddHeader("AccountReference", "AccountReference"); request.AddHeader("X-API-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "[\n {}\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "AccountReference": "AccountReference", "X-API-Key": "", "Content-Type": "application/json" ] let parameters = [[]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "http://gateway-api.e97e9e55a5d242f9a139.uksouth.aksapp.io/v3/templates/templateId")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```