Sign in New API Help About

The dpaste.com REST API

The API is for programmatic creation of new items. Anonymous use is permitted, and is the default. Per Terms of Service, automated requests should include a User-Agent header and should not exceed a rate of one request per second.

How to use it

  • HTTP POST to https://dpaste.com/api/v2/
  • Fields: content, syntax, title, expiry_days
  • Required field: content
  • Syntax choices: Full list in JSON form

Response contents

  • Response code on success will be HTTP 201 Created
  • Location header will be the created item's URL
  • Response body will also be the item's URL
  • Expires header will be the item's expiry date

Usage Examples

Authentication

Authenticated use is identical to anonymous use, with the addition of an Authorization header. Visit the dashboard, press the "Generate" button under "API token". Pass the resulting 16-character token via an HTTP Authorization header, like this: Authorization: Bearer a1b2c3d4e5f6g7h8

API auth is used to establish ownership of created items; additional functions like deletion are not currently available via the API.

To deactivate (delete) the current token and create a new one, press "Regenerate".

More

  • Official CLI client: dpaste.sh
  • The default API version is 2; using https://dpaste.com/api/ is the same as using https://dpaste.com/api/v2/
  • Listed on ProgrammableWeb