---
title: "Create Document Editing Session"
method: POST
path: "/public/v1/documents/{id}/editing-sessions"
tags: ["Documents"]
---

# Create Document Editing Session

`POST /public/v1/documents/{id}/editing-sessions`

## Request

- Base URL: `https://api.pandadoc.com`
- URL: `https://api.pandadoc.com/public/v1/documents/{id}/editing-sessions`
- Auth: one of:
  - API key in header `Authorization`
  - OAuth 2
    - Authorization code: `https://app.pandadoc.com/oauth2/authorize`
    - Token URL: `https://api.pandadoc.com/oauth2/access_token`
- TypeScript: <https://skmtc.dev/pandadoc/apis/pandadoc-public-api/docs/public/v1/documents/:id/editing-sessions/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new editing session for the Embedded Editor. The response includes an E-Token, which is required to open the document.

> 🚧 **Important:** The Embedded Editor can only open documents that have a `draft` status.

#### Limitations

- **Single Active Session per User-Document Pair** 
  Only one editing session can be active at a time for a specific user and document. Creating a new session for the same user-document pair will automatically invalidate the previous one.

- **Weekly Session Cap** 
  A maximum of **250** editing sessions can be created for a single document per week. Any attempt to exceed this limit will result in a `403 Forbidden` error.

## Path parameters

- `id` string, required

## Request body

- EditingSessionRequest
  - `email` string, email, required: Email of the user to create the editing session for
  - `lifetime` integer: Lifetime of the E-Token in seconds.

## Response `201`

Document Editing Session created

- object
  - `id` string: Internal id of the editing session. Don't use it, it's not a token.
  - `email` string, email: Email associated with the editing session.
  - `expires_at` string, date-time: Date and time when the editing session expires.
  - `key` string: Same value as `token`, token for the embedded editor, aka E-Token. Deprecated — use `token` instead.
  - `token` string: Token for the embedded editor, aka E-Token. Use it for your Embedding.
  - `document_id` string: ID of the document

## Other responses

- `400`: Bad request
- `401`: Authentication error
- `403`: Permission error
- `404`: Not found
- `429`: Too Many Requests

---

[API](https://skmtc.dev/pandadoc/apis/pandadoc-public-api.md) - [All operations](https://skmtc.dev/pandadoc/apis/pandadoc-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pandadoc/apis/pandadoc-public-api/revisions/b9a306b1a421?raw)
