Overview

Pastyx is a markdown-first paste-sharing service. Paste article-style notes, code fences with syntax highlighting, callout blocks, definition lists, abbreviations with hover tooltips, emoji shortcodes, expiry controls, password protection, and edit keys.

📝
Markdown First
Every paste renders as rich markdown by default
🎨
Code Fences
Language-aware highlighting with auto-detect fallback
Callouts
Use ::: green blocks for tips, notes, and alerts
📚
Definition Lists
Glossary-style entries with Term and : definition
🔤
Abbreviations
Define [GFM] and [API] with hover tooltips
🚀
Emoji Shortcodes
Render :rocket:, :fire:, :heart:, and more
🔢
Super/Subscript
Use ^sup^ and ~sub~ for E=mc^2^ and H~2~O
🖊
Underline & Highlight
++underline++ and ==highlight== built-in
🖼
Image Sizing
![alt](url =300w) or =300x200 for fixed dimensions
📎
Footnotes
Inline [^1] refs with automatic back-links
🔒
Password Protection
Protect pastes with a password gate
✏️
Edit Keys
Set a key to edit or delete later
Expiry Control
Auto-delete after a set time
🌐
Open API
Full REST API for automation

Creating Pastes

Go to the homepage to create a paste. Everything is markdown, and the title becomes the URL slug when provided.

  1. Type or paste your markdown into the editor
  2. Optionally set a title.
  3. Click Paste Options to set expiry, password, edit key, or burn-after-read
  4. Click "Create Paste →" to save and get your shareable URL
💡 Pro Tip
Use the formatting toolbar for markdown shortcuts, and press Tab inside fenced code blocks to indent with four spaces.

Viewing Pastes

Visit any paste URL (e.g. https://pastyx.pages.dev/abc) to view it. The paste renders directly as an article, with no source/preview toggle.

  • Article-style markdown rendering with syntax-highlighted code fences
  • Copy content or share link with one click
  • Raw text at /{id}/raw for the original markdown source
  • View count and expiry displayed in the header
  • Edit button if the paste has an edit key set

Editing Pastes

If you set an Edit Key when creating a paste, you can edit or delete it later.

  1. Visit the paste URL
  2. Click the "✏️ Edit" button
  3. Enter your edit key in the modal
  4. Modify the title and/or content; the URL slug stays the same after creation
  5. Click "Save Changes" or "Delete Paste"
⚠️ Important
Edit keys are hashed. Pastyx cannot recover them if lost, so store your edit key somewhere safe.

Markdown Guide

Pastyx supports GitHub Flavored Markdown (GFM) plus many paste-friendly extensions: underline, highlight, superscript, subscript, spoilers, footnotes, callout blocks, definition lists, abbreviation tooltips, emoji shortcodes, and image sizing.

SyntaxResult
**bold**Bold text
_italic_Italic text
++underline++Underlined text
~~strikethrough~~Strikethrough
==highlight==Highlighted text (yellow marker)
^superscript^Superscript — e.g. E=mc^2^
~subscript~Subscript — e.g. H~2~O (not ~~strikethrough~~)
# Heading 1 … ###### Heading 6Headings H1–H6
> blockquoteBlockquote
---Horizontal rule
- item or * itemUnordered list
1. itemOrdered list
- [ ] task / - [x] doneTask list checkbox
`inline code`Inline code
```python code here ```Fenced code block with syntax highlighting
[text](url)Hyperlink
![alt](url)Image
| col | col | |---|---| | a | b |Table
||hidden text||Spoiler — click to reveal
::: green tip text :::Callout block (gray, green, blue, yellow, orange, red, purple, pink)
Term : definitionDefinition list
_[API]: Application Programming InterfaceDefine an abbreviation
[API]Use abbreviation — hover to see full title
:rocket: :fire: :heart:Emoji shortcodes
[^1] [^1]: footnote textFootnote reference + definition
<left>…</left>Left-aligned block
<center>…</center>Centered block
<right>…</right>Right-aligned block

Keyboard Shortcuts

When editing markdown or reading a paste, use these keyboard shortcuts and syntax helpers.

Ctrl + BBold
Ctrl + IItalic
Ctrl + UUnderline
Ctrl + KInsert link
Ctrl + `Inline code
Ctrl + 1Heading 1
Ctrl + 2Heading 2
Ctrl + 3Heading 3
Ctrl + Shift + CCode block
Ctrl + Shift + QBlockquote
Ctrl + Shift + SStrikethrough
Ctrl + Shift + UBullet list
Ctrl + Shift + OOrdered list
Ctrl + ZUndo
Ctrl + Y / Ctrl + Shift + ZRedo
Ctrl + FFind & Replace (editor)
Ctrl + Shift + FFullscreen editor toggle
TabIndent (4 spaces inside code blocks, 2 outside)

API Reference

Pastyx exposes a full REST API. All endpoints return JSON unless otherwise noted. Base URL: https://pastyx.pages.dev

POST /api/paste

Create a new paste.

http
POST /api/paste
Content-Type: application/json

Request Body

ParameterTypeRequiredDescription
contentstringYesThe paste content (max 5MB)
titlestringNoOptional title; slugified into the paste ID when present
authorstringNoOptional author name
expirystringNoOne of: "never", "10min", "1hour", "1day", "1week", "1month", "1year" (default: "never")
passwordstringNoPassword to protect the paste
editKeystringNoSecret key for editing or deleting later
burnAfterReadbooleanNoDelete after first view (default: false)

Response

json
{
  "id": "hello-world-aB3z",
  "title": "My Paste",
  "author": "John Doe",
  "expiresAt": null,
  "hasPassword": false,
  "hasEditKey": true,
  "url": `https://pastyx.pages.dev/hello-world-aB3z`
}

