### Get Latest Links Source: https://mail.siapdigital.web.id/docs/api Extracts all hyperlinks from the HTML body of the latest email. ```APIDOC ## GET /api/public/email-addresses/:email/latest-links ### Description Retrieves all hyperlinks found within the HTML body of the latest email received for the specified address. ### Method GET ### Endpoint /api/public/email-addresses/:email/latest-links ### Parameters #### Path Parameters - **email** (string) - Required - The email address to retrieve links from. ### Response #### Success Response (200) - **message_id** (string) - The ID of the email from which the links were extracted. - **subject** (string) - The subject of the email. - **received_at** (string) - The timestamp when the email was received. - **links** (array) - A list of extracted links. - **url** (string) - The URL of the link. - **text** (string) - The anchor text of the link. #### Response Example ```json { "message_id": "uuid", "subject": "Verify your email", "received_at": "2026-05-13T10:00:00Z", "links": [ { "url": "https://example.com/verify?token=abc", "text": "Verify Email" } ] } ``` ``` -------------------------------- ### Send Email via Inbound Endpoint (cURL) Source: https://mail.siapdigital.web.id/docs/api Example using cURL to send an email to the inbound endpoint. Requires Content-Type and Authorization headers. The body should match the Inbound Email Request Format. ```curl curl -X POST "https://mail.siapdigital.web.id/api/inbound-email" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer INBOUND_EMAIL_SECRET" \ -d '{ "message_id": "", "from_email": "sender@example.com", "from_name": "Sender Name", "to_email": "lead@siapdigital.web.id", "subject": "Test Email", "text_body": "Hello from email", "html_body": "

Hello from email

", "raw_headers": {}, "raw_payload": {} }' ``` -------------------------------- ### Get Latest OTP Source: https://mail.siapdigital.web.id/docs/api Extracts a 4-8 digit OTP code from recent emails. ```APIDOC ## GET /api/public/email-addresses/:email/latest-otp ### Description Searches through recent emails to find and extract an OTP code, typically 4-8 digits long. ### Method GET ### Endpoint /api/public/email-addresses/:email/latest-otp ### Parameters #### Path Parameters - **email** (string) - Required - The email address to search for OTP codes. ### Response #### Success Response (200) - **otp** (string) - The extracted OTP code. - **source_message_id** (string) - The ID of the message from which the OTP was extracted. - **received_at** (string) - The timestamp when the email containing the OTP was received. #### Response Example ```json { "otp": "123456", "source_message_id": "uuid", "received_at": "2026-05-13T10:00:00Z" } ``` ``` -------------------------------- ### Get Latest Primary Link Source: https://mail.siapdigital.web.id/docs/api Extracts the primary link from the latest email, suitable for verification or confirmation links. ```APIDOC ## GET /api/public/email-addresses/:email/latest-primary-link ### Description Extracts the primary link from the latest email. This is ideal for automatically clicking verification, confirmation, or reset links. ### Method GET ### Endpoint /api/public/email-addresses/:email/latest-primary-link ### Parameters #### Path Parameters - **email** (string) - Required - The email address to retrieve the primary link from. ### Response #### Success Response (200) - **message_id** (string) - The ID of the email from which the link was extracted. - **subject** (string) - The subject of the email. - **received_at** (string) - The timestamp when the email was received. - **link** (object) - The primary link object. - **url** (string) - The URL of the link. - **text** (string) - The anchor text of the link. #### Response Example ```json { "message_id": "uuid", "subject": "Verify your email", "received_at": "2026-05-13T10:00:00Z", "link": { "url": "https://example.com/verify?token=abc", "text": "Verify Email" } } ``` ``` -------------------------------- ### Get Email Messages Source: https://mail.siapdigital.web.id/docs/api Retrieves a list of messages associated with a specific email address. ```APIDOC ## GET /api/public/email-addresses/:email/messages ### Description Retrieves a list of messages associated with a specific email address. ### Method GET ### Endpoint /api/public/email-addresses/:email/messages ### Parameters #### Path Parameters - **email** (string) - Required - The email address to retrieve messages for. ### Response #### Success Response (200) - **messages** (array) - A list of email messages. - **id** (string) - The unique identifier of the message. - **from_email** (string) - The sender's email address. - **from_name** (string) - The sender's name. - **subject** (string) - The subject of the email. - **text_body** (string) - The plain text content of the email. - **html_body** (string) - The HTML content of the email. - **received_at** (string) - The timestamp when the email was received. - **status** (string) - The status of the email (e.g., 'unread'). #### Response Example ```json { "messages": [ { "id": "uuid", "from_email": "noreply@example.com", "from_name": "No Reply", "subject": "Verify your email", "text_body": "Click the button below", "html_body": "Verify", "received_at": "2026-05-13T10:00:00Z", "status": "unread" } ] } ``` ``` -------------------------------- ### Get Latest Email Source: https://mail.siapdigital.web.id/docs/api Retrieves the most recent email for a given address, useful for polling OTP codes. ```APIDOC ## GET /api/public/email-addresses/:email/latest ### Description Retrieves the most recent email for a given email address. This is particularly useful for polling One-Time Passwords (OTPs). ### Method GET ### Endpoint /api/public/email-addresses/:email/latest ### Parameters #### Path Parameters - **email** (string) - Required - The email address to retrieve the latest email from. ### Response #### Success Response (200) - **message** (object) - The latest email message. - **id** (string) - The unique identifier of the message. - **subject** (string) - The subject of the email. - **text_body** (string) - The plain text content of the email. - **html_body** (string) - The HTML content of the email. - **received_at** (string) - The timestamp when the email was received. - **from_email** (string) - The sender's email address. - **from_name** (string) - The sender's name (can be null). - **status** (string) - The status of the email (e.g., 'unread'). #### Response Example ```json { "message": { "id": "uuid", "subject": "Your OTP Code", "text_body": "Your code is 123456", "html_body": "

