Welcome to the Kaipaste API. This document describes the endpoints and usage for interacting programmatically with Kaipaste to securely share code and text.
https://kaipaste.****.com/api
Replace kaipaste.example.com with your deployment domain.
- Most endpoints require authentication via an API key or token.
- Token is stored in cookies for web clients.
POST /paste
Create a new code/text paste.
Request Body
{
"title": "Hello World Example",
"content": "package main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Println(\"Hello, World!\")\n}",
"language": "go",
"password": null,
"burnAfterRead": false,
"expiresAt": "2025-12-12T12:00:00Z",
"views": 0,
"isPublic": true
}Response
{
"pasteId": "b7346fc0-d340-11f0-9940-8c8d28d905b2",
"success": true
}GET /paste/{id}
Fetch the content for a specific paste.
Optional query:
- If the paste is password protected, pass:
?password=your_password
Response
{
"paste": {
"id": "b7346fc0-d340-11f0-9940-8c8d28d905b2",
"title": "Hello World Example",
"content": "package main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Println(\"Hello, World!\")\n}",
"language": "go",
"password": null,
"burnAfterRead": false,
"expiresAt": "2025-12-12T15:00:00+03:00",
"createdAt": "2025-12-07T10:45:35.352005+03:00",
"views": 0,
"userId": null,
"isPublic": true
}
}DELETE /paste/{id}
Permanently deletes a paste.
Response
{
"success": true
}GET /paste/mine
Returns a list of pastes created by the authenticated user.
Response
{
pastes: [
{
"id":"b7346fc0-d340-11f0-9940-8c8d28d905b2",
"title": "Hello World Example",
"content": "package main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Println(\"Hello, World!\")\n}",
"language": "go",
"password": null,
"burnAfterRead": false,
"expiresAt": "2025-12-12T15:00:00+03:00",
"createdAt": "2025-12-07T10:45:35.352005+03:00",
"views": 0,
"userId": "b7346fc0-d340-11f0-9940-8c8d28d905b2",
"isPublic": true
},
{
"id": "b7346fc0-d340-11f0-9940-8c8d28d905b2",
"title": "Hello World Example",
"content": "package main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Println(\"Hello, World!\")\n}",
"language": "go",
"password": null,
"burnAfterRead": false,
"expiresAt": "2025-12-12T15:00:00+03:00",
"createdAt": "2025-12-07T10:45:35.352005+03:00",
"views": 0,
"userId": "b7346fc0-d340-11f0-9940-8c8d28d905b2",
"isPublic": true
}
]
success: true
...
}200 OK– Success201 Created– New resource created400 Bad Request– Invalid input401 Unauthorized– Invalid or missing token404 Not Found– paste does not exist or expired500 Internal Server Error– Server-side issue
For feedback or help, reach out via GitHub Issues.