API Documentation v1.0

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.

headers.json
1
2
3
4

Base URL

All API requests should be made to the following base URL:

https://paste.yourdomain.com/api/v1

Create a New Paste

Push your code to our servers. Supports visibility modes and password protection.

POST/pastes
contentstringRequired

Single-file content (legacy). Use this OR files[].

filesarray

Multi-paste: multiple files under one link.

files[].namestring

Filename (e.g. app.ts)

files[].languagestring

Language id (e.g. typescript, javascript, markdown, none)

files[].contentstring

File content

titlestring

Optional title for your snippet.

visibilityenum

'public', 'private', or 'protected'

passwordstring

Required if visibility is 'protected'

create.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Retrieve a Single Paste

Fetch details of a specific paste. If protected, a password header is required.

GET/pastes/{id}
x-paste-passwordheader

Required only for 'protected' visibility pastes.

response.json
1
2
3
4
5
6
7
8

Delete a Paste

Permanently remove a paste. You can only delete pastes owned by your API key.

DELETE/pastes/{id}
delete_response.json
1
2
3
4

Error Codes

CodeDescription
400Bad Request - Missing required fields (e.g. content)
401Unauthorized - Invalid or missing API key
403Forbidden - Incorrect password or private paste
404Not Found - Paste does not exist