API Documentation

Overview

The Pastelink API is open to any users that have active Pastelink accounts.

Please use the API page in your account to create a key.

All responses will be in JSON format.

Datetime fields are strings with the format: 'YYYY-MM-DD HH:MM:SS'. All times are in UTC.

Starter project to access the Pastelink API (Python)

All Responses: Success

response_code

int

200

All Responses: Failure

response_code

int

400

error

string

Create Paste

Create a New Paste

Method:POST

Required Permissions:Create

Endpoint:api.pastelink.net/create-paste

Daily Limit1000

If a parameter is optional but a value is shown in bold, this value will be used as the default.

Parameters

api_key

string Required

dry_run

boolean Optional

Prevents any action from being taken.

title

string Optional

Maximum Length:160 characters

body

string Required

Maximum Length:160000 characters

option_visibility

string Optional
Permissible Values
  • public
  • hidden
  • private

access_password

string Required - if (option_visibility == private)

option_links

string Optional
Permissible Values
  • show
  • references
  • numbers
  • count
  • none

option_referrer

string Optional
Permissible Values
  • public
  • hide

option_security

string Optional
Permissible Values
  • none
  • captcha
  • login

option_strip_text

boolean Optional

Default:false

expiry

datetime Optional

Any expiry above 1000 years will be set to 1000 years. Minimum time: 6 hours. Uses PHP strtotime() function internally, so will also accept string descriptions of time, such as \'3 days\'.',

font_name

string Optional

Default:Poppins

Choose between any font available on Google Fonts. New fonts are added weekly.

font_weight

int Optional

Default:400

Must be a multiple of 100, up to 900. Some weights may not be available for certain fonts.

font_size

int Optional

Default:16

Must be an even number between 8 and 24.

edit_code

string Optional

Must be between 20 and 1000 characters.

custom_url

string Optional

Must be between 4 and 240 characters.

Response

url

string

custom_url

string

Edit Pastes

Edit a Paste You Created

Method:POST

Required Permissions:Edit

Endpoint:api.pastelink.net/edit-paste

Daily Limit3000

Any fields omitted will not be updated. Any fields with value NULL will be reset to default. Required fields with no defaults may not be given a NULL value.

Parameters

api_key

string Required

dry_run

boolean Optional

Prevents any action from being taken.

url

string Required

The url or custom url for the paste you are trying to edit. We advise using automatic URLs for API control as they can never be changed.

title

string Optional

Maximum Length:160 characters

body

string Required

Maximum Length:160000 characters

option_visibility

string Optional
Permissible Values
  • public
  • hidden
  • private

access_password

string Required - if (option_visibility == private)

option_links

string Optional
Permissible Values
  • show
  • references
  • numbers
  • count
  • none

option_referrer

string Optional
Permissible Values
  • public
  • hide

option_security

string Optional
Permissible Values
  • none
  • captcha
  • login

font_name

string Optional

Default:Poppins

Choose between any font available on Google Fonts. New fonts are added weekly.

font_weight

int Optional

Default:400

Must be a multiple of 100, up to 900. Some weights may not be available for certain fonts.

font_size

int Optional

Default:16

Must be an even number between 8 and 24.

custom_url

string Optional

Must be between 4 and 240 characters.

Response

archive_entry_url

string

URL of the newly created archive page as a result of an edit. This archive page has the same content as the paste did before this edit, however the paste options are synced with the latest version of the paste. Archive entries are only generated if the paste body is changed.

Delete Paste

Delete a Paste You Created

Method:POST

Required Permissions:Delete

Endpoint:api.pastelink.net/delete-paste

Daily Limit10000

Parameters

api_key

string Required

dry_run

boolean Optional

Prevents any action from being taken.

url

string Required

The url or custom url for the paste you are trying to edit. We advise using automatic URLs for API control as they can never be changed.

Response

Get Pastes

Get a list of all pastes owned by you by URL, ordered by date created, newest first.

Method:GET

Required Permissions:View

Endpoint:api.pastelink.net/get-pastes

Daily Limit10000

Maximum results: 1000

Parameters

api_key

string Required

deleted

boolean Optional

If true, returns list of deleted pastes. If false, returns non deleted pastes only.

page

int Optional

If you have more than 1000 results, defines which page to return. 1 Indexed. Uses limit value for calculation.

limit

int Optional

If you need fewer results, set the maximum. Maximum value 1000.

Response

total_pastes

int

Takes filters into account (currently just deleted true/false).

total_pages

int

Using given limit, defines how many pages of pastes are available.

limit

int

The limit given.

current_page

int

The current page given.

pastes

array

title

string

date_created

datetime

option_visibility

string
Permissible Values
  • public
  • hidden
  • private

url

string

custom_url

string

expiry

datetime

edit_total

int

view_total

int

Get Paste

Get the details of a specific paste which you created.

Method:GET

Required Permissions:View

Endpoint:api.pastelink.net/get-paste

Daily Limit10000

Parameters

api_key

string Required

url

string Required

The url or custom url for the paste you are trying to edit. We advise using automatic URLs for API control as they can never be changed.

Response

title

string

body

string

Paste body without any formatting.

date_created

datetime

option_visibility

string
Permissible Values
  • public
  • hidden
  • private

option_links

string
Permissible Values
  • show
  • references
  • numbers
  • count
  • none

option_referrer

string
Permissible Values
  • none
  • hidden

option_security

string
Permissible Values
  • none
  • captcha
  • login

option_strip_text

boolean

expiry

datetime

font_name

string

If null, font name follows the default, which is currently Poppins.

font_weight

int

If null, font name weight follows the default, which is currently 400.

font_size

int

If null, font size follows the default, which is currently 16.

edit_code

string

url

string

custom_url

string

edit_total

int

view_total

int