Skip to main content

SendookAPI Class

Constructor

Initializes a new instance of the Sendook API client.

Parameters

  • apiSecret (string, required): Your Sendook API secret key
  • apiUrl (string, optional): Custom API URL. Defaults to https://api.sendook.com

Example


Inbox Methods

Access inbox methods via client.inbox.

inbox.create()

Creates a new inbox.

Parameters

Example

inbox.list()

Returns a list of all inboxes.

Example

inbox.get()

Retrieves a specific inbox by ID.

Parameters

  • inboxId (string, required): The inbox ID

Example

inbox.delete()

Deletes an inbox and all its messages.

Parameters

  • inboxId (string, required): The inbox ID

Example


Message Methods

Access message methods via client.inbox.message.

inbox.message.send()

Sends an email from an inbox.

Parameters

Example

inbox.message.reply()

Replies to an existing message.

Parameters

Example

inbox.message.list()

Lists messages in an inbox with optional search query.

Parameters

  • inboxId (string, required): The inbox ID
  • query (string, optional): Search query to filter messages

Example

inbox.message.get()

Retrieves a specific message.

Parameters

  • inboxId (string, required): The inbox ID
  • messageId (string, required): The message ID

Example


Thread Methods

Access thread methods via client.inbox.thread.

inbox.thread.list()

Lists all threads in an inbox.

Parameters

  • inboxId (string, required): The inbox ID

Example

inbox.thread.get()

Retrieves a specific thread.

Parameters

  • inboxId (string, required): The inbox ID
  • threadId (string, required): The thread ID

Example


Domain Methods

Access domain methods via client.domain.

domain.create()

Creates a new custom domain.

Parameters

Example

domain.get()

Retrieves domain details.

Parameters

Example

domain.verify()

Verifies domain DNS configuration.

Parameters

Example

domain.dns()

Retrieves DNS records for domain configuration.

Parameters

Example

domain.delete()

Deletes a domain.

Parameters

Example


Webhook Methods

Access webhook methods via client.webhook.

webhook.create()

Creates a new webhook.

Parameters

Available Events

  • message.received - Triggered when a message is received
  • message.sent - Triggered when a message is sent
  • message.delivered - Triggered when a message is delivered
  • message.bounced - Triggered when a message bounces
  • message.rejected - Triggered when a message is rejected

Example

webhook.list()

Lists all webhooks.

Example

webhook.get()

Retrieves a specific webhook.

Parameters

  • webhookId (string, required): The webhook ID

Example

webhook.test()

Tests a webhook by sending a test event.

Parameters

  • webhookId (string, required): The webhook ID

Example

webhook.delete()

Deletes a webhook.

Parameters

  • webhookId (string, required): The webhook ID

Example


API Key Methods

Access API key methods via client.apiKey.

apiKey.create()

Creates a new API key.

Parameters

Example

apiKey.list()

Lists all API keys.

Example

apiKey.get()

Retrieves a specific API key.

Parameters

Example

apiKey.delete()

Deletes an API key.

Parameters

Example


Type Definitions

The SDK exports the following TypeScript types:

Interface Exports

Usage with Types


Error Handling

All methods return promises that may reject with axios errors. Always use try-catch blocks:

Common Error Codes

  • 401 - Unauthorized (invalid API key)
  • 404 - Resource not found
  • 422 - Validation error (invalid parameters)
  • 429 - Rate limit exceeded
  • 500 - Internal server error

Next Steps

Installation

Learn how to install the SDK

Usage Examples

View practical usage examples