Skip to main content
For most use cases, the slideless CLI is easier than calling this endpoint directly. The CLI command equivalent is slideless share-email <shareId> --to <email>. End-to-end walkthrough: Send a presentation by email.

When to use

You already have a shareId (from POST /uploadSharedPresentation or from the dashboard) and you want to email it to one or more recipients. The endpoint:
  • Mints a unique named token per recipient by default (recipient email becomes the token name), so per-recipient open tracking comes for free via the existing accessCount / lastAccessedAt fields on each ShareToken.
  • Sends a branded email via Resend (from noreply@mail.slideless.ai).
  • Records every send in shared_presentations/{shareId}/email_sends/{autoId} as an append-only audit trail.
To reuse a single token for every recipient (shared view count, one revoke kills all), pass tokenId.

Endpoint

POST https://europe-west1-slideless-ai.cloudfunctions.net/sharePresentationViaEmail

Auth

HeaderValue
AuthorizationBearer cko_… (org key) or Bearer cka_… (admin key)
Content-Typeapplication/json
Required scope: presentations:write. Organization keys must belong to the same org as the shareId.

Request body

FieldTypeRequiredDescription
shareIdstringyesThe presentation to email. Must belong to the caller’s org and not be archived.
emailsstring[]yes1–20 recipient email addresses. Case-insensitive, de-duplicated.
messagestringnoPersonal note shown in the email body. ≤2000 chars.
subjectstringnoCustom subject line. Defaults to "<senderEmail> shared: <title>" (or "Shared with you: <title>" if no sender email is known). ≤200 chars.
tokenIdstringnoIf set, reuse this existing token for every recipient instead of minting per-recipient tokens. Must be an active (non-revoked) token on the share.
Example:
{
  "shareId": "0192f1c3-8b1a-7c4d-9e3f-...",
  "emails": ["alice@example.com", "bob@example.com"],
  "message": "Here's the Q2 deck we discussed."
}

Response (200)

{
  "shareId": "0192f1c3-...",
  "sent": [
    {
      "email": "alice@example.com",
      "tokenId": "0192f1c3-...",
      "resendMessageId": "re_abc123",
      "shareUrl": "https://app.slideless.ai/share/0192f1c3-...?token=..."
    }
  ],
  "failed": [
    { "email": "bob@bad", "code": "invalid-email", "message": "Not a valid email address." }
  ],
  "summary": { "total": 2, "sent": 1, "failed": 1 }
}
failed[] contains per-recipient failures inside an otherwise-200 response. The endpoint only returns a non-2xx status when a preflight condition fails (auth, not-found, archived, too-many-recipients, …) — i.e. when no email could be attempted for any recipient.

Error responses

{
  "error": "API key does not have access to this share.",
  "code": "permission-denied",
  "nextAction": "Confirm the share belongs to the same org as the current API key. If not, ask the user for the correct key."
}
StatuscodeWhen
400missing-recipientsemails was empty
400too-many-recipients>20 recipients
400message-too-longmessage >2000 chars
400invalid-argumentInvalid shareId, subject too long, unknown tokenId
401unauthenticatedMissing/invalid API key
403permission-deniedKey doesn’t belong to the share’s org
404not-foundshareId doesn’t exist
409archivedShare is archived
429rate-limitedToo many calls
500internalBackend error
Every error response includes a nextAction string written for consumers (including agents) to act on programmatically.

Examples

curl

curl -sS -X POST \
  -H "Authorization: Bearer $SLIDELESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "shareId": "0192f1c3-8b1a-7c4d-9e3f-...",
    "emails": ["alice@example.com", "bob@example.com"],
    "message": "Here is the Q2 deck."
  }' \
  https://europe-west1-slideless-ai.cloudfunctions.net/sharePresentationViaEmail

Node.js

const res = await fetch(
  'https://europe-west1-slideless-ai.cloudfunctions.net/sharePresentationViaEmail',
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.SLIDELESS_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      shareId: '0192f1c3-...',
      emails: ['alice@example.com'],
      message: 'Here is the Q2 deck.',
    }),
  },
);
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.error} — ${body.nextAction}`);
console.log(`Sent to ${body.summary.sent} of ${body.summary.total}`);

See also