Your code is 123456

", "received_at": "2026-05-13T10:00:00Z", "from_email": "noreply@example.com", "from_name": null, "status": "unread" } } ``` ``` -------------------------------- ### Get Latest Email Source: https://mail.siapdigital.web.id/docs/api Fetches the most recent email for a given address. Ideal for polling One-Time Passwords (OTPs). Requires an API key. ```curl curl "https://mail.siapdigital.web.id/api/public/email-addresses/otptest42@siapdigital.web.id/latest" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Create Random Email Address Source: https://mail.siapdigital.web.id/docs/api Creates a random email address with a specified prefix, project, and label. ```APIDOC ## POST /api/public/email-addresses/random ### Description Creates a random email address by appending two random digits to a prefix. Suitable for temporary or testing purposes. ### Method POST ### Endpoint /api/public/email-addresses/random ### Parameters #### Request Body - **prefix** (string) - Required - The prefix for the email address. - **project** (string) - Required - The project associated with the email address. - **label** (string) - Required - A label for the email address. ### Request Example ```json { "prefix": "otp-test", "project": "automation-tool", "label": "OTP Test" } ``` ### Response #### Success Response (200) - **email** (string) - The generated random email address. #### Response Example ```json { "email": "otptest42@siapdigital.web.id" } ``` ``` -------------------------------- ### Create Custom Email Address Source: https://mail.siapdigital.web.id/docs/api Creates a custom email address with a specified local part, project, and label. ```APIDOC ## POST /api/public/email-addresses ### Description Creates a custom email address with a specified local part, project, and label. ### Method POST ### Endpoint /api/public/email-addresses ### Parameters #### Request Body - **local_part** (string) - Required - The local part of the email address. - **project** (string) - Required - The project associated with the email address. - **label** (string) - Required - A label for the email address. - **purpose** (string) - Optional - The purpose of the email address. ### Request Example ```json { "local_part": "support-project-a", "project": "project-a", "label": "Support Project A", "purpose": "Fixed address for support testing" } ``` ### Response #### Success Response (200) - **email_address** (object) - Details of the created email address. - **id** (string) - The unique identifier of the email address. - **email** (string) - The full email address. - **local_part** (string) - The local part of the email address. - **label** (string) - The label of the email address. - **project** (string) - The project associated with the email address. - **status** (string) - The status of the email address (e.g., 'active'). - **created_at** (string) - The timestamp when the email address was created. #### Response Example ```json { "email_address": { "id": "uuid", "email": "support-project-a@siapdigital.web.id", "local_part": "support-project-a", "label": "Support Project A", "project": "project-a", "status": "active", "created_at": "2026-05-13T10:00:00Z" } } ``` ``` -------------------------------- ### Create Custom Email Address Source: https://mail.siapdigital.web.id/docs/api Use this endpoint to create a fixed custom email address with a specified local part. Requires an API key for authorization. ```curl curl -X POST "https://mail.siapdigital.web.id/api/public/email-addresses" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "local_part": "support-project-a", "project": "project-a", "label": "Support Project A", "purpose": "Fixed address for support testing" }' ``` -------------------------------- ### Create Random Email Address Source: https://mail.siapdigital.web.id/docs/api Generates a random email address by appending two random digits to a given prefix. Useful for temporary or testing purposes. Requires an API key. ```curl curl -X POST "https://mail.siapdigital.web.id/api/public/email-addresses/random" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prefix": "otp-test", "project": "automation-tool", "label": "OTP Test" }' ``` -------------------------------- ### Extract Latest Primary Link Source: https://mail.siapdigital.web.id/docs/api Fetches the primary link from the latest email, typically used for verification, confirmation, or password reset actions. Requires an API key. ```curl curl "https://mail.siapdigital.web.id/api/public/email-addresses/otptest42@siapdigital.web.id/latest-primary-link" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Extract Latest OTP Source: https://mail.siapdigital.web.id/docs/api Searches through recent emails to find and extract a 4-8 digit OTP. Useful for automated verification processes. Requires an API key. ```curl curl "https://mail.siapdigital.web.id/api/public/email-addresses/otptest42@siapdigital.web.id/latest-otp" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### List Messages for an Email Address Source: https://mail.siapdigital.web.id/docs/api Retrieves a list of messages associated with a specific email address. Requires an API key for authentication. ```curl curl "https://mail.siapdigital.web.id/api/public/email-addresses/otptest42@siapdigital.web.id/messages" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Extract Latest Links Source: https://mail.siapdigital.web.id/docs/api Retrieves all hyperlinks found within the HTML body of the latest email. Useful for parsing verification or confirmation links. Requires an API key. ```curl curl "https://mail.siapdigital.web.id/api/public/email-addresses/otptest42@siapdigital.web.id/latest-links" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Cloudflare Worker Environment Variables Source: https://mail.siapdigital.web.id/docs/api Environment variables required for a Cloudflare Worker to interact with the Inbound API. Ensure INBOUND_EMAIL_SECRET matches the Next.js value. VERCEL_AUTOMATION_BYPASS_SECRET is optional for deployment protection. ```env INBOUND_API_URL=https://mail.siapdigital.web.id/api/inbound-email INBOUND_EMAIL_SECRET= VERCEL_AUTOMATION_BYPASS_SECRET= ``` -------------------------------- ### Inbound Email Success Response Source: https://mail.siapdigital.web.id/docs/api The JSON response received upon successfully storing an incoming email via the inbound endpoint. Includes a success status and the unique email ID. ```json { "success": true, "email_id": "uuid" } ``` -------------------------------- ### Inbound Endpoint Source: https://mail.siapdigital.web.id/docs/api This endpoint is called by Cloudflare Email Worker to save incoming emails. ```APIDOC ## POST /api/inbound-email ### Description This endpoint is called by Cloudflare Email Worker to save incoming emails. ### Method POST ### Endpoint /api/inbound-email ### Request Body - **message_id** (string) - Required - The unique identifier for the message. - **from_email** (string) - Required - The sender's email address. - **from_name** (string) - Optional - The sender's name. - **to_email** (string) - Required - The recipient's email address. - **subject** (string) - Required - The subject of the email. - **text_body** (string) - Optional - The plain text content of the email. - **html_body** (string) - Optional - The HTML content of the email. - **raw_headers** (object) - Optional - Raw headers of the email. - **raw_payload** (object) - Optional - Raw payload of the email. - **attachments** (array) - Optional - List of attachments. ### Request Example ```json { "message_id": "", "from_email": "sender@example.com", "from_name": "Sender Name", "to_email": "lead@siapdigital.web.id", "subject": "Test Email", "text_body": "Hello from email", "html_body": "

Hello from email

", "raw_headers": {}, "raw_payload": {}, "attachments": [] } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **email_id** (string) - The unique identifier for the saved email. #### Response Example ```json { "success": true, "email_id": "uuid" } ``` ``` -------------------------------- ### Inbound Email Request Format Source: https://mail.siapdigital.web.id/docs/api The JSON structure expected by the inbound email endpoint for storing incoming emails. Includes sender, recipient, subject, and email body content. ```json { "message_id": "", "from_email": "sender@example.com", "from_name": "Sender Name", "to_email": "lead@siapdigital.web.id", "subject": "Test Email", "text_body": "Hello from email", "html_body": "

Hello from email

", "raw_headers": {}, "raw_payload": {}, "attachments": [] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.