Pastebin API - Create Temporary Code Snippets via REST
Store a text string (code, logs, config files) and receive a paste ID. Pastes expire after a configurable TTL (default 1 hour, max 24 hours). Specify an optional language tag for syntax highlighting when retrieving. Stored on Cloudflare's edge KV for fast global reads.
Code examples
curl -X POST https://api.botoi.com/v1/paste/create \
-H "Content-Type: application/json" \
-d '{"content":"console.log(\"hello world\");","ttl":3600,"language":"javascript"}'When to use this API
Share error logs with teammates during incident response
Paste a stack trace or log snippet and share the ID in Slack. The paste auto-expires after the incident window, so sensitive log data does not linger in a public pastebin.
Store temporary config or code snippets in CI pipelines
Generate a config file in one CI step, store it as a paste, and retrieve it in a later step or parallel job. The TTL ensures the data is cleaned up automatically after the pipeline finishes.
Frequently asked questions
What is the maximum paste size?
The request body limit is 1 MB. For most code snippets, log output, and config files, this is more than sufficient.
Can I update an existing paste?
No. Pastes are immutable once created. To share updated content, create a new paste and distribute the new ID.
What happens after the TTL expires?
The paste is deleted from the key-value store automatically. Requests for the expired paste ID return a 404 NOT_FOUND error.
Is the paste content encrypted?
No. Pastes are stored as plaintext in Cloudflare KV. Do not store secrets, passwords, or API keys in pastes. Use the /v1/encrypt/encrypt endpoint first if you need to store sensitive text.
What languages are supported for syntax highlighting?
The language field is a free-text tag stored with the paste. Common values include "javascript", "python", "json", "yaml", "go", "rust", and "plaintext". Your client-side highlighter can use this tag to apply the correct grammar.
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.