Claim a letter for editing
const url = 'https://api.tryletterhead.com/api/v3/letters/example/claim';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"claimant":"{\"uniqueId\":\"user-abc123\",\"name\":\"Jane Doe\"}"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/letters/example/claim \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "claimant": "{\"uniqueId\":\"user-abc123\",\"name\":\"Jane Doe\"}" }'Claim a letter for editing so other editors are warned it’s in use. claimant is a JSON-encoded
string identifying who’s claiming it — it must decode to an object carrying at minimum a
uniqueId field identifying the claiming editor.
If the letter is already claimed by someone else, the claim fails and the response names the current claimant.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The letter’s unique identifier — an alphanumeric string around ten characters, e.g. ludctamgd6.
Request Body required
Section titled “Request Body required ”object
A JSON-encoded object that must include a uniqueId field, e.g. '{"uniqueId":"user-abc123","name":"Jane Doe"}'.
Example
{ "claimant": "{\"uniqueId\":\"user-abc123\",\"name\":\"Jane Doe\"}"}Responses
Section titled “ Responses ”Claim succeeded
Example
This letter's all yours. Enjoy.The claimant value is malformed — it didn’t decode to an object with a uniqueId.
The letter is already claimed by someone else. The response body names the current claimant.
Still can’t find what you need? Contact support.