Autentikasi

Sertakan API key kamu (lihat Dashboard) di header X-API-Key. Tanpa API key, request tetap bisa jalan sebagai guest tapi kena limit plan Free berdasarkan IP.

POST /api/create.php

Membuat paste baru. Body JSON atau form-urlencoded. Rate limit: 20 request/menit.

curl -X POST https://mypastes.my.id/api/create.php \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Hello World",
    "content": "console.log(\"hi\")",
    "language": "javascript",
    "visibility": "public",
    "expiration": "1day"
  }'

Response: { "id", "url", "raw_url", "expires_at" }

GET /api/get.php?id=xxxx

Mengambil isi paste public/unlisted (bukan private atau password-protected). Rate limit: 60 request/menit.

curl https://mypastes.my.id/api/get.php?id=abc123

Response: { "id", "title", "content", "language", "visibility", "views", "created_at" }