> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paubox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Receiving client

> Full reference for the Paubox Perl SDK receiving API: managing domains, mailboxes, and retrieving inbound email.

The receiving functions are exported from the same `Paubox_Email_SDK` module.

```perl theme={null}
use Paubox_Email_SDK qw(
    listReceivingDomains createReceivingDomain getReceivingDomain deleteReceivingDomain
    listMailboxes createMailbox getMailbox deleteMailbox
    listReceivedEmails getReceivedEmail getReceivedEmailAttachment
);
```

Credentials are read from `config.cfg` (`API_KEY`), the same file used by the send functions.

## Domains

### List domains

```perl theme={null}
my $json = listReceivingDomains();
```

### Create a domain

```perl theme={null}
my $json = createReceivingDomain({ slug => 'support' });
```

Pass an empty hashref or no argument to auto-generate a slug.

### Get a domain

```perl theme={null}
my $json = getReceivingDomain(1);
```

### Delete a domain

```perl theme={null}
deleteReceivingDomain(1);
```

## Mailboxes

### List mailboxes

```perl theme={null}
my $json = listMailboxes($domain_id);
```

### Create a mailbox

```perl theme={null}
my $json = createMailbox($domain_id, {
    name     => 'intake',
    password => 'SecurePass123!',
});
```

Add `quota_bytes` to the hashref to set a storage quota.

### Get a mailbox

```perl theme={null}
my $json = getMailbox($domain_id, $mailbox_id);
```

### Delete a mailbox

```perl theme={null}
deleteMailbox($domain_id, $mailbox_id);
```

## Emails

### List received emails

```perl theme={null}
my $json = listReceivedEmails({ limit => 10 });
```

`after` and `before` cursors are also accepted for pagination.

### Get a received email

```perl theme={null}
my $json = getReceivedEmail('eaaaaab');
```

### Download an attachment

```perl theme={null}
my $data = getReceivedEmailAttachment('eaaaaab', 'blob123');
```
