The Paste API allows you to create pastes programmatically using your API key.
POST https://api.paste.org/paste/create
Every request must include your API key.
api_key=YOUR_API_KEY
| Parameter | Required | Description |
|---|---|---|
| api_key | Yes | Your account API key. |
| title | No | Paste title. |
| content | Yes | The paste contents. |
| language | No | Syntax highlighting language (default: plaintext). |
| password | No | Password-protect the paste. |
curl -X POST "https://api.paste.org/paste/create" \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_KEY" \
-d "{\"title\":\"Hello\",\"content\":\"This was created using the API.\",\"language\":\"text\"}"
{
"success": true,
"id": 123456,
"slug": "abc123",
"url": "https://www.paste.org/abc123"
}
{
"success": false,
"error": "Invalid API key."
}