Some Document

DocumentationOverview

Link.md is a eearkdown sharing service. Paste or drop a Markdown file, get a sh*are**able link. Shares created without an account exp*iredwqd after 24 hours. Logged-in users can create permanent shares, set custom slugs, ande upload attachments.

ABC

BC
DEF

The A
DEF

The API namespace is /api/v1. Most endpoints accept and return JSON; file download e

dpoints retu

rn raw file content with metadata in response headers.

Cr

ve one. Include it in requests:

Authorization: Bearer YOUR_API_KEY

Unauthenticated requests are allowed for creating anonymous (24-hour) shares, but most operations require a key.
Create a share

Creating a share with files follows a three-step flow when any file body is omitted: create the share, upload missing files, then finalize. If all files include inline content, the share is published immediately and steps 2–3 are not needed.
Step 1: Create

curl -X POST https://link.md/api/v1/shares
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"title": "My Share",
"slug": "my-share",
"files": [
{"filename": "index.md", "size": 13, "content_type": "text/markdown", "content": "# Hello\nWorld"},
{"filename": "photo.png", "size": 102400, "content_type": "image/png"}
]
}'

c++
dqwefef

Optional fields: title, slug, visibility ("public", "unlisted", "private"; defaults to "public"), expires_in (seconds, minimum 60). Anonymous shares are capped at 24 hours; authenticated shares default to permanent and explicit expirations are capped at one year.

Text files can include content inline; for inline content, size must be the UTF-8 byte length of content. Binary files and any other files without inline content are uploaded in step 2. If all files have inline content, the share is auto-finalized and you can skip steps 2 and 3.

Returns 201:

{
"id": "abc123...",
"status": "draft",
"files": [
{"filename": "index.md", "upload_url": "/api/v1/shares/abc123.../upload/index.md", "uploaded": true},
{"filename": "photo.png", "upload_url": "/api/v1/shares/abc123.../upload/photo.png", "uploaded": false}
],
"edit_token": "TOKEN",
"url": "https://link.md/USERNAME/my-share",
"expires_at": null
}

Step 2: Upload

Upload each missing file body to its upload_url:

curl -X POST https://link.md/api/v1/shares/abc123.../upload/photo.png
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: image/png"
--data-binary @photo.png

Returns 200: {"ok": true, "size": 102400}
Step 3: Finalize

curl -X POST https://link.md/api/v1/shares/abc123.../finalize
-H "Authorization: Bearer YOUR_API_KEY"

Publishes the draft share and moves the public-read pointer to the finalized version snapshot.
Get a share

curl https://link.md/api/v1/shares/abc123...
-H "Authorization: Bearer YOUR_API_KEY"

Returns share metadata and a file list with download URLs.
Publish current edits

Live editor, collaborator, and agent edits do not automatically change what anonymous public readers see when a share has a published version pointer. Publish after saving to move the public-read pointer to the current canonical/collab state:

curl -X POST https://link.md/api/v1/shares/abc123.../publish
-H "Authorization: Bearer YOUR_API_KEY"

For edit-token access, send X-Edit-Token: TOKEN. The response includes the published version number:

{"ok": true, "version": 3}

Update share settings

curl -X PATCH https://link.md/api/v1/shares/abc123...
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{"title": "New Title", "slug": "new-slug"}'

Updatable fields: title, slug, visibility, expiration ("permanent" or "24h"). Owners and edit-token holders can update title, expiration, and non-private visibility; only owners can set or clear a slug or make a share private. If a live collaboration session is active, this endpoint returns 409 instead of overwriting in-flight collaborative edits.

Visibility values: "public", "unlisted", "private". Private shares are only accessible to the owner, edit-token holders, and collaborators.
Delete a share

curl -X DELETE https://link.md/api/v1/shares/abc123...
-H "Authorization: Bearer YOUR_API_KEY"

List your shares

curl https://link.md/api/v1/shares
-H "Authorization: Bearer YOUR_API_KEY"

Returns a paginated list of shares owned by the authenticated user. Use page and limit query parameters to page through results.
RSS feeds

Public notes for a user are available as an RSS feed:

curl https://link.md/USERNAME/rss.xml

Feeds include the 25 most recent public published notes. Item descriptions include a plain-text excerpt by default. To omit excerpts:

curl https://link.md/USERNAME/rss.xml?excerpt=false

Only public notes are included. Unlisted, private, draft, and expired notes are excluded.
File endpoints

Operate on individual files within a share by flat filename. The API route parameter is named :path, but it is a URL-encoded filename, not a directory path: nested paths with / or \ are not supported. Useful for syncing tools like the Obsidian plugin.
List files

image_1781261094443_1.png

curl https://link.md/api/v1/shares/abc123.../files
-H "Authorization: Bearer YOUR_API_KEY"

Returns the entry file ID and file summaries:

{
"entry_file_id": "file_123",
"files": [
{
"id": "file_123",
"filename": "index.md",
"title": "index",
"content_type": "text/markdown",
"size_bytes": 1024,
"is_entry": true,
"sort_order": 0,
"updated_at": "2026-06-04 13:25:12.474"
}
]
}

Get a file

curl https://link.md/api/v1/shares/abc123.../files/index.md
-H "Authorization: Bearer YOUR_API_KEY"

Returns the raw file content with Content-Type set to the file's MIME type (not JSON-wrapped). Metadata is in response headers: X-Filename, X-Size, X-Is-Entry.
Create or update a file

curl -X PUT https://link.md/api/v1/shares/abc123.../files/notes.md
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: text/markdown"
--data-binary @notes.md

Creates a file if it doesn't exist, replaces it if it does. Send raw file content in the request body with the appropriate Content-Type header. File type and size limits apply; image, SVG, and PDF uploads are checked against their declared type, and SVGs are sanitized.

For anonymous shares, pass X-Edit-Token: TOKEN instead of Authorization.

Returns 200: {"ok": true, "filename": "notes.md", "size": 1024, "created": true}
Rename a markdown file

curl -X PATCH https://link.md/api/v1/shares/abc123.../files
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{"old_filename":"Old.md","new_filename":"New.md","file_id":"file_123"}'

new_filename must end in .md. Returns 200: {"ok": true, "filename": "New.md", "file_id": "file_123", "title": "New"}.
Delete a file

curl -X DELETE https://link.md/api/v1/shares/abc123.../files/photo.png
-H "Authorization: Bearer YOUR_API_KEY"

https://www.pinterest.co.uk/pin/419960734007454961/

Drop .md file