Build with speed.
Integrate in seconds.
Welcome to the Pastebin API. Use our RESTful endpoints to automate your code sharing workflow, manage snippets, and build custom integrations.
Authentication
To authenticate your requests, you need to include your API key in the Authorization header as a Bearer token.
Base URL
All API requests should be made to the following base URL:
Create a New Paste
Push your code to our servers. Supports visibility modes and password protection.
Single-file content (legacy). Use this OR files[].
Multi-paste: multiple files under one link.
Filename (e.g. app.ts)
Language id (e.g. typescript, javascript, markdown, none)
File content
Optional title for your snippet.
'public', 'private', or 'protected'
Required if visibility is 'protected'
Retrieve a Single Paste
Fetch details of a specific paste. If protected, a password header is required.
Required only for 'protected' visibility pastes.
Delete a Paste
Permanently remove a paste. You can only delete pastes owned by your API key.
Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Missing required fields (e.g. content) |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Incorrect password or private paste |
| 404 | Not Found - Paste does not exist |