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.
Creating Pastes
Go to the homepage to create a paste. Everything is markdown, and the title becomes the URL slug when provided.
- Type or paste your markdown into the editor
- Optionally set a title.
- Click Paste Options to set expiry, password, edit key, or burn-after-read
- Click "Create Paste →" to save and get your shareable URL
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.
- Visit the paste URL
- Click the "✏️ Edit" button
- Enter your edit key in the modal
- Modify the title and/or content; the URL slug stays the same after creation
- Click "Save Changes" or "Delete Paste"
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.
Keyboard Shortcuts
When editing markdown or reading a paste, use these keyboard shortcuts and syntax helpers.
Ctrl + BBoldCtrl + IItalicCtrl + UUnderlineCtrl + KInsert linkCtrl + `Inline codeCtrl + 1Heading 1Ctrl + 2Heading 2Ctrl + 3Heading 3Ctrl + Shift + CCode blockCtrl + Shift + QBlockquoteCtrl + Shift + SStrikethroughCtrl + Shift + UBullet listCtrl + Shift + OOrdered listCtrl + ZUndoCtrl + Y / Ctrl + Shift + ZRedoCtrl + FFind & Replace (editor)Ctrl + Shift + FFullscreen editor toggleTabIndent (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.
POST /api/paste
Content-Type: application/jsonRequest Body
Response
{
"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
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.
GET /api/paste/:id
GET /api/paste/:id?password=yourpasswordQuery Parameters
Response
{
"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
// 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.
PUT /api/paste/:id
Content-Type: application/jsonRequest Body
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.
DELETE /api/paste/:id
Content-Type: application/jsoncurl -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.
GET /api/paste/:id/rawReturns text/plain with custom headers:
- X-Paste-Title — URL-encoded paste title
- Cache-Control: no-cache
curl https://pastyx.pages.dev/api/paste/hello-world-aB3z/raw