API REFERENCE
Plain Snippets
Create and share raw text snippets. Each snippet gets a public text/plain URL and a private edit URL. No accounts required.
Endpoints
POST/plain/api/create
Create a new snippet. Returns a raw URL and a private edit URL.
GET/plain/raw/:id
Fetch snippet content as
text/plain. Curl-friendly — no HTML wrapper.PUT/plain/api/edit/:id/:editKey
Update an existing snippet. Requires the private edit key.
POST /plain/api/create
| Parameter | Type | Description |
|---|---|---|
| text* | string | The text content to store. Max 100,000 characters. |
json
// Request
{
"text": "Hello, world!"
}
// Response
{
"ok": true,
"id": "8de969d8",
"editKey": "bf311f664f45a83a",
"rawUrl": "/plain/raw/8de969d8",
"editUrl": "/plain/edit/8de969d8/bf311f664f45a83a"
}GET /plain/raw/:id
Returns the snippet content with Content-Type: text/plain; charset=utf-8. No JSON wrapper — pure text output.
| Param | Type | Description |
|---|---|---|
| id* | string | Snippet ID returned from create. |
sh
# Returns raw text/plain — no HTML
curl https://fmt.helvetican.xyz/plain/raw/8de969d8PUT /plain/api/edit/:id/:editKey
Update the snippet text. The editKey is the private key returned at creation — keep it secret.
| Parameter | Type | Description |
|---|---|---|
| text* | string | New content to replace the snippet with. |
json
{ "ok": true }Error Codes
| Status | Condition |
|---|---|
| 400 | Missing or empty text, or text exceeds 100,000 chars, or invalid JSON |
| 403 | Wrong editKey |
| 404 | Snippet ID not found |
Examples
sh
# Create
curl -X POST https://fmt.helvetican.xyz/plain/api/create \
-H "Content-Type: application/json" \
-d '{"text": "Hello, world!"}'
# Read raw
curl https://fmt.helvetican.xyz/plain/raw/<id>
# Update
curl -X PUT https://fmt.helvetican.xyz/plain/api/edit/<id>/<editKey> \
-H "Content-Type: application/json" \
-d '{"text": "Updated content"}'js
// Create
const { id, editKey } = await fetch('/plain/api/create', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'Hello, world!' })
}).then(r => r.json());
// Read raw
const text = await fetch(`/plain/raw/${id}`).then(r => r.text());
// Update
await fetch(`/plain/api/edit/${id}/${editKey}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'Updated content' })
});python
import requests
base = "https://fmt.helvetican.xyz"
# Create
r = requests.post(f"{base}/plain/api/create",
json={"text": "Hello, world!"}).json()
id, key = r["id"], r["editKey"]
# Read raw
text = requests.get(f"{base}/plain/raw/{id}").text
# Update
requests.put(f"{base}/plain/api/edit/{id}/{key}",
json={"text": "Updated"})