Create a pad
create_documentGenerate a shareable URL for a collaborative pad, optionally with initial text and syntax highlighting. Pads are ephemeral and editable by anyone with the link.
Instructions
Creates a pad, optionally with initial content and an editor language, and returns its shareable URL. Without an id a random one is generated. Pads are ephemeral: they are lost when the Rustpad server restarts and after 24 hours without an open connection. Anyone who knows the URL can read and edit the pad. Rustpad has no create operation of its own: a pad exists under any id as soon as it is written to, and set_document or append_to_document on a fresh id makes one just the same.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Desired pad id; omit to generate a random one | |
| text | No | Initial content | |
| language | No | Monaco editor language id for syntax highlighting, e.g. "markdown", "javascript", "rust", "plaintext" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| url | Yes | Shareable; anyone with it can read and edit. | |
| note | Yes | ||
| created | Yes | ||
| language | No | ||
| characters | Yes | Length of the pad after the write, in codepoints. |