API Documentation v1

Automate pastes, folders, and protected links.

The REST API is scoped to account-owned data through API keys. Public and unlisted pastes can be read by ID, while writes require an account API key.

Authentication

Create an API key in the dashboard and send it as a Bearer token. API keys use the `wk_live_` prefix and are stored as hashes server-side.

headers.json
1
2
3
4

Base URL

All versioned API requests use this base URL:

https://wklej.it/api/v1

List account pastes

GET/pastes

Returns pastes owned by the API key user, sorted by creation date.

request.sh
1
2
response.json
1
2
3
4
5
6
7
8
9
10
11
12
13

Create a paste

POST/pastes

Send either `content` for a single paste or `files[]` for a multi-file paste. The total stored content is limited to 1MB.

contentstring

Single paste content. Use this or files[].

files[].namestring

Optional filename for multi-file pastes.

files[].languageenum

Language id: typescript, javascript, python, markdown, shell, and more.

files[].contentstring

Required file content.

titlestring

Optional title. Max 200 characters.

visibilityenum

public, unlisted, protected, or private.

passwordstring

Required by clients when visibility is protected.

expires_atISO date

Optional expiration timestamp.

burn_after_readboolean

Deletes the paste after the first successful read.

create.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
response.json
1
2
3
4
5
6
7
8

Read a paste

GET/pastes/{id}

Reads public, unlisted, or protected pastes by short ID. Private pastes are not readable through this endpoint.

request.sh
1
2
3
4
response.json
1
2
3
4
5
6
7
8
9

Delete a paste

DELETE/pastes/{id}

Deletes a paste only when it belongs to the API key owner.

request.sh
1
2
response.json
1
2
3
4

Folder API

Folder endpoints are account-scoped and always require the Bearer API key.

GET/folders
list-folders.sh
1
2
POST/folders
create-folder.json
1
2
3
4
5

Errors

CodeMeaning
400Invalid JSON or validation failed.
401Missing, malformed, or invalid API key.
403Protected/private access denied.
404Paste or owned resource not found.
500Unexpected server error.