New paste Use cases Explore public pastes Text tools Developer API The Paste Library Security Sign in with Google

Pastebin API quickstart

Create an unlisted expiring paste with curl, save the returned URL and delete token, retrieve eligible content, and handle API failures safely.

Published August 3, 2026 · Reviewed August 3, 2026 · By Pastebin.ai Editorial Team for Pastebin API quickstart.

Editorial illustration for Pastebin API quickstart
Short answer

The anonymous API creates one paste from one JSON request. Start with synthetic text, an unlisted visibility setting, and a short expiration so you can verify the complete lifecycle before automating real work.

Create the first paste

POST JSON to /api/v1/pastes with a required content string. Optional fields include title, language, visibility, expiration, category, tags, password, encryption metadata, and burn-after-read. The response returns the page URL, an eligible raw URL, expiry, and a one-time delete token.

Save capabilities immediately

Treat the delete token as a secret capability. Do not place it in logs, shell history, or the paste itself. Signed-in automation should use a revocable account token instead of collecting anonymous delete tokens across many jobs.

Practical next step: Full API documentation - Review all payload fields and endpoints.

Retrieve and delete deliberately

GET is available only for public or unlisted content that is not password protected or client encrypted. Anonymous deletion uses X-Delete-Token. Check every HTTP status rather than assuming a response body contains the paste.

Action

ActionRequestPractical meaning
CreatePOST /api/v1/pastesJSON body; authentication optional.
RetrieveGET /api/v1/pastes/{id}Available public or unlisted content only.
Delete anonymous pasteDELETE /api/v1/pastes/{id}Send X-Delete-Token.
Manage owned pastes/api/v1/account/pastesSend a Bearer account token.

Primary sources and further reading

These references support the standards and implementation concepts used in Pastebin API quickstart. Product behavior is checked separately against Pastebin.ai.

  1. curl documentation
  2. HTTP Semantics RFC 9110

Pastebin API quickstart questions

Direct answers to the pastebin api quickstart decisions readers most often need to make.

Is API authentication required?+

No for anonymous creation and eligible retrieval. Owned management endpoints require a Bearer token.

Where is the delete token shown?+

It appears once in the anonymous create response and is not placed in the paste URL.

What is the maximum content size?+

1 MB measured as UTF-8 bytes.