Log 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


Authenticated use is identical to anonymous use, with the addition of an Authorization header passed with your request. So, if you want created items to be linked to your account: log in, visit the dashboard, press the "Generate" button under "API token", and copy the resulting 16-character value.

Pass the token via an HTTP Authorization header, like this: Authorization: Bearer a1b2c3d4e5f6g7h8

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


The curl field spec -F "content=<-" captures stdin to the 'content' field.

  • Basic plain-text item creation: curl -s -F "content=<-" https://dpaste.com/api/v2/
  • Set syntax to Javascript: curl -s -F "syntax=js" -F "content=<-" https://dpaste.com/api/v2/
  • Set expiry (1–365 days): curl -s -F "expiry_days=10" -F "content=<-" https://dpaste.com/api/v2/


  • The default API version is 2; using https://dpaste.com/api/ is the same as using https://dpaste.com/api/v2/
  • See the dpaste-tools repo for more examples of API usage.
  • Listed on ProgrammableWeb