📚 API Documentation

CloudPaste REST API Reference

Base URL

https://your-domain.com/api

Authentication

No API key required. Password-protected pastes require the password parameter.

Endpoints

POST/paste

Create a new paste

Request Body

{ "content": "string (required)", "customId": "string (optional)", "password": "string (optional)", "expiresIn": "number (optional, seconds)" }

Response

{ "id": "paste-id", "url": "https://your-domain.com/paste-id", "success": true }

Example

curl -X POST https://your-domain.com/api/paste \ -H "Content-Type: application/json" \ -d '{ "content": "Hello, World!", "customId": "my-paste", "password": "secret123", "expiresIn": 3600 }'

GET/paste/{id}

Get paste content

Parameters

  • password (query, optional) - Required for password-protected pastes

Response

{ "content": "paste content", "createdAt": 1234567890, "expiresAt": 1234567890, "views": 5, "hasPassword": false }

Example

curl https://your-domain.com/api/paste/my-paste?password=secret123

PUT/paste/{id}

Update paste content

Request Body

{ "content": "string (required)", "password": "string (optional, required if paste is password-protected)" }

Response

{ "success": true }

Example

curl -X PUT https://your-domain.com/api/paste/my-paste \ -H "Content-Type: application/json" \ -d '{ "content": "Updated content", "password": "secret123" }'

DELETE/paste/{id}

Delete a paste

Parameters

  • password (query, optional) - Required for password-protected pastes

Response

{ "success": true }

Example

curl -X DELETE https://your-domain.com/api/paste/my-paste?password=secret123

Error Responses

{ "error": "Error message" }

Status Codes

← Back to Home