Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Partially update organization letter

What this endpoint does: Updates specific fields of an existing organization letter. Only the fields you provide will be updated; all other fields remain unchanged. This allows you to make targeted changes without resubmitting the entire letter.

What can be updated:

  • Organization ID: Change which organization the letter belongs to
  • Member ID: Link/unlink the letter to a specific member (use null to clear the member association)
  • Subject: Update the letter title
  • Date of letter: Change the date shown on the letter
  • Address type: Switch between organization address and member address
  • Body content: Update the letter text

Content formatting: Accepts Markdown or HTML for complex formatting. This content is rendered by the Leadtime rich editor, not by a plain Markdown viewer.

For quick/simple text, Markdown is acceptable. For polished user-facing content from an agent or integration, prefer structured HTML because it preserves editor blocks, links, and layout more predictably.

Use only the nodes and marks documented below for this field. Supported editor features differ by endpoint and field. Choose formatting for readability, not decoration: use headings for real sections, paragraphs for narrative text, lists or tables for structured facts, blockquotes for quoted context, callouts for important outcomes/risks/notes when supported, and explicit anchors for links. Do not rely on bare URLs or Markdown links when the link must be clickable; use explicit anchors such as <a href=“https://example.com” target=“_blank” rel=“noopener noreferrer nofollow”>link text</a>.

In HTML you can use:

Node Types and Marks

Nodes

paragraph Type: block Content: inline* (inline only — do not use block tags such as <p> inside; use e.g. <br>, <strong>, <em>, <span>…) Default paragraph. extraPlaceholder is an internal structure for the editor to show a ghost placeholder in empty “template” lines (ProseMirror JSON fragment or null). For normal agent output leave extraPlaceholder as null. Only set it if you are intentionally mirroring a field placeholder the user already has in the open editor; do not set random placeholder data for free-form answers. Atts:

  • extraPlaceholder: null
<p class="paragraph-base" extraplaceholder="null/some-value"></p>

heading Type: block Content: inline* (inline only — do not use block tags such as <p> inside; use e.g. <br>, <strong>, <em>, <span>…) Atts:

  • level: 1
<h1 class="heading-base"></h1>

bulletList Type: block list Content: listItem+ Atts: none

<ul class="list-base"><li></li></ul>

hardBreak Type: inline Atts: none

<br>

horizontalRule Type: block Atts: none

<hr class="hr-base">

orderedList Type: block list Content: listItem+ Atts:

  • start: 1
  • type: null
<ol class="order-list-base" type="null/some-value"><li></li></ol>

listItem Content: (paragraph|list)* (paragraphs and/or lists, in any order) Atts: none

<li></li>

blockquote Type: block Content: block+ (one or more block child nodes (e.g. paragraph, list, …)) Atts: none

<blockquote class="blockquote-base"><p class="paragraph-base"></p></blockquote>

variable Type: inline Document/template variable token (span with data-type=“variable” and data-id).

  • id: Variable key, often scoped (e.g. currentUser.firstName, project.name). Only use keys that exist for the document type you are in; product docs list the allowed variable ids. Do not invent new variable names in HTML for production templates. Atts:
  • id: null
<span data-type="variable" data-id="null/some-value" id="null/some-value"></span>

Marks

link Atts:

  • href: null
  • target: _blank
  • rel: noopener noreferrer nofollow
  • class: null
  • title: null
<a target="_blank" rel="noopener noreferrer nofollow" href="">link text example</a>

bold Atts: none

<strong>bold text example</strong>

code Atts: none

<code>code text example</code>

italic Atts: none

<em>italic text example</em>

strike Atts: none

<s>strike text example</s>

underline Atts: none

<u>underline text example</u>

Available Template Variables

You can use the following variables in your organization letter body. Variables are represented as HTML spans:

clientCompanyName, contactPerson, senderNameAndPosition, senderName, senderPosition, todayDate, dearCustomer, signature

Example HTML: <span data-type="variable" data-id="clientCompanyName">ACME Corp</span>, <span data-type="variable" data-id="contactPerson">John Doe</span>

