Update Cover Letter
curl --request PATCH \
--url https://api.mokaru.ai/v1/cover-letter/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>",
"templateId": "<string>",
"isDefault": true,
"variables": {},
"showName": true,
"showEmail": true,
"showPhone": true,
"showAddress": true,
"headerAlignment": "<string>",
"fontFamily": "<string>",
"fontSize": 123,
"lineSpacing": 123
}
'import requests
url = "https://api.mokaru.ai/v1/cover-letter/{id}"
payload = {
"title": "<string>",
"content": "<string>",
"templateId": "<string>",
"isDefault": True,
"variables": {},
"showName": True,
"showEmail": True,
"showPhone": True,
"showAddress": True,
"headerAlignment": "<string>",
"fontFamily": "<string>",
"fontSize": 123,
"lineSpacing": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
content: '<string>',
templateId: '<string>',
isDefault: true,
variables: {},
showName: true,
showEmail: true,
showPhone: true,
showAddress: true,
headerAlignment: '<string>',
fontFamily: '<string>',
fontSize: 123,
lineSpacing: 123
})
};
fetch('https://api.mokaru.ai/v1/cover-letter/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mokaru.ai/v1/cover-letter/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'content' => '<string>',
'templateId' => '<string>',
'isDefault' => true,
'variables' => [
],
'showName' => true,
'showEmail' => true,
'showPhone' => true,
'showAddress' => true,
'headerAlignment' => '<string>',
'fontFamily' => '<string>',
'fontSize' => 123,
'lineSpacing' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mokaru.ai/v1/cover-letter/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"templateId\": \"<string>\",\n \"isDefault\": true,\n \"variables\": {},\n \"showName\": true,\n \"showEmail\": true,\n \"showPhone\": true,\n \"showAddress\": true,\n \"headerAlignment\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"fontSize\": 123,\n \"lineSpacing\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mokaru.ai/v1/cover-letter/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"templateId\": \"<string>\",\n \"isDefault\": true,\n \"variables\": {},\n \"showName\": true,\n \"showEmail\": true,\n \"showPhone\": true,\n \"showAddress\": true,\n \"headerAlignment\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"fontSize\": 123,\n \"lineSpacing\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mokaru.ai/v1/cover-letter/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"templateId\": \"<string>\",\n \"isDefault\": true,\n \"variables\": {},\n \"showName\": true,\n \"showEmail\": true,\n \"showPhone\": true,\n \"showAddress\": true,\n \"headerAlignment\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"fontSize\": 123,\n \"lineSpacing\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>"
}Cover Letters
Update Cover Letter
Update a cover letter - only provided fields change
PATCH
/
v1
/
cover-letter
/
{id}
Update Cover Letter
curl --request PATCH \
--url https://api.mokaru.ai/v1/cover-letter/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"content": "<string>",
"templateId": "<string>",
"isDefault": true,
"variables": {},
"showName": true,
"showEmail": true,
"showPhone": true,
"showAddress": true,
"headerAlignment": "<string>",
"fontFamily": "<string>",
"fontSize": 123,
"lineSpacing": 123
}
'import requests
url = "https://api.mokaru.ai/v1/cover-letter/{id}"
payload = {
"title": "<string>",
"content": "<string>",
"templateId": "<string>",
"isDefault": True,
"variables": {},
"showName": True,
"showEmail": True,
"showPhone": True,
"showAddress": True,
"headerAlignment": "<string>",
"fontFamily": "<string>",
"fontSize": 123,
"lineSpacing": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
content: '<string>',
templateId: '<string>',
isDefault: true,
variables: {},
showName: true,
showEmail: true,
showPhone: true,
showAddress: true,
headerAlignment: '<string>',
fontFamily: '<string>',
fontSize: 123,
lineSpacing: 123
})
};
fetch('https://api.mokaru.ai/v1/cover-letter/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mokaru.ai/v1/cover-letter/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'content' => '<string>',
'templateId' => '<string>',
'isDefault' => true,
'variables' => [
],
'showName' => true,
'showEmail' => true,
'showPhone' => true,
'showAddress' => true,
'headerAlignment' => '<string>',
'fontFamily' => '<string>',
'fontSize' => 123,
'lineSpacing' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mokaru.ai/v1/cover-letter/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"templateId\": \"<string>\",\n \"isDefault\": true,\n \"variables\": {},\n \"showName\": true,\n \"showEmail\": true,\n \"showPhone\": true,\n \"showAddress\": true,\n \"headerAlignment\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"fontSize\": 123,\n \"lineSpacing\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.mokaru.ai/v1/cover-letter/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"templateId\": \"<string>\",\n \"isDefault\": true,\n \"variables\": {},\n \"showName\": true,\n \"showEmail\": true,\n \"showPhone\": true,\n \"showAddress\": true,\n \"headerAlignment\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"fontSize\": 123,\n \"lineSpacing\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mokaru.ai/v1/cover-letter/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"templateId\": \"<string>\",\n \"isDefault\": true,\n \"variables\": {},\n \"showName\": true,\n \"showEmail\": true,\n \"showPhone\": true,\n \"showAddress\": true,\n \"headerAlignment\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"fontSize\": 123,\n \"lineSpacing\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "<string>"
}Overview
Update any field on a cover letter. Only fields you include in the request are modified.Plus plan only. Returns
403 with { requiresUpgrade: true } if the user is on the free plan.Scope required:
cover-letter:write | Rate limit: 20 requests/minRequest
PATCH /v1/cover-letter/{id}
Path Parameters
string
required
Cover letter id
Body Parameters
All fields are optional. At least one must be provided.string
Cover letter title.
string
Body text.
string
Cover letter template id. Pass
null to clear.boolean
Promote to default cover letter (unsets any existing default).
object
Template-variable map. Pass
null to clear all variables.boolean
Header: show name.
boolean
Header: show email.
boolean
Header: show phone.
boolean
Header: show address.
string
left | center | right.string
Font family.
number
Font size in pt.
number
Line spacing.
Example
curl -X PATCH "https://api.mokaru.ai/v1/cover-letter/clx_cl_abc" \
-H "Authorization: Bearer mk_your_key" \
-H "Content-Type: application/json" \
-d '{ "variables": { "company": "Stripe", "contactPerson": "John Smith" } }'
Response
boolean
Whether the update succeeded.
string
The cover letter ID.
{ "success": true, "id": "clx_cl_abc" }
Was this page helpful?
⌘I
