You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/views/api/index.md
+45-3Lines changed: 45 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,36 @@ The current HTTP base URI path is: `BASE_URI`.
98
98
99
99
## Authentication
100
100
101
-
All endpoints require your [API key](https://forwardemail.net/my-account/security) to be set as the "username" value of the request's [Basic Authorization](https://en.wikipedia.org/wiki/Basic_access_authentication) header (with the exception of [Alias Contacts](#alias-contacts), [Alias Calendars](#alias-calendars), and [Alias Mailboxes](#alias-mailboxes) which use a [generated alias username and password](/faq#do-you-support-receiving-email-with-imap))..
101
+
All endpoints require authentication using [Basic Authorization](https://en.wikipedia.org/wiki/Basic_access_authentication). We support two authentication methods:
102
+
103
+
### API Token Authentication (Recommended for most endpoints)
104
+
105
+
Set your [API key](https://forwardemail.net/my-account/security) as the "username" value with an empty password:
106
+
107
+
```sh
108
+
curl BASE_URI/v1/account \
109
+
-u API_TOKEN:
110
+
```
111
+
112
+
Note the colon (`:`) after the API token – this indicates an empty password in Basic Auth format.
113
+
114
+
### Alias Credentials Authentication (For outbound email)
115
+
116
+
The [Create outbound SMTP email](#create-outbound-smtp-email) endpoint also supports authentication using your alias email address and a [generated alias password](/faq#do-you-support-receiving-email-with-imap):
This method is useful when sending emails from applications that already use SMTP credentials and makes migration from SMTP to our API seamless.
127
+
128
+
### Alias-Only Endpoints
129
+
130
+
[Alias Contacts](#alias-contacts-carddav), [Alias Calendars](#alias-calendars-caldav), [Alias Messages](#alias-messages-imappop3), and [Alias Folders](#alias-folders-imappop3) endpoints require alias credentials and do not support API token authentication.
102
131
103
132
Don't worry – examples are provided below for you if you're not sure what this is.
104
133
@@ -484,6 +513,8 @@ You should either pass the single option of `raw` with your raw full email inclu
484
513
485
514
This API endpoint will automatically encode emojis for you if they are found in the headers (e.g. a subject line of `Subject: 🤓 Hello` gets converted to `Subject: =?UTF-8?Q?=F0=9F=A4=93?= Hello` automatically). Our goal was to make an extremely developer-friendly and dummy-proof email API.
486
515
516
+
**Authentication:** This endpoint supports both [API token authentication](#api-token-authentication-recommended-for-most-endpoints) and [alias credentials authentication](#alias-credentials-authentication-for-outbound-email). See the [Authentication](#authentication) section above for details.
517
+
487
518
> `POST /v1/emails`
488
519
489
520
| Body Parameter | Required | Type | Description |
@@ -514,7 +545,7 @@ This API endpoint will automatically encode emojis for you if they are found in
514
545
|`date`| No | String or Date | An optional Date value that will be used if the Date header is missing after parsing, otherwise the current UTC string will be used if not set. The date header cannot be more than 30 days in advance of the current time. |
515
546
|`list`| No | Object | An optional Object of `List-*` headers (see [Nodemailer's list headers](https://nodemailer.com/message/list-headers/)). |
516
547
517
-
> Example Request:
548
+
> Example Request (API Token):
518
549
519
550
```sh
520
551
curl -X POST BASE_URI/v1/emails \
@@ -525,7 +556,18 @@ curl -X POST BASE_URI/v1/emails \
0 commit comments