Перейти к содержимому
GET AI agent ready /v1/paste/{id}

Paste API - GET /paste/{id} for Stored Snippets

REST-convention read endpoint. Pass the paste ID in the URL path and receive the stored content, language tag, and creation timestamp. Returns 404 NOT_FOUND when the paste has expired or never existed.

Parameters

stringrequired

8-character paste ID returned by POST /v1/paste/create.

Code examples

curl -X POST https://api.botoi.com/v1/paste/{id} \
  -H "Content-Type: application/json" \
  -d '{"id":"f9e8d7c6"}'

When to use this API

"Shared snippet" viewer pages

Build a /p/{id} route in your app that hits GET /v1/paste/{id} server-side, feeds the content into a Shiki or Prism highlighter on the language tag, and renders the result. GET makes the response cacheable at your CDN layer.

Config pulls from deployment scripts

Store a deploy config as a paste and let your script curl the GET path. The language tag doubles as a content-type hint for downstream processors (yaml, json, toml).

Chat-bot snippet lookup

Wire a Slack or Discord bot command like /paste f9e8d7c6. The bot hits the endpoint, formats the content in a code block, and posts it back. No POST body gymnastics needed.

Frequently asked questions

What happens when the paste has expired?
The endpoint returns 404 with code NOT_FOUND. Expiration is driven by the TTL set at creation time and enforced by Cloudflare KV; read requests never extend the TTL.
Is there any access control?
No. Anyone who knows the 8-character ID can read the paste. Encrypt sensitive content with /v1/encrypt/encrypt before storing if you need confidentiality.
How large can the returned content be?
Up to 1 MB, the same limit enforced on /paste/create. Larger payloads never make it into storage and therefore never come back through this endpoint.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.