$ man pasteshare-api
API documentation.
Complete reference for creating, listing, reading, editing, deleting, unlocking, downloading, and commenting on PasteShare pastes.
base url
https://paste.brianrianrehan.comrate limit
10 requests / minute
HTTP 429 when the limit is reached.
edit key
Save it once
The key is required for edit and delete.
/api/pasteCreate a JSON paste
Creates a public paste. The title is automatically set to the generated paste ID. The response contains an editKey; store it securely because it is the credential for future edits and deletion.
Request
curl -X POST "https://paste.brianrianrehan.com/api/paste" \
-H "Content-Type: application/json" \
-d '{"content":"console.log(\"hello\");"}'JSON fields
| Field | Type | Description |
|---|---|---|
| content | string | Required. Paste content, up to 512 KB. |
Response: 201
{
"message": "success",
"id": "AbCdEf123",
"title": "AbCdEf123",
"content": "console.log(\"hello\");",
"link": "https://paste.brianrianrehan.com/raw/AbCdEf123",
"editKey": "save-this-securely"
}/api/createCreate a form-data paste
Creates a paste using multipart/form-data. Use format=json or an application/json Accept header for a JSON response; otherwise the browser request redirects to the new paste URL.
curl -i -X POST "https://paste.brianrianrehan.com/api/create?format=json" \
-H "Accept: application/json" \
-F "title=Deploy notes" \
-F "content=Deployment completed successfully" \
-F "exposure=public"Form fields
| Field | Type | Description |
|---|---|---|
| title | string | Optional display title. |
| content | string | Required. Paste content, up to 512 KB. |
| exposure | public | private | Optional. Defaults to public. |
| password | string | Use with private pastes to protect the content. |
Response: 201
{
"message": "success",
"id": "AbCdEf123",
"title": "AbCdEf123",
"content": "console.log(\"hello\");",
"link": "https://paste.brianrianrehan.com/raw/AbCdEf123",
"editKey": "save-this-securely"
}/api/pastesList public paste metadata
Returns the home registry with cursor pagination. Private paste content is never included in the list response.
curl "https://paste.brianrianrehan.com/api/pastes" \
-H "Accept: application/json"Search
curl "https://paste.brianrianrehan.com/api/pastes?q=deploy" \
-H "Accept: application/json"| Field | Type | Description |
|---|---|---|
| q | string | Optional search query for title and public content. |
| cursor | string | Optional nextCursor returned by the previous response. |
The response contains pastes, total, totalViews, and nextCursor. Request the next page with ?cursor=….
/raw/:idRead raw content
Returns the paste as text/plain and increments its view counter. Public pastes can be read directly. Private pastes require a valid access cookie created by /api/password.
curl -b cookies.txt \
"https://paste.brianrianrehan.com/raw/PrivatePaste123"Responses: 200 text content, 401 password required or invalid, 404 paste not found.
/dl/:idDownload a paste
Downloads the content as a text file named after the paste ID. Private paste access uses the same cookie flow as /raw/:id.
curl -L -b cookies.txt \
-o PrivatePaste123.txt \
"https://paste.brianrianrehan.com/dl/PrivatePaste123"/api/editEdit paste content
Updates the content of a paste when the generated edit key is valid. The title and visibility are unchanged.
curl -X POST "https://paste.brianrianrehan.com/api/edit" \
-H "Content-Type: application/json" \
-d '{
"id": "AbCdEf123",
"content": "Updated content",
"editKey": "save-this-securely"
}'| Field | Type | Description |
|---|---|---|
| id | string | Required paste ID. |
| content | string | Required new content, up to 512 KB. |
| editKey | string | Required key returned when the paste was created. |
Responses: 200 updated, 400 missing fields, 403 invalid key.
/api/deleteDelete a paste
Permanently deletes a paste and its comments. This action cannot be undone and requires the edit key.
curl -X POST "https://paste.brianrianrehan.com/api/delete" \
-H "Content-Type: application/json" \
-d '{"id":"AbCdEf123","editKey":"save-this-securely"}'Response: 200 with {"success":true}. Invalid keys return 403.
/api/passwordUnlock a private paste
Accepts multipart/form-data, validates the password, sets a one-hour HTTP-only access cookie, and returns the decrypted content and comments.
curl -c cookies.txt -X POST "https://paste.brianrianrehan.com/api/password" \
-F "id=PrivatePaste123" \
-F "password=correct-password"| Field | Type | Description |
|---|---|---|
| id | string | Required private paste ID. |
| password | string | Required private paste password. |
The cookie must be sent on later /raw and /dl requests. Invalid passwords return 401.
/api/commentAdd a comment
Adds a comment to a paste using multipart/form-data. Browser clients are redirected back to the paste after success.
curl -i -X POST "https://paste.brianrianrehan.com/api/comment" \
-F "pasteId=AbCdEf123" \
-F "author=Alice" \
-F "content=Useful snippet"| Field | Type | Description |
|---|---|---|
| pasteId | string | Required paste ID. |
| content | string | Required comment text. |
| author | string | Optional author name. Defaults to Anonymous. |
errors + security
Operational notes
- 01Use
Accept: application/jsonwhen you need machine-readable responses. - 02HTTP
429means the request limit was exceeded. Respect theRetry-Afterheader. - 03Never publish an edit key in public content, logs, screenshots, or source control.
- 04Admin endpoints under
/api/adminrequire an authenticated admin session and are not public API endpoints.