E-Z Logo

Paste API Documentation

Learn how to create pastes using our API

Endpoint: /paste/

POSTCreate pastes with the E-Z.host API

Headers

NameValueDescription
Content-Typeapplication/jsonThe type of the request body.
keyYour API keyYour API key for authentication.

Request Body

json
{
  "text": "contents of the paste",
  "title": "title of the paste",
  "description": "description for the paste",
  "language": "any supported language"
}

Example Request

bash
curl -X POST https://api.e-z.host/paste \
  -H 'key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "text":"contents of the paste",
    "title":"title of the paste",
    "description":"description for the paste",
    "language":"python"
  }'

Response

Successful response example:

json
{
  "success": true,
  "message": "Paste Created",
  "pasteUrl": "https://i.e-z.gg/p/xyz123",
  "rawUrl": "https://i.e-z.gg/p/raw/xyz123",
  "deletionUrl": "https://api.e-z.host/paste/delete?key=random-deletion-key"
}

Error Handling

Possible error responses include:

  • 400 Bad Request: Invalid input format.
  • 401 Unauthorized: Invalid API key.
  • 422 Unprocessable Entity: Validation error due to missing or invalid parameters.
  • 429 Too Many Requests: Rate limit exceeded.

Need Help?

If you need assistance with our Paste API, feel free to: