canonical: https://jentic.com/apis/pastebin.com/pastebin

# Pastebin API

Jentic publishes the only available OpenAPI specification for Pastebin API, keeping it validated and agent-ready. The Pastebin API provides programmatic access to the largest public text storage and sharing service, offering 3 POST endpoints for user authentication, paste creation with visibility and expiry controls, and raw paste content retrieval. It supports creating public, unlisted, and private pastes with configurable expiration periods and syntax highlighting for over 200 programming languages.

## For AI agents

Create, list, and retrieve pastes on Pastebin.com with visibility controls, expiry settings, and syntax highlighting for 200+ languages. Authenticate users to manage their paste collections.

## Scope

Does not handle file hosting, image uploads, or collaborative editing - use for text paste creation, retrieval, and lifecycle management only.

## Capabilities

- Create pastes with public, unlisted, or private visibility settings
- Set paste expiration from 10 minutes to never-expire
- Apply syntax highlighting from over 200 supported languages
- Authenticate users to access their paste collections
- Retrieve raw paste content by paste key
- List and delete pastes belonging to an authenticated user

## Use cases

### Code Sharing with Visibility Controls

Create text pastes with configurable visibility (public, unlisted, or private) through the Pastebin API. Public pastes appear in the site's recent paste feed, unlisted pastes are accessible only via direct URL, and private pastes require user authentication. Each paste can include syntax highlighting for any of 200+ supported languages and a title for identification.

Example prompt: Create an unlisted paste via POST /api_post.php with api_paste_private=1, api_paste_format=python, and api_paste_expire_date=1H

### Automated Paste Lifecycle Management

Authenticate with the Pastebin API to manage a user's paste collection programmatically. After obtaining a session key via the login endpoint, you can list all pastes, retrieve their raw content, or delete pastes that are no longer needed. Expiry settings provide automatic cleanup, but manual deletion is available for immediate removal of sensitive content.

Example prompt: Authenticate via POST /api_login.php to get a user_key, then list all user pastes via POST /api_post.php with api_option=list

### Temporary Credential and Config Sharing

Share temporary configuration files or credentials via Pastebin with short expiry periods. Create a private paste with a 10-minute expiration so the content auto-deletes after the recipient retrieves it. The paste key is returned immediately and can be shared through secure channels for one-time access.

Example prompt: Create a private paste with 10-minute expiry via POST /api_post.php with api_paste_private=2, api_paste_expire_date=10M, containing the configuration content

### AI Agent Paste Operations via Jentic

AI agents create and manage Pastebin pastes through Jentic to share code output, logs, or generated content during automated workflows. Jentic provides operation discovery and handles the multi-parameter POST body construction, including developer key injection, visibility settings, and expiry configuration without agents needing to memorize the form-encoded parameter names.

Example prompt: Search Jentic for 'create a code paste on Pastebin', load the operation schema, and execute with content, format=python, and visibility=unlisted parameters

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api_post.php` | Create, list, or delete pastes |
| POST | `/api_login.php` | Authenticate and get user session key |
| POST | `/api_raw.php` | Retrieve raw paste content |

## Key resources

- **Pastes** — Create, list, retrieve raw content, and delete paste entries
- **User Sessions** — Authenticate users to access their paste collections

## Why Jentic

- **Setup:** Wiring the Pastebin API by hand means learning its form-encoded developer-key and session-key conventions, setting the pastebin.com/api host, and shaping api_post, api_login, and api_raw form fields yourself. Through Jentic you install once, import the Pastebin API from the API Directory, store the developer key once, and your agent calls it.
- **Permission scoping:** The target paste travels in the form body rather than the URL path, so you limit the agent to the operations it needs, such as creating a paste or fetching raw paste content. You choose the operations it may call, so the login operation is not included unless you add it.
- **Credential handling:** Your Pastebin developer key and any user session key are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a private paste with an expiry' or 'get the raw text of a paste', and Jentic returns the matching Pastebin operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Paste Monster API** — Smaller pastebin with full CRUD including edit and delete via REST
- **CentOS Pastebin API** — Unauthenticated community pastebin with trending and recent feeds
- **Pastery API** — Minimalist pastebin with clean REST API and API key in query params
- **GitHub API** — Source control platform with Gists for versioned, forkable code sharing

## FAQ

### Why is there no official OpenAPI spec for Pastebin API?

Pastebin does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Pastebin API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Pastebin API use?

The API uses a developer API key (api_dev_key) included in every POST request body. For user-specific operations like listing or deleting pastes, you first obtain a session key via POST /api_login.php and include it as api_user_key in subsequent requests. Through Jentic, both keys are stored securely in the vault.

### Can I create private pastes through the API?

Yes. Set api_paste_private=2 in the POST /api_post.php request body for private pastes (only visible to the authenticated user), api_paste_private=1 for unlisted (accessible via URL only), or api_paste_private=0 for public pastes.

### What paste expiry options are available?

The api_paste_expire_date parameter accepts values including N (never), 10M (10 minutes), 1H (1 hour), 1D (1 day), 1W (1 week), 2W (2 weeks), 1M (1 month), 6M (6 months), and 1Y (1 year). Set in the POST /api_post.php request body.

### How do I retrieve the raw content of a paste?

Use POST /api_raw.php with the api_paste_key parameter set to the paste identifier. For public and unlisted pastes only your developer key is required. For private pastes you also need the api_user_key from a login session.

### How do I create a paste through Jentic?

Search Jentic for 'create a Pastebin paste' to find the POST /api_post.php operation. Load the schema to see all parameters (api_paste_code, api_paste_format, api_paste_private, api_paste_expire_date), then execute. Install with pip install jentic.

### Can I limit what my agent is allowed to do with the Pastebin API?

Yes. Because you run Jentic One yourself, your own rules decide which Pastebin operations the agent may call and which credentials it may use. You can allow only the operations the task needs, such as creating a paste via POST /api_post.php or fetching raw content via POST /api_raw.php, and leave out the POST /api_login.php authentication operation unless you explicitly add it. The developer key and any user session key stay under your control and are supplied at execution time, so the agent never sees them.
