Always send Content-Type: application/json. Both endpoints reject requests without it with 403 Cross-site form submissions are forbidden, which is the framework's CSRF protection rather than anything to do with your token.

Publish a snapshot

POST your Markdown to /api/share. On success you get 201 Created with the snapshot id, public URL, and a delete token. Save the delete token somewhere safe if you ever want to unpublish; it is the only way.

POST https://yeet.md/api/share
Content-Type: application/json

{"content": "# Hello\n\nFrom curl."}

Response:

{
  "id": "abc123",
  "url": "https://yeet.md/s/abc123",
  "deleteToken": "long-opaque-string"
}

Curl examples

Inline string:

curl -X POST https://yeet.md/api/share \
  -H "Content-Type: application/json" \
  -d '{"content":"# Hello\n\nFrom curl."}'

From a file (needs jq for safe JSON encoding):

jq -Rs '{content: .}' < notes.md \
  | curl -X POST https://yeet.md/api/share \
      -H "Content-Type: application/json" -d @-

Print just the URL:

curl -s -X POST https://yeet.md/api/share \
  -H "Content-Type: application/json" \
  -d "$(jq -Rs '{content: .}' < notes.md)" \
  | jq -r .url

Delete a snapshot

Send a DELETE to /api/delete/<id> with the delete token from the publish response. Pass it in a JSON body as token, or as a ?token= query parameter. The link stops working immediately.

DELETE https://yeet.md/api/delete/abc123
Content-Type: application/json

{"token": "<deleteToken>"}

Curl:

curl -X DELETE https://yeet.md/api/delete/abc123 \
  -H "Content-Type: application/json" \
  -d '{"token":"YOUR_DELETE_TOKEN"}'

The token can also go in a ?token= query parameter, but the Content-Type header is still required and the body must be empty:

curl -X DELETE "https://yeet.md/api/delete/abc123?token=YOUR_DELETE_TOKEN" \
  -H "Content-Type: application/json" -d ''

The JSON body form above is simpler; prefer it.

Limits

Status codes

Acceptable use

Same as the privacy policy and terms: don't publish illegal, harmful, infringing, or harassing content. Don't use the API to bulk-spam snapshots. The rate limit is generous for human use; if you need higher throughput, get in touch first.