API v1

A link from your terminal, in one command.

Simple text/plain for daily work and a JSON contract for full access control.

01 / text/plain

Quick snippet

The request body becomes a safe unlisted snippet. Pass title, kind, language, expiry, and burn-after-reading through X-Pastly-* headers; language, expires, title, kind, and burn_after_read also work as query parameters. No account is required.

curl --data-binary @main.go 'https://pastly.maralys.com/api/v1/snippets' \ -H 'Content-Type: text/plain' \ -H 'X-Pastly-Title: worker.go' \ -H 'X-Pastly-Language: go' \ -H 'X-Pastly-Expires-In: 1d'

02 / application/json

Full contract

JSON exposes format, visibility, password, burn-after-reading, and E2E fields.

curl 'https://pastly.maralys.com/api/v1/snippets' \ -H 'Content-Type: application/json' \ --data '{"content":"console.log(42)","kind":"code","language":"javascript","visibility":"unlisted","access":"open","expires_in":"1h","burn_after_read":false}'

03 / Response

Short URL and expiry

HTTP/2 201
Location: https://pastly.maralys.com/4n8Kx2RjQ7Wa
X-Pastly-Slug: 4n8Kx2RjQ7Wa
X-Pastly-Raw-URL: https://pastly.maralys.com/4n8Kx2RjQ7Wa/raw
ETag: "1"

{
  "slug": "4n8Kx2RjQ7Wa",
  "url": "https://pastly.maralys.com/4n8Kx2RjQ7Wa",
  "expires_at": "2026-07-14T12:00:00Z",
  "revision": 1,
  "manage_token": "shown-once-for-guests"
}

The guest manage_token is returned only on creation. Pastly stores its HMAC, so a lost key cannot be recovered.

04 / Endpoints

Public REST API

POST/api/v1/snippets

Create a snippet

GET/api/v1/snippets/{slug}

Get metadata and accessible content

HEAD/api/v1/snippets/{slug}

Check status without payload or a view count

GET/api/v1/snippets/{slug}/meta

Public SEO metadata without content

POST/api/v1/snippets/{slug}/reveal

Explicitly reveal protected or one-time content

GET/api/v1/snippets/{slug}/raw

Safe text/plain output

PATCH/api/v1/snippets/{slug}

Update with the current revision

DELETE/api/v1/snippets/{slug}

Delete a snippet

GET/api/v1/catalog

Browse the public catalog

GET/api/v1/languages

143 languages, aliases, and file extensions

05 / Updates

No lost updates

Send X-Pastly-Manage-Token for a guest snippet and the current revision or If-Match. If it changed already, the API returns 409 Conflict. Revision history is not stored.

06 / Automation

Check without reading

HEAD returns revision, language, kind, visibility, access policy, burn flag, and expiry as headers. It never returns the payload, records a view, or consumes a one-time snippet.

curl -I 'https://pastly.maralys.com/api/v1/snippets/4n8Kx2RjQ7Wa'

07 / Share

When one snippet is not enough

Pastly is built for code, logs, and text. If a script needs dependencies, you need an archive, or you want to send an entire project, use Maralys Share for the files.