Paste API

The Paste API allows you to create pastes programmatically using your API key.


Endpoint

POST https://api.paste.org/paste/create

Authentication

Every request must include your API key.

api_key=YOUR_API_KEY

Parameters

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.

Example cURL


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\"}"

Successful Response

{
    "success": true,
    "id": 123456,
    "slug": "abc123",
    "url": "https://www.paste.org/abc123"
}

Error Response

{
    "success": false,
    "error": "Invalid API key."
}
Your API key is available from your Profile Settings page.