# Draft a Partnership Invitation Email

`POST https://api.suger.cloud/org/{orgId}/prm/partner/invitation/generate-email`

Generate a subject line and body for a partnership invitation email, written for a specific recipient using this organization's partnership profile and what is known about the partner company.

Use it to prepare wording before inviting someone, or to rewrite a draft. It returns text only — it sends nothing, creates no invitation, and changes no record. Sending is a separate step with CreatePrmInvitation.

It calls a language model and records AI usage for the organization, so each call has a cost. Generate once and edit the result; repeated regeneration adds cost with no new information.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |

## Request Body

Required.

Content-Type: `application/json` · Schema: `GenerateEmailRequest`

**`GenerateEmailRequest`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `aiContext` | string | no |  |
| `contextMessage` | string | no |  |
| `organizationName` | string | no |  |
| `partnerId` | string | no |  |
| `partnerName` | string | no |  |
| `partnerOverview` | string | no |  |
| `purpose` | string | yes |  |
| `referencedDocuments` | array<GenerateEmailReferencedDocument> | no | ReferencedDocuments are the agreements/files the seller attached on the compose step, passed so the AI can write a natural lead-in from each document's description and emit its {{document:<id>}} token inline where the link belongs. The token is replaced with a real link on send. |
| `senderName` | string | no |  |
| `tone` | string | yes |  |
| `useTemplatePlaceholder` | boolean | no | UseTemplatePlaceholder generates a reusable template (for bulk invite): the model emits the literal "{{partner}}" token wherever the partner company name would go, instead of a specific name. The caller substitutes the token per recipient. When set, PartnerName/PartnerID are not required. |

**`GenerateEmailReferencedDocument`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string | no |  |
| `id` | string | no |  |
| `name` | string | no |  |

## Responses

### 200 — OK

Content-Type: `application/json` · Schema: `GenerateEmailResponse`

**`GenerateEmailResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `body` | string | no |  |
| `subject` | string | no |  |

### 400 — Bad request error

Content-Type: `application/json`

## Example

_Generated from this operation's schema. Values are placeholders — substitute your own ids, and set `SUGER_TOKEN` to a bearer token from the [OAuth client-credentials exchange](https://doc.fours.com/settings/oauth-app/)._

### Request

```bash
curl -X POST 'https://api.suger.cloud/org/{orgId}/prm/partner/invitation/generate-email' \
  -H "Authorization: Bearer $SUGER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "purpose": "string",
  "tone": "string"
}'
```

### Response — 200

```json
{
  "body": "string",
  "subject": "string"
}
```

### Error — 400

```json
"string"
```

---

API reference: https://doc.fours.com/api/