Validation rules:

  • Letter must exist and be accessible in your workspace
  • If organization ID is provided, it must exist and be accessible
  • If member ID is provided (or set to null), the member must belong to the specified organization (or the letter’s current organization if organization ID is not being updated)
  • All field validations from the create endpoint apply to updated fields

How partial updates work:

  • Fields not provided in the request remain unchanged
  • If you provide memberId: null, it clears the member association
  • Body content is automatically converted from HTML/Markdown to internal format (IDoc) if provided
  • The lastUpdated timestamp is automatically updated

Use cases:

  • Correct typos or update letter content
  • Change the recipient (member) of an existing letter
  • Update letter date if backdating is needed
  • Modify letter subject or address type

Note: Requires writeLetters permission on the Organizations resource.

PATCH/organizations/letters/{id}
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstringrequired
Query parameters
fieldsToReturnstring
Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestring
Advanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:compactfull
Header parameters
LT-Response-Shapestring
Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:full
Request body
requiredapplication/json
addressTypeobject
Optional: The address type for the letter. Use "Organization" for the organization's main address, or "Member" for the member's private address. If provided, updates the address type. Omit to leave unchanged.
Show properties
object
bodystring
Accepts Markdown or HTML for complex formatting. This content is rendered by the Leadtime rich editor, not by a plain Markdown viewer. For quick/simple text, Markdown is acceptable. For polished user-facing content from an agent or integration, prefer structured HTML because it preserves editor blocks, links, and layout more predictably. Use only the nodes and marks documented below for this field. Supported editor features differ by endpoint and field. Choose formatting for readability, not decoration: use headings for real sections, paragraphs for narrative text, lists or tables for structured facts, blockquotes for quoted context, callouts for important outcomes/risks/notes when supported, and explicit anchors for links. Do not rely on bare URLs or Markdown links when the link must be clickable; use explicit anchors such as <a href="https://example.com" target="_blank" rel="noopener noreferrer nofollow">link text</a>. In HTML you can use: ## Node Types and Marks ### Nodes **paragraph** Type: block Content: inline* (inline only — do not use block tags such as <p> inside; use e.g. <br>, <strong>, <em>, <span>…) Default paragraph. extraPlaceholder is an internal structure for the editor to show a ghost placeholder in empty “template” lines (ProseMirror JSON fragment or null). For normal agent output leave extraPlaceholder as null. Only set it if you are intentionally mirroring a field placeholder the user already has in the open editor; do not set random placeholder data for free-form answers. Atts: - extraPlaceholder: null ```html <p class="paragraph-base" extraplaceholder="null/some-value"></p> ``` **heading** Type: block Content: inline* (inline only — do not use block tags such as <p> inside; use e.g. <br>, <strong>, <em>, <span>…) Atts: - level: 1 ```html <h1 class="heading-base"></h1> ``` **bulletList** Type: block list Content: listItem+ Atts: none ```html <ul class="list-base"><li></li></ul> ``` **hardBreak** Type: inline Atts: none ```html <br> ``` **horizontalRule** Type: block Atts: none ```html <hr class="hr-base"> ``` **orderedList** Type: block list Content: listItem+ Atts: - start: 1 - type: null ```html <ol class="order-list-base" type="null/some-value"><li></li></ol> ``` **listItem** Content: (paragraph|list)* (paragraphs and/or lists, in any order) Atts: none ```html <li></li> ``` **blockquote** Type: block Content: block+ (one or more block child nodes (e.g. paragraph, list, …)) Atts: none ```html <blockquote class="blockquote-base"><p class="paragraph-base"></p></blockquote> ``` **variable** Type: inline Document/template variable token (span with data-type="variable" and data-id). - id: Variable key, often scoped (e.g. currentUser.firstName, project.name). Only use keys that exist for the document type you are in; product docs list the allowed variable ids. Do not invent new variable names in HTML for production templates. Atts: - id: null ```html <span data-type="variable" data-id="null/some-value" id="null/some-value"></span> ``` ### Marks **link** Atts: - href: null - target: _blank - rel: noopener noreferrer nofollow - class: null - title: null ```html <a target="_blank" rel="noopener noreferrer nofollow" href="">link text example</a> ``` **bold** Atts: none ```html <strong>bold text example</strong> ``` **code** Atts: none ```html <code>code text example</code> ``` **italic** Atts: none ```html <em>italic text example</em> ``` **strike** Atts: none ```html <s>strike text example</s> ``` **underline** Atts: none ```html <u>underline text example</u> ``` ## Available Template Variables You can use the following variables in your organization letter body. Variables are represented as HTML spans: `clientCompanyName`, `contactPerson`, `senderNameAndPosition`, `senderName`, `senderPosition`, `todayDate`, `dearCustomer`, `signature` **Example HTML**: `<span data-type="variable" data-id="clientCompanyName">ACME Corp</span>`, `<span data-type="variable" data-id="contactPerson">John Doe</span>`
dateOfLetterstring<date>
Optional: The date shown on the letter (ISO 8601 date format: YYYY-MM-DD). If provided, updates the letter date. Omit to leave unchanged.
memberIdobject | null
Optional: The UUID of the organization member this letter is addressed to. If provided, links the letter to that member (member must belong to the specified or current organization). Set to null to clear the member association. Omit this field to leave it unchanged.
organizationIdstring
Optional: The UUID of the organization this letter belongs to. If provided, changes which organization the letter is linked to. The organization must exist and be accessible in your workspace.
subjectstring
Optional: The subject or title of the letter. If provided, updates the letter subject. Omit to leave unchanged.
Responses
200
addressTypeobjectrequired
The address type used for this letter. "Organization" means the organization's main address was used, "Member" means a member's private address was used.
Show properties
object
bodystringrequired
The letter body content in HTML format. This has been converted from the internal IDoc storage format to HTML for easy display and processing. Includes all formatting, template variables (as HTML spans), and rich text elements.
createdAtstring<date-time>required
ISO 8601 timestamp (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when the letter was first created in the system.
createdBystringrequired
UUID of the user who created this letter. Use this to track authorship and for audit purposes.
dateOfLetterstring<date-time>required
The date shown on the letter in ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ). This is the date that appears on the letter document itself, which may differ from the creation date.
idstringrequired
Unique identifier (UUID) of the organization letter
lastUpdatedstring<date-time>required
ISO 8601 timestamp (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when the letter was last modified. This is automatically updated whenever any field of the letter is changed.
memberIdobject | nullrequired
UUID of the organization member (contact person) this letter is addressed to. Will be null if the letter is addressed to the organization itself rather than a specific member.
organizationIdstringrequired
UUID of the organization this letter belongs to. Use this to link the letter to the correct organization.
subjectstringrequired
The subject or title of the letter as displayed in listings and on the document.
400Validation errors
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X PATCH "https://leadtime.app/api/public/organizations/letters/string" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "addressType": "Member",
  "body": "<p>Updated content with <span data-type=\"variable\" data-id=\"signature\"></span></p>",
  "dateOfLetter": "2024-01-15",
  "memberId": "123e4567-e89b-12d3-a456-426614174001",
  "organizationId": "123e4567-e89b-12d3-a456-426614174000",
  "subject": "Updated Invoice Reminder"
}'
Response
{
  "addressType": "Organization",
  "body": "<h1>Dear Customer</h1><p>This is a reminder...</p>",
  "createdAt": "2024-01-10T10:30:00.000Z",
  "createdBy": "123e4567-e89b-12d3-a456-426614174003",
  "dateOfLetter": "2024-01-15T00:00:00.000Z",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "lastUpdated": "2024-01-12T14:20:00.000Z",
  "memberId": "123e4567-e89b-12d3-a456-426614174002",
  "organizationId": "123e4567-e89b-12d3-a456-426614174001",
  "subject": "Invoice Reminder"
}