# Pastebin

> Create, read, list, and delete text pastes on Pastebin. Works without a Pastebin account for creating and reading public pastes.

App · Utilities · 4 actions. Web page: https://docs.lodol.com/docs/integrations/pastebin

## Actions

### Create a paste

Create a new paste on Pastebin and get back its link.

**Inputs**

- Content (`content`, text, required): The text to paste.
- Title (`title`, text): Optional. A title for the paste.
- Syntax highlighting (`paste_format`, text): Optional. The language to highlight the paste as. One of: `text` (Plain text), `python`, `javascript`, `typescript`, `json`, `html5` (HTML), `css`, `java`, `c`, `cpp` (C++), and 12 more. Default: `text`.
- Visibility (`visibility`, text): Who can see the paste. One of: `1` (Unlisted (only people with the link)), `0` (Public (listed on Pastebin)), `2` (Private (only your account)). Default: `1`.
- Expires after (`expire`, text): How long before the paste is deleted automatically. One of: `N` (Never), `10M` (10 minutes), `1H` (1 hour), `1D` (1 day), `1W` (1 week), `2W` (2 weeks), `1M` (1 month), `6M` (6 months), `1Y` (1 year). Default: `N`.

**Outputs**

- `key` (text): The new paste's key (id)
- `url` (text): Link to the new paste

**Example output**

```json
{
  "key": "AbC12345",
  "url": "https://pastebin.com/AbC12345"
}
```

### Delete a paste

Delete one of your pastes by its key.

**Inputs**

- Paste key (`paste_key`, text, required): The paste's key -- the code at the end of its link, for example 'AbC12345' in pastebin.com/AbC12345.

**Outputs**

- `deleted` (true/false): True when the paste was removed
- `key` (text): The deleted paste's key
- `message` (text): Pastebin's confirmation message

**Example output**

```json
{
  "deleted": true,
  "key": "AbC12345",
  "message": "Paste Removed"
}
```

### Get a paste

Fetch the text content of one of your pastes by its key.

**Inputs**

- Paste key (`paste_key`, text, required): The paste's key -- the code at the end of its link, for example 'AbC12345' in pastebin.com/AbC12345.

**Outputs**

- `content` (text): The paste's text
- `key` (text): The paste's key
- `url` (text): Link to the paste

**Example output**

```json
{
  "content": "print('hello world')",
  "key": "AbC12345",
  "url": "https://pastebin.com/AbC12345"
}
```

### List pastes

List your account's most recent pastes.

**Inputs**

- How many (`limit`, number): The maximum number of pastes to return (1 to 1000). From 1 to 1000. Default: `50`.

**Outputs**

- `count` (number): How many pastes were returned
- `pastes` (list): The account's recent pastes

**Example output**

```json
{
  "count": 1,
  "pastes": [
    {
      "date": "1712345678",
      "expire_date": "0",
      "format": "yaml",
      "hits": 4,
      "key": "AbC12345",
      "private": "1",
      "size": 128,
      "title": "config.yaml",
      "url": "https://pastebin.com/AbC12345"
    }
  ]
}
```
