API Documentation

Programmatically interact with PasteDump using our simple JSON API.

Authentication
The PasteDump API is public and does not require authentication.
View Interactive Docs
POST

/api/pastes

Create a Paste
Create a new paste. The response will include a URL to the newly created paste.

Body Parameters

  • content (string, required): The text or code content of the paste.
  • language (string, required): The programming language for syntax highlighting. See website for supported values.
  • expiration (string, required): The expiration time. Values: '5min', '1hour', '1day', '1week'.
  • title (string, optional): An optional title for the paste.

Example Request

1curl -X POST https://pastedump.tegaidogun.dev/api/pastes \
2  -H "Content-Type: application/json" \
3  -d '{
4    "content": "console.log(\"Hello, World!\");",
5    "language": "javascript",
6    "expiration": "1hour",
7    "title": "Hello World Example"
8  }'

Example Response

1{
2  "id": "clwz...",
3  "short_id": "aB1cD2",
4  "title": "Hello World Example",
5  "content": "console.log(\"Hello, World!\");",
6  "language": "javascript",
7  "expiration": "2025-06-11T14:00:00.000Z",
8  "view_count": 0,
9  "created_at": "2025-06-11T13:00:00.000Z",
10  "url": "https://pastedump.tegaidogun.dev/paste/aB1cD2"
11}
GET

/api/pastes/{id}

Get a Paste
Retrieve a single paste by its unique 6-character short ID.

Example Request

1curl https://pastedump.tegaidogun.dev/api/pastes/aB1cD2

Example Response

1{
2  "id": "clwz...",
3  "short_id": "aB1cD2",
4  "title": "Hello World Example",
5  "content": "console.log(\"Hello, World!\");",
6  "language": "javascript",
7  "expiration": "2025-06-11T14:00:00.000Z",
8  "view_count": 1,
9  "created_at": "2025-06-11T13:00:00.000Z"
10}
GET

/api/pastes/{id}/raw

Get Raw Paste Content
Retrieve the raw text content of a single paste, suitable for piping or saving to a file.

Example Request

1curl https://pastedump.tegaidogun.dev/api/pastes/aB1cD2/raw

Example Response

1console.log("Hello, World!");