Example

bash
curl -X POST https://pastyx.pages.dev/api/paste \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Hello World",
    "author": "John Doe",
    "content": "Hello, world from markdown.",
    "expiry": "1week",
    "editKey": "my-secret-key"
  }'

GET /api/paste/:id

Retrieve a paste by its ID.

http
GET /api/paste/:id
GET /api/paste/:id?password=yourpassword

Query Parameters

ParameterTypeRequiredDescription
passwordstringNoRequired if paste is password-protected

Response

json
{
  "id": "hello-world-aB3z",
  "title": "Hello World",
  "author": "John Doe",
  "content": "console.log(\"Hello, World!\");",
  "expiresAt": "2024-01-22T12:00:00.000Z",
  "hasPassword": false,
  "hasEditKey": true,
  "views": 5,
  "createdAt": "2024-01-15T12:00:00.000Z",
  "updatedAt": "2024-01-15T12:00:00.000Z",
  "burnAfterRead": false
}

Error Responses

json
// 404 - Not found or expired
{ "error": "Paste not found" }

// 401 - Password required
{ "error": "Password required", "passwordRequired": true }

// 401 - Wrong password
{ "error": "Invalid password", "passwordRequired": true }

PUT /api/paste/:id

Edit an existing paste. Requires the edit key that was set at creation.

http
PUT /api/paste/:id
Content-Type: application/json

Request Body

ParameterTypeRequiredDescription
editKeystringYesThe edit key set when the paste was created
titlestringNoNew title
contentstringNoNew content
expirystringNoNew expiry setting
passwordstringNoNew password (empty string to remove)
newEditKeystringNoChange the edit key
burnAfterReadbooleanNoToggle burn after read
bash
curl -X PUT https://pastyx.pages.dev/api/paste/hello-world-aB3z \
  -H "Content-Type: application/json" \
  -d '{ "editKey": "my-secret-key", "title": "Updated Title", "content": "new content" }'

DELETE /api/paste/:id

Delete a paste. Requires the edit key.

http
DELETE /api/paste/:id
Content-Type: application/json
ParameterTypeRequiredDescription
editKeystringYesThe edit key set when the paste was created
bash
curl -X DELETE https://pastyx.pages.dev/api/paste/hello-world-aB3z \
  -H "Content-Type: application/json" \
  -d '{ "editKey": "my-secret-key" }'

GET /api/paste/:id/raw

Get the raw content of a paste as plain text. Password-protected pastes are not accessible via this endpoint.

http
GET /api/paste/:id/raw

Returns text/plain with custom headers:

  • X-Paste-Title — URL-encoded paste title
  • Cache-Control: no-cache
bash
curl https://pastyx.pages.dev/api/paste/hello-world-aB3z/raw

FAQs