### List all rewrites with GET Source: https://www.migadu.com/api Retrieves all rewrites for a domain using a GET request. Replace mydomain.org with your actual domain. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/rewrites ``` -------------------------------- ### Activate domain with curl GET request Source: https://www.migadu.com/api Use this curl command to activate a domain after DNS records are set and diagnostics pass. The request is a GET to /v1/domains/{domain}/activate with basic authentication. A successful activation returns a JSON response of the domain with status 200; otherwise, a 422 status with an error JSON is returned. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/activate \ -H "Content-Type:application/json" ``` -------------------------------- ### Show a specific forwarding with GET Source: https://www.migadu.com/api Shows information about a single forwarding by its full address. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/forwardings/external@external.com ``` -------------------------------- ### Show a single rewrite with GET Source: https://www.migadu.com/api Fetches an individual rewrite by its slug (name). The slug is used in the URL path. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/rewrites/demo ``` -------------------------------- ### List all forwardings with GET Source: https://www.migadu.com/api Retrieves all forwardings for a mailbox. Returns HTTP 400 if the request fails. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -X GET https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/forwardings \ ``` -------------------------------- ### List all aliases with GET request Source: https://www.migadu.com/api Use this curl command to retrieve all aliases for a domain. Replace mydomain.org with your domain. Authenticate with your Migadu username and token. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/aliases ``` -------------------------------- ### Run domain diagnostics with curl GET request Source: https://www.migadu.com/api Use this curl command to trigger diagnostics checks for a domain after DNS records are populated. The request is a GET to /v1/domains/{domain}/diagnostics with basic authentication using MIGADU_USER and USER_TOKEN. A successful request returns a JSON response with the status of the checks. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/diagnostics \ -H "Content-Type:application/json" ``` -------------------------------- ### Show alias details with GET request Source: https://www.migadu.com/api Use this curl command to show information for a specific alias. Replace demo with the local part of the alias and mydomain.org with your domain. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/aliases/demo ``` -------------------------------- ### Get domain usage with curl GET request Source: https://www.migadu.com/api Use this curl command to retrieve message and storage usage for a domain. The request is a GET to /v1/domains/{domain}/usage with basic authentication. A successful request returns a JSON response with usage data for the current date. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/usage \ -H "Content-Type:application/json" ``` -------------------------------- ### GET /v1/domains/{domain}/rewrites Source: https://www.migadu.com/api Retrieves a list of all rewrites for a given domain. ```APIDOC ## GET /v1/domains/{domain}/rewrites ### Description Retrieves a list of all rewrites for a given domain. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/rewrites ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name (e.g., mydomain.org). ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/rewrites ``` ### Response #### Success Response (200) No response body is documented. #### Response Example No response example is provided in the source. ``` -------------------------------- ### DNS Records Response JSON Source: https://www.migadu.com/api Example JSON response returned by the GET /records endpoint. It includes DKIM, DMARC, DNS verification, MX records, and SPF entries for the domain. ```json { "domain_name": "mydomain.org", "dkim": [ { "name": "key1._domainkey", "type": "cname", "value": "key1.mydomain.org._domainkey.migadu.com." }, { "name": "key2._domainkey", "type": "cname", "value": "key2.mydomain.org._domainkey.migadu.com." }, { "name": "key3._domainkey", "type": "cname", "value": "key3.mydomain.org._domainkey.migadu.com." } ], "dmarc": { "name": "_dmarc", "type": "txt", "value": "v=DMARC1; p=quarantine;" }, "dns_verification": { "name": "@", "type": "txt", "value": "RANDOM_VALUE" }, "mx_records": [ { "name": "@", "priority": 10, "type": "mx", "value": "aspmx1.migadu.com" }, { "name": "@", "priority": 20, "type": "mx", "value": "aspmx2.migadu.com" } ], "spf": { "name": "@", "type": "txt", "value": "v=spf1 include:spf.migadu.com -all" } } ``` -------------------------------- ### List Identities with curl GET Source: https://www.migadu.com/api Retrieves all identities for a mailbox. Requires the mailbox local part in the URL. Uses HTTP GET. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/identities ``` -------------------------------- ### List all mailboxes with GET request Source: https://www.migadu.com/api Use this curl command to retrieve all mailboxes for a domain. Replace mydomain.org with your actual domain. The request uses basic authentication with your Migadu username and token. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/mailboxes ``` -------------------------------- ### GET /v1/domains/{domain}/aliases Source: https://www.migadu.com/api Retrieves a list of all aliases for a specified domain. ```APIDOC ## GET /v1/domains/{domain}/aliases ### Description Retrieves all aliases for a given domain. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/aliases ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name (e.g., mydomain.org). ### Authentication Basic Auth (MIGADU_USER:USER_TOKEN) ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/aliases ``` ### Response #### Success Response (200) Returns a list of aliases for the domain. #### Response Example (Not provided in source) ### Error Handling (Not specified in source) ``` -------------------------------- ### Show Identity with curl GET Source: https://www.migadu.com/api Retrieves a single identity by its local part. Requires the mailbox local part and identity local part in the URL. Uses HTTP GET. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/identities/example ``` -------------------------------- ### cURL Request to Migadu API Source: https://www.migadu.com/api Example of a simple curl request using HTTP Basic authentication. Replace MIGADU_USER and USER_TOKEN with your credentials. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/ ``` -------------------------------- ### Retrieve DNS Records with GET Source: https://www.migadu.com/api Use this curl command to retrieve DNS records for your domain. Replace MIGADU_USER, USER_TOKEN, and mydomain.org with your credentials and domain. The response will be a JSON object containing the records. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/records \ -H "Content-Type:application/json" ``` -------------------------------- ### List all domains with GET request Source: https://www.migadu.com/api Use this curl command to retrieve all domains for your organization. The response is a JSON list of domains you have access to based on your permissions (_admin_ or _domain_admin_). ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains \ -H "Content-type: application/json" ``` -------------------------------- ### GET /v1/domains/{domain_name} Source: https://www.migadu.com/api Shows information about an individual domain. The domain is specified by its name in the URL path. ```APIDOC ## GET /v1/domains/{domain_name} ### Description Show information about a specific domain. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain_name} ### Path Parameters - **domain_name** (string) - Required - The name of the domain to retrieve (e.g., mydomain.org). ### Authentication Basic Auth (MIGADU_USER:USER_TOKEN) ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org \ -H "Content-type: application/json" ``` ### Response Returns the JSON representation of the domain. ``` -------------------------------- ### GET /v1/domains/{domain}/mailboxes Source: https://www.migadu.com/api Retrieves all mailboxes for a specified domain. ```APIDOC ## GET /v1/domains/{domain}/mailboxes ### Description Retrieves all mailboxes for a specified domain. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/mailboxes ### Parameters #### Path Parameters - **domain** (String) - Required - The domain name (e.g., mydomain.org). ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/mailboxes ``` ### Response #### Success Response (200) - **address** (String) - The full email address. - **domain_name** (String) - The domain name. - **local_part** (String) - The local part of the email address. - **name** (String) - The display name. - **is_internal** (Boolean) - Whether the mailbox is internal. - **wildcard_sender** (Boolean) - Whether wildcard sender is enabled. - **may_send** (Boolean) - Whether sending is allowed. - **may_receive** (Boolean) - Whether receiving is allowed. - **may_access_imap** (Boolean) - Whether IMAP access is allowed. - **may_access_pop3** (Boolean) - Whether POP3 access is allowed. - **may_access_managesieve** (Boolean) - Whether ManageSieve access is allowed. - **password_method** (String) - The password method. - **password_recovery_email** (String) - The recovery email. - **spam_action** (String) - The spam action. - **spam_aggressiveness** (String) - The spam aggressiveness level. - **sender_denylist** (Array) - List of denied senders. - **sender_allowlist** (Array) - List of allowed senders. - **recipient_denylist** (Array) - List of denied recipients. #### Response Example ```json { "address": "demo@mydomain.org", "delegations": [], "domain_name": "mydomain.org", "identities": [], "local_part": "demo", "expireable": false, "expires_on": null, "remove_upon_expiry": false, "may_access_imap": true, "may_access_managesieve": false, "may_access_pop3": true, "may_receive": true, "may_send": true, "is_internal": true, "wildcard_sender": false, "name": "Mailbox Name", "password_recovery_email": "invitee@somewhere.tld", "recipient_denylist": [], "sender_allowlist": [], "sender_denylist": [], "spam_action": "folder", "spam_aggressiveness": "default" } ``` ``` -------------------------------- ### GET /v1/domains/{domain}/rewrites/{name} Source: https://www.migadu.com/api Retrieves a single rewrite by its name (slug). ```APIDOC ## GET /v1/domains/{domain}/rewrites/{name} ### Description Retrieves a single rewrite by its name (slug). ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/rewrites/{name} ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name (e.g., mydomain.org). - **name** (string) - Required - The rewrite name (e.g., demo). ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/rewrites/demo ``` ### Response #### Success Response (200) No response body is documented. #### Response Example No response example is provided in the source. ``` -------------------------------- ### GET /v1/domains/{domain}/activate Source: https://www.migadu.com/api Activates a domain after all DNS records are set and diagnostics pass. Returns the domain object on success, or an error with status 422 if DNS checks fail. ```APIDOC ## GET /v1/domains/{domain}/activate ### Description Activates a domain after all DNS records are set and diagnostics pass. Returns the domain object on success, or an error with status 422 if DNS checks fail. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/activate ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to activate. ### Authentication Basic authentication with Migadu username and user token. ### Request Example ``` curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/activate \ -H "Content-Type:application/json" ``` ### Response #### Success Response (200) JSON representation of the domain itself. #### Response Example (No explicit success example provided in source.) #### Error Response (422) JSON with error message if DNS checks fail. #### Error Response Example ``` { "error": "dns_check_failed", "message": "DNS checks failed, please check your DNS and try activating domain." } ``` ``` -------------------------------- ### GET /v1/domains/{domain}/mailboxes/{mailbox}/forwardings/{forwarding} Source: https://www.migadu.com/api Shows information for a specific forwarding by its full address. ```APIDOC ## GET /v1/domains/{domain}/mailboxes/{mailbox}/forwardings/{forwarding} ### Description Shows information for a specific forwarding by its full address. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/mailboxes/{mailbox}/forwardings/{forwarding} ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name. - **mailbox** (string) - Required - The mailbox local part. - **forwarding** (string) - Required - The full forwarding address (e.g., external@external.com). ### Request Example {} ### Response #### Success Response (200) - **address** (string) - The forwarding address. - **blocked_at** (string) - Timestamp when the forwarding was blocked. - **confirmation_sent_at** (string) - Timestamp when confirmation was sent. - **confirmed_at** (string) - Timestamp when the forwarding was confirmed. - **expires_on** (date) - Expiration date. - **is_active** (boolean) - Whether the forwarding is active. - **remove_upon_expiry** (boolean) - Whether to remove upon expiry. #### Response Example { "address": "external@external.com", "blocked_at": null, "confirmation_sent_at": null, "confirmed_at": null, "expires_on": null, "is_active": true, "remove_upon_expiry": false } ``` -------------------------------- ### GET /v1/domains/{domain}/usage Source: https://www.migadu.com/api Retrieves message and storage usage for a domain. Returns the usage on the current date with storage in Gigabytes (GB). ```APIDOC ## GET /v1/domains/{domain}/usage ### Description Retrieves message and storage usage for a domain. Returns the usage on the current date with storage in Gigabytes (GB). ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/usage ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to get usage for. ### Authentication Basic authentication with Migadu username and user token. ### Request Example ``` curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/usage \ -H "Content-Type:application/json" ``` ### Response #### Success Response (200) JSON presentation of the usage on the current date. Storage usage is returned in Gigabytes (GB). #### Response Example ``` { "domain_name": "mydomain.org", "incoming": 75, "outgoing": 20, "storage": 0.50 } ``` ``` -------------------------------- ### Show mailbox info with GET request Source: https://www.migadu.com/api Use this curl command to show information for a specific mailbox identified by its local part (e.g., demo). Replace mydomain.org and demo with your domain and local part. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo ``` -------------------------------- ### Show a specific domain with GET request Source: https://www.migadu.com/api Use this curl command to retrieve information about a specific domain, such as _mydomain.org_. The domain name is included in the URL path. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org \ -H "Content-type: application/json" ``` -------------------------------- ### GET /v1/domains/{domain}/mailboxes/{mailbox}/identities/{local_part} Source: https://www.migadu.com/api Shows information for a specific identity of a mailbox. ```APIDOC ## GET /v1/domains/{domain}/mailboxes/{mailbox}/identities/{local_part} ### Description Retrieves details of a single identity identified by its local part. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/mailboxes/{mailbox}/identities/{local_part} ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name. - **mailbox** (string) - Required - The local part of the mailbox address. - **local_part** (string) - Required - The local part of the identity. ### Request Example No request body is required. ### Response #### Success Response (200) Returns the identity details with the same fields as listed in the Identities section. #### Response Example No response example is documented. ``` -------------------------------- ### GET /v1/domains/{domain}/aliases/{local_part} Source: https://www.migadu.com/api Retrieves information about a specific alias identified by its local part. ```APIDOC ## GET /v1/domains/{domain}/aliases/{local_part} ### Description Shows information for a single alias. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/aliases/{local_part} ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name (e.g., mydomain.org). - **local_part** (string) - Required - The local part of the alias (e.g., demo). ### Authentication Basic Auth (MIGADU_USER:USER_TOKEN) ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/aliases/demo ``` ### Response #### Success Response (200) Returns the alias information. #### Response Example (Not provided in source) ### Error Handling (Not specified in source) ``` -------------------------------- ### GET /v1/domains/{domain_name}/records Source: https://www.migadu.com/api Retrieves the DNS records that need to be configured for the domain. Returns a JSON representation of the records. ```APIDOC ## GET /v1/domains/{domain_name}/records ### Description Retrieves the DNS records that need to be configured for the domain. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain_name}/records ### Parameters #### Path Parameters - **domain_name** (string) - Required - The domain name for which to retrieve DNS records. ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/records \ -H "Content-Type:application/json" ``` ### Response #### Success Response (200) - **domain_name** (string) - The domain name. - **dkim** (array of objects) - DKIM records. Each object has fields: name, type, value. - **dmarc** (object) - DMARC record. Fields: name, type, value. - **dns_verification** (object) - DNS verification record. Fields: name, type, value. - **mx_records** (array of objects) - MX records. Each object has fields: name, priority, type, value. - **spf** (object) - SPF record. Fields: name, type, value. #### Response Example ``` { "domain_name": "mydomain.org", "dkim": [ { "name": "key1._domainkey", "type": "cname", "value": "key1.mydomain.org._domainkey.migadu.com." }, { "name": "key2._domainkey", "type": "cname", "value": "key2.mydomain.org._domainkey.migadu.com." }, { "name": "key3._domainkey", "type": "cname", "value": "key3.mydomain.org._domainkey.migadu.com." } ], "dmarc": { "name": "_dmarc", "type": "txt", "value": "v=DMARC1; p=quarantine;" }, "dns_verification": { "name": "@", "type": "txt", "value": "RANDOM_VALUE" }, "mx_records": [ { "name": "@", "priority": 10, "type": "mx", "value": "aspmx1.migadu.com" }, { "name": "@", "priority": 20, "type": "mx", "value": "aspmx2.migadu.com" } ], "spf": { "name": "@", "type": "txt", "value": "v=spf1 include:spf.migadu.com -all" } } ``` ``` -------------------------------- ### GET /v1/domains/{domain}/mailboxes/{local_part} Source: https://www.migadu.com/api Retrieves information for a specific mailbox identified by its local part. ```APIDOC ## GET /v1/domains/{domain}/mailboxes/{local_part} ### Description Retrieves information for a specific mailbox identified by its local part. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/mailboxes/{local_part} ### Parameters #### Path Parameters - **domain** (String) - Required - The domain name (e.g., mydomain.org). - **local_part** (String) - Required - The local part of the mailbox (e.g., demo). ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo ``` ### Response #### Success Response (200) - **address** (String) - The full email address. - **domain_name** (String) - The domain name. - **local_part** (String) - The local part of the email address. - **name** (String) - The display name. - **is_internal** (Boolean) - Whether the mailbox is internal. - **wildcard_sender** (Boolean) - Whether wildcard sender is enabled. - **may_send** (Boolean) - Whether sending is allowed. - **may_receive** (Boolean) - Whether receiving is allowed. - **may_access_imap** (Boolean) - Whether IMAP access is allowed. - **may_access_pop3** (Boolean) - Whether POP3 access is allowed. - **may_access_managesieve** (Boolean) - Whether ManageSieve access is allowed. - **password_method** (String) - The password method. - **password_recovery_email** (String) - The recovery email. - **spam_action** (String) - The spam action. - **spam_aggressiveness** (String) - The spam aggressiveness level. - **sender_denylist** (Array) - List of denied senders. - **sender_allowlist** (Array) - List of allowed senders. - **recipient_denylist** (Array) - List of denied recipients. #### Response Example ```json { "address": "demo@mydomain.org", "delegations": [], "domain_name": "mydomain.org", "identities": [], "local_part": "demo", "expireable": false, "expires_on": null, "remove_upon_expiry": false, "may_access_imap": true, "may_access_managesieve": false, "may_access_pop3": true, "may_receive": true, "may_send": true, "is_internal": true, "wildcard_sender": false, "name": "Mailbox Name", "password_recovery_email": "invitee@somewhere.tld", "recipient_denylist": [], "sender_allowlist": [], "sender_denylist": [], "spam_action": "folder", "spam_aggressiveness": "default" } ``` ``` -------------------------------- ### GET /v1/domains Source: https://www.migadu.com/api Retrieves a list of all domains for your organization. The response includes domains you are allowed to access based on your organization permissions (admin or domain_admin). ```APIDOC ## GET /v1/domains ### Description Get all domains for your organization. ### Method GET ### Endpoint https://api.migadu.com/v1/domains ### Authentication Basic Auth (MIGADU_USER:USER_TOKEN) ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains \ -H "Content-type: application/json" ``` ### Response Returns a list of domains based on your organization permissions. ``` -------------------------------- ### Successful alias creation response Source: https://www.migadu.com/api Example JSON response returned when the alias creation request succeeds. The API returns HTTP 200 status code with this representation. ```json { "address":"demo@mydomain.org", "domain_name":"mydomain.org", "local_part":"demo", "expireable":false, "expires_on":null, "remove_upon_expiry":false, "is_internal":"true", "destinations":["one@mydomain.org","two@mydomain.org"] } ``` -------------------------------- ### Successful mailbox creation response Source: https://www.migadu.com/api Example JSON response returned when a mailbox is created successfully. The response includes the mailbox address, domain, and various settings. A successful request returns HTTP 200 status code. ```json { "address":"demo@mydomain.org", "delegations":[], "domain_name":"mydomain.org", "identities":[], "local_part":"demo", "expireable":false, "expires_on":null, "remove_upon_expiry":false, "may_access_imap":true, "may_access_managesieve":false, "may_access_pop3":true, "may_receive":true, "may_send":true, "is_internal":true, "wildcard_sender": false, "name":"Mailbox Name", "password_recovery_email":"invitee@somewhere.tld", "recipient_denylist":[], "sender_allowlist":[], "sender_denylist":[], "spam_action":"folder", "spam_aggressiveness":"default" } ``` -------------------------------- ### GET /v1/domains/{domain}/diagnostics Source: https://www.migadu.com/api Runs diagnostics checks on a domain after DNS records have been populated. Returns the status of the diagnostics checks in JSON format. ```APIDOC ## GET /v1/domains/{domain}/diagnostics ### Description Runs diagnostics checks on a domain after DNS records have been populated. Returns the status of the diagnostics checks in JSON format. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/diagnostics ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to run diagnostics on. ### Authentication Basic authentication with Migadu username and user token. ### Request Example ``` curl -u MIGADU_USER:USER_TOKEN \ https://api.migadu.com/v1/domains/mydomain.org/diagnostics \ -H "Content-Type:application/json" ``` ### Response #### Success Response (200) JSON response with the status of the diagnostics checks. #### Response Example (No explicit example provided in source.) ``` -------------------------------- ### Create a new domain with POST request and JSON response Source: https://www.migadu.com/api Use this curl command to create a new domain. The `hosted_dns` parameter determines DNS hosting type; omitting it defaults to external DNS. The `create_default_addresses` parameter adds required addresses (admin, postmaster, abuse) when set to true. The JSON response shows the created domain with HTTP 200 on success. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -X POST https://api.migadu.com/v1/domains \ -d '{"name":"mydomain.org","create_default_addresses":"true","hosted_dns":"false"}' -H "Content-type: application/json" ``` ```json { "name": "mydomain.org", "state": "inactive", "description": "", "tags": [], "activated_at": null, "deactivated_at": null, "recipient_denylist": "", "sender_allowlist": [], "sender_denylist": [], "spam_aggressiveness": 0, "can_access": false, "mx_proxy_enabled": false, "can_receive": false, "can_send": false, "catchall_destinations": [], "deactivated_at": null, "subject_rewriting_enabled": false, "junk_subject_keyword_spam": true, "hosted_dns": false "mailbox_default_incoming_limit": 500 "mailbox_default_outgoing_limit": 100 "mailbox_default_storage_limit": 0 "mailbox_default_sending_enabled": true "mailbox_default_receiving_enabled": true "mailbox_default_imap_enabled": true "mailbox_default_pop3_enabled": true "mailbox_default_managesieve_enabled": true } ``` -------------------------------- ### Create alias with POST request Source: https://www.migadu.com/api Use this curl command to create a new alias. Replace demo, one@domain.tld, two@domain.tld, and mydomain.org with your values. Aliases can only redirect on the same domain. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"local_part":"demo", "destinations": "one@domain.tld,two@domain.tld"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/aliases \ -H "Content-Type:application/json" ``` -------------------------------- ### GET /v1/domains/{domain}/mailboxes/{mailbox}/identities Source: https://www.migadu.com/api Lists all identities of a mailbox. ```APIDOC ## GET /v1/domains/{domain}/mailboxes/{mailbox}/identities ### Description Retrieves all identities associated with the specified mailbox. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/mailboxes/{mailbox}/identities ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name. - **mailbox** (string) - Required - The local part of the mailbox address. ### Request Example No request body is required. ### Response #### Success Response (200) Returns a list of identities. Each identity has the following fields: - **local_part** (string) - Read Only - **domain** (string) - Read Only - **address** (string) - Read Only - **name** (string) - **may_send** (boolean) - **may_receive** (boolean) - **may_access_imap** (boolean) - **may_access_pop3** (boolean) - **may_access_managesieve** (boolean) - **password** (string) - Create/Update Only - **password_use** (string) - Predefined values #### Response Example No response example is documented. ``` -------------------------------- ### GET /v1/domains/{domain}/mailboxes/{mailbox}/forwardings Source: https://www.migadu.com/api Retrieves all forwardings for a specific mailbox. ```APIDOC ## GET /v1/domains/{domain}/mailboxes/{mailbox}/forwardings ### Description Retrieves all forwardings for a specific mailbox. ### Method GET ### Endpoint https://api.migadu.com/v1/domains/{domain}/mailboxes/{mailbox}/forwardings ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name. - **mailbox** (string) - Required - The mailbox local part. ### Request Example {} ### Response #### Success Response (200) - **address** (string) - The forwarding address. - **blocked_at** (string) - Timestamp when the forwarding was blocked. - **confirmation_sent_at** (string) - Timestamp when confirmation was sent. - **confirmed_at** (string) - Timestamp when the forwarding was confirmed. - **expires_on** (date) - Expiration date. - **is_active** (boolean) - Whether the forwarding is active. - **remove_upon_expiry** (boolean) - Whether to remove upon expiry. #### Response Example { "address": "external@external.com", "blocked_at": null, "confirmation_sent_at": null, "confirmed_at": null, "expires_on": null, "is_active": true, "remove_upon_expiry": false } ``` -------------------------------- ### Create a rewrite with POST and response Source: https://www.migadu.com/api Creates a new rewrite with a pattern and destinations. On success, the API returns HTTP 200 with the JSON representation of the new rewrite. On failure, HTTP 400 is returned. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"name":"demo", "local_part_rule":"demo-*", "destinations": "one@domain.tld,two@domain.tld"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/rewrites \ -H "Content-Type:application/json" ``` ```json { "name":"demo", "domain_name":"mydomain.org", "local_part_rule":"demo-*", "destinations":["one@mydomain.org","two@mydomain.org"] } ``` -------------------------------- ### Create identity with custom password (password_use=custom) Source: https://www.migadu.com/api Creates an identity with its own password, typically used for application-specific mailboxes. Requires password_use=custom and a password parameter. Successful request returns HTTP 200 with the identity JSON; failure returns HTTP 400. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"name":"Identity Name", "local_part":"example","password_use":"custom","password":"Sup3r_s3cr3T"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/identities \ -H "Content-Type:application/json" ``` -------------------------------- ### Create identity with default settings (sender persona only) Source: https://www.migadu.com/api Creates a new identity on the mailbox demo@mydomain.org. The identity uses the default password behavior (password_use: none) and acts as a sender persona only. Successful request returns HTTP 200 with the identity JSON; failure returns HTTP 400. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"name":"Identity Name", "local_part":"example"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/identities \ -H "Content-Type:application/json" ``` -------------------------------- ### Create mailbox with invitation Source: https://www.migadu.com/api Use this curl command to create a new mailbox with an invitation for the user to set their own password. The password_method is set to invitation and password_recovery_email is provided. The request returns HTTP 200 on success. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"name":"Mailbox Name", "local_part":"demo", "password_method":"invitation", "password_recovery_email":"invitee@somewhere.tld"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/mailboxes \ -H "Content-Type:application/json" ``` -------------------------------- ### Create mailbox with password and forwarding Source: https://www.migadu.com/api Use this curl command to create a new mailbox with an immediate password and optional forwarding to an external address. The forwarding_to field is optional and only used when creating forwardings immediately. The request returns HTTP 200 on success. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"name":"Mailbox Name","local_part":"demo", "password":"Sup3r_s3cr3T","forwarding_to":"external@external.com"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/mailboxes \ -H "Content-Type:application/json" ``` -------------------------------- ### Create identity using mailbox password (password_use=mailbox) Source: https://www.migadu.com/api Creates an identity that uses the same password as the parent mailbox. The identity can be used as a sender persona and allows login with the parent mailbox password. Successful request returns HTTP 200 with the identity JSON; failure returns HTTP 400. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"name":"Identity Name", "local_part":"example","password_use":"mailbox"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/identities \ -H "Content-Type:application/json" ``` -------------------------------- ### POST /v1/domains Source: https://www.migadu.com/api Creates a new domain under your organization. The `hosted_dns` parameter determines DNS hosting type, and `create_default_addresses` can create default addresses (admin, postmaster, abuse). ```APIDOC ## POST /v1/domains ### Description Create a new domain that does not yet exist under your organization. ### Method POST ### Endpoint https://api.migadu.com/v1/domains ### Authentication Basic Auth (MIGADU_USER:USER_TOKEN) ### Parameters #### Request Body - **name** (string) - Required - The domain name to create (e.g., mydomain.org). - **create_default_addresses** (boolean) - Optional - Whether to create default addresses (admin, postmaster, abuse). If omitted, default addresses will not be created. - **hosted_dns** (boolean) - Optional - Determines the type of DNS hosting. If omitted, defaults to external DNS. Strongly recommended not to use `true` as hosted DNS is planned to be discontinued. ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ -X POST https://api.migadu.com/v1/domains \ -d '{"name":"mydomain.org","create_default_addresses":"true","hosted_dns":"false"}' \ -H "Content-type: application/json" ``` ### Response #### Success Response (200) Returns the JSON representation of the newly created domain. #### Response Example ``` { "name": "mydomain.org", "state": "inactive", "description": "", "tags": [], "activated_at": null, "deactivated_at": null, "recipient_denylist": "", "sender_allowlist": [], "sender_denylist": [], "spam_aggressiveness": 0, "can_access": false, "mx_proxy_enabled": false, "can_receive": false, "can_send": false, "catchall_destinations": [], "subject_rewriting_enabled": false, "junk_subject_keyword_spam": true, "hosted_dns": false, "mailbox_default_incoming_limit": 500, "mailbox_default_outgoing_limit": 100, "mailbox_default_storage_limit": 0, "mailbox_default_sending_enabled": true, "mailbox_default_receiving_enabled": true, "mailbox_default_imap_enabled": true, "mailbox_default_pop3_enabled": true, "mailbox_default_managesieve_enabled": true } ``` ``` -------------------------------- ### Create forwarding with curl POST Source: https://www.migadu.com/api Creates a forwarding on the mailbox demo@mydomain.org. On success, the API returns HTTP 200 with the JSON representation of the new forwarding; on failure, HTTP 400 is returned. ```bash $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"address":"user@external.com"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/mailboxes/demo/forwardings \ -H "Content-Type:application/json" ``` ```json { "address": "user@external.com", "blocked_at": null, "confirmation_sent_at": "2024-12-09T16:34:47Z" , "confirmed_at": null, "expires_on": null, "is_active": true, "remove_upon_expiry": null } ``` -------------------------------- ### POST /v1/domains/{domain}/rewrites Source: https://www.migadu.com/api Creates a new rewrite with a pattern and destinations. The destinations must be on the same domain as the rewrite. ```APIDOC ## POST /v1/domains/{domain}/rewrites ### Description Creates a new rewrite with a pattern and destinations. The destinations must be on the same domain as the rewrite. ### Method POST ### Endpoint https://api.migadu.com/v1/domains/{domain}/rewrites ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name (e.g., mydomain.org). #### Request Body - **name** (string) - Required - The rewrite name (slug). - **local_part_rule** (string) - Required - The pattern to match (e.g., demo-*). - **destinations** (string) - Required - Comma-separated list of destination email addresses on the same domain. ### Request Example ``` $ curl -u MIGADU_USER:USER_TOKEN \ -d '{"name":"demo", "local_part_rule":"demo-*", "destinations": "one@domain.tld,two@domain.tld"}' \ -X POST https://api.migadu.com/v1/domains/mydomain.org/rewrites \ -H "Content-Type:application/json" ``` ### Response #### Success Response (200) Returns the JSON representation of the newly created rewrite. #### Response Example ``` { "name":"demo", "domain_name":"mydomain.org", "local_part_rule":"demo-*", "destinations":["one@mydomain.org","two@mydomain.org"] } ``` #### Error Response (400) Returned if the request did not succeed. ```