### Subscriber Import Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/subscriber-imports Example JSON response when retrieving details of a completed subscriber import. ```json { "data": { "id": 99, "uuid": "363fb337-7030-4bfd-8f8a-716493bb6c24", "subscribers_csv": null, "status": "completed", "email_list_uuid": "befd416e-a776-40c8-8d26-c3322091d697", "subscribe_unsubscribed": false, "unsubscribe_others": false, "imported_subscribers_count": 178, "error_count": 565 } } ``` -------------------------------- ### Template Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/templates This is an example of the JSON response when retrieving a list of templates. It includes template details and pagination information. ```json { "data": [ { "uuid": "2ca0e737-b907-468f-819f-5d16e6bd6852", "name": "alias", "html": "...\n", "structured_html": null, "created_at": "2020-08-06T12:11:26.000000Z", "updated_at": "2020-08-06T12:11:26.000000Z" }, { "uuid": "a69075c6-ff5c-4b6a-b217-12026cb72e4f", "name": "consectetur", "html": "...\n", "structured_html": null, "created_at": "2020-08-06T12:11:26.000000Z", "updated_at": "2020-08-06T12:11:26.000000Z" }, { "uuid": "11ce123b-57c4-429b-9840-c79f8047d8aa", "name": "velit", "html": "...\n", "structured_html": null, "created_at": "2020-08-06T12:11:26.000000Z", "updated_at": "2020-08-06T12:11:26.000000Z" } ], "links": { "first": "https:///api/templates?page=1", "last": "https:///api/templates?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/templates", "per_page": 15, "to": 3, "total": 3 } } ``` -------------------------------- ### Start Subscriber Import Source: https://www.mailcoach.app/api-documentation/endpoints/subscriber-imports Initiate the import process for subscribers that have been staged. The import must be in a `draft` status before starting. This endpoint does not require a request body. ```bash $ MAILCOACH_TOKEN="your API token" $ curl -x POST https:///api/subscriber-imports/2ca0e737-b907-468f-819f-5d16e6bd6852/start \ -H "Authorization: Bearer $MAILCOACH_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Start Subscriber Import Source: https://www.mailcoach.app/api-documentation/reference Starts a subscriber import job. The import must be in draft status and the CSV must have an 'email' header column. ```bash curl -X POST https://www.mailcoach.app/api-spec/{baseUrl}/api/subscriber-imports/{subscriberImport}/start ``` -------------------------------- ### Campaign Creation Payload Example Source: https://www.mailcoach.app/api-documentation/endpoints/campaigns This is an example of the JSON payload structure required when creating a campaign. The 'name' and 'email_list_uuid' are mandatory. ```json { "name": "Campaign name", "email_list_uuid": "0762df4d-8516-4eb3-95db-b26492cf221c", "html": "html" } ``` -------------------------------- ### Email List Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/email-lists This is an example of the JSON response when retrieving email lists. It includes details for each list and pagination information. ```json { "data": [ { "uuid": "a69075c6-ff5c-4b6a-b217-12026cb72e4f", "name": "debitis", "active_subscribers_count": 0, "campaigns_feed_enabled": true, "default_from_email": "hertha.tremblay@rau.com", "default_from_name": "Davin Daniel", "allow_form_subscriptions": false, "redirect_after_subscribed": null, "redirect_after_already_subscribed": null, "redirect_after_subscription_pending": null, "redirect_after_unsubscribed": null, "requires_confirmation": false, "confirmation_mail_subject": null, "confirmation_mail_content": null, "confirmation_mailable_class": null, "campaign_mailer": "log", "automation_mailer": "log", "transactional_mailer": "log", "report_recipients": null, "report_campaign_sent": false, "report_campaign_summary": false, "report_email_list_summary": false, "email_list_summary_sent_at": null, "created_at": "2020-08-06T13:12:08.000000Z", "updated_at": "2020-08-06T13:12:08.000000Z" }, ... ], "links": { "first": "https:///api/email-lists?page=1", "last": "https:///api/email-lists?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/email-lists", "per_page": 15, "to": 3, "total": 3 } } ``` -------------------------------- ### Get All Templates Source: https://www.mailcoach.app/api-documentation/endpoints/templates Use this endpoint to list all available templates. You can filter and sort the results. ```bash $ MAILCOACH_TOKEN="your API token" $ curl https:///api/templates \ -H "Authorization: Bearer $MAILCOACH_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Campaign Unsubscribes Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/campaigns Example JSON response when retrieving unsubscribes for a campaign. Includes campaign ID, subscriber ID, and subscriber email. ```json { "data": [ { "campaign_id": 1, "subscriber_id": 1, "subscriber_email": "john@doe.com" } ], "links": { "first": "https:///api/campaigns/0762df4d-8516-4eb3-95db-b26492cf221c/unsubscribes?page=1", "last": "https:///api/campaigns/0762df4d-8516-4eb3-95db-b26492cf221c/unsubscribes?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/campaigns/0762df4d-8516-4eb3-95db-b26492cf221c/unsubscribes", "per_page": 15, "to": 1, "total": 1 } } ``` -------------------------------- ### Campaign Clicks Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/campaigns Example JSON response when retrieving clicks for a campaign. Includes data on URLs, unique click counts, and total click counts. ```json { "data": [ { "url": "https//example.app", "unique_click_count": 1, "click_count": 2 } ], "links": { "first": "https:///api/campaigns/0762df4d-8516-4eb3-95db-b26492cf221c/clicks?page=1", "last": "https:///api/campaigns/0762df4d-8516-4eb3-95db-b26492cf221c/clicks?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/campaigns/0762df4d-8516-4eb3-95db-b26492cf221c/clicks", "per_page": 15, "to": 1, "total": 1 } } ``` -------------------------------- ### Start processing a subscriber import Source: https://www.mailcoach.app/api-documentation/reference Starts the import job for a subscriber import. The import must be in draft status and the CSV must have an `email` header column. ```APIDOC ## POST /subscriber-imports/{subscriberImport}/start ### Description Starts the import job. The import must be in draft status. The CSV must have an `email` header column. ### Method POST ### Endpoint /subscriber-imports/{subscriberImport}/start ### Parameters #### Path Parameters - **subscriberImport** (string) - Required - Subscriber import UUID ### Responses #### Success Response (204) No content — action completed successfully #### Error Responses - **401** (Unauthenticated) - missing or invalid bearer token - **403** (Forbidden) - insufficient permissions - **404** (Resource not found) - **422** (Validation error) ### Response Example (422) ```json { "message": "The given data was invalid.", "errors": { "property1": [ "string" ], "property2": [ "string" ] } } ``` ``` -------------------------------- ### Subscriber Response Sample Source: https://www.mailcoach.app/api-documentation/reference Example JSON response for listing subscribers, including subscriber details, pagination links, and metadata. ```JSON { "data": [ { "uuid": "00000000-0000-0000-0000-000000000000", "email_list_uuid": "00000000-0000-0000-0000-000000000000", "email": "john@example.com", "first_name": "John", "last_name": "Doe", "extra_attributes": { }, "tags": [ "newsletter", "vip" ], "subscribed_at": "2026-01-15T12:00:00.000000Z", "unsubscribed_at": "2019-08-24T14:15:22Z", "created_at": "2026-01-15T12:00:00.000000Z", "updated_at": "2026-01-15T12:00:00.000000Z" } ], "links": { "first": "https://your-app.com/api/templates?page=1", "last": "https://your-app.com/api/templates?page=5", "prev": "http://example.com", "next": "http://example.com" }, "meta": { "current_page": 1, "from": 1, "last_page": 5, "links": [ { "url": "http://example.com", "label": "string", "active": true } ], "path": "http://example.com", "per_page": 15, "to": 15, "total": 73 } } ``` -------------------------------- ### Subscriber Imports Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/subscriber-imports This is an example of the JSON response when retrieving subscriber imports. It includes details like import status, counts, and associated email list UUIDs. ```json { "data": [ { "uuid": "2ca0e737-b907-468f-819f-5d16e6bd6852", "subscribers_csv": null, "status": "completed", "email_list_uuid": "355cd119-59ba-4d8c-af8c-bd03ed091ae7", "subscribe_unsubscribed": false, "unsubscribe_others": false, "imported_subscribers_count": 577, "error_count": 836 }, { "uuid": "363fb337-7030-4bfd-8f8a-716493bb6c24", "subscribers_csv": null, "status": "completed", "email_list_uuid": "befd416e-a776-40c8-8d26-c3322091d697", "subscribe_unsubscribed": false, "unsubscribe_others": false, "imported_subscribers_count": 178, "error_count": 565 }, ... ], "links": { "first": "https:///api/subscriber-imports?page=1", "last": "https:///api/subscriber-imports?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/subscriber-imports", "per_page": 15, "to": 3, "total": 3 } } ``` -------------------------------- ### Transactional Email Templates Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/transactional-mails This is an example of the JSON response when retrieving transactional email templates. It includes details for each template and pagination information. ```json { "data": [ { "uuid": "2ca0e737-b907-468f-819f-5d16e6bd6852", "name": "alias", "to": null, "cc": null, "bcc": null, "subject": "A subject", "html": "", "store_mail": true, "created_at": "2020-08-06T12:11:26.000000Z" }, { "uuid": "a69075c6-ff5c-4b6a-b217-12026cb72e4f", "name": "consectetur", "to": null, "cc": null, "bcc": null, "subject": "A subject", "html": "", "store_mail": true, "created_at": "2020-08-06T12:11:26.000000Z" }, { "uuid": "11ce123b-57c4-429b-9840-c79f8047d8aa", "name": "velit", "to": null, "cc": null, "bcc": null, "subject": "A subject", "html": "", "store_mail": true, "created_at": "2020-08-06T12:11:26.000000Z" } ], "links": { "first": "https:///api/transactional-mails/templates?page=1", "last": "https:///api/transactional-mails/templates?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/transactional-mails/templates", "per_page": 15, "to": 3, "total": 3 } } ``` -------------------------------- ### Tracked Link Response Sample Source: https://www.mailcoach.app/api-documentation/reference Example JSON response when retrieving details for a tracked link. ```JSON { "data": { "uuid": "00000000-0000-0000-0000-000000000000", "url": "http://example.com", "unique_click_count": 0, "click_count": 0, "clicks": [ { "uuid": "00000000-0000-0000-0000-000000000000", "send_uuid": "00000000-0000-0000-0000-000000000000", "link_uuid": "00000000-0000-0000-0000-000000000000", "subscriber_uuid": "00000000-0000-0000-0000-000000000000", "created_at": "2026-01-15T12:00:00.000000Z", "updated_at": "2026-01-15T12:00:00.000000Z" } ] } } ``` -------------------------------- ### Get all templates Source: https://www.mailcoach.app/api-documentation/endpoints/templates Lists all your templates. Supports searching by name and sorting by name or update date. ```APIDOC ## Get all templates ### Description Lists all your templates. Supports searching by name and sorting by name or update date. ### Method GET ### Endpoint /api/templates #### Query Parameters - **filter[search]** (string) - Optional - Search term to filter templates by name. - **sort** (string) - Optional - Field to sort by. Prefix with `-` for descending order (e.g., `-updated_at`). ### Request Example ```bash $ MAILCOACH_TOKEN="your API token" $ curl https:///api/templates \ -H "Authorization: Bearer $MAILCOACH_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (array) - An array of template objects. - **uuid** (string) - The unique identifier of the template. - **name** (string) - The name of the template. - **html** (string) - The HTML content of the template. - **structured_html** (string|null) - The structured HTML content of the template, if available. - **created_at** (string) - The timestamp when the template was created. - **updated_at** (string) - The timestamp when the template was last updated. - **links** (object) - Pagination links. - **meta** (object) - Pagination metadata. #### Response Example ```json { "data": [ { "uuid": "2ca0e737-b907-468f-819f-5d16e6bd6852", "name": "alias", "html": "...\n", "structured_html": null, "created_at": "2020-08-06T12:11:26.000000Z", "updated_at": "2020-08-06T12:11:26.000000Z" } ], "links": { "first": "https:///api/templates?page=1", "last": "https:///api/templates?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/templates", "per_page": 15, "to": 3, "total": 3 } } ``` ``` -------------------------------- ### Email List Subscribers Response Example Source: https://www.mailcoach.app/api-documentation/endpoints/subscribers This is an example of the JSON response you will receive when retrieving subscribers from an email list. It includes subscriber data, pagination links, and metadata. ```json { "data": [ { "email_list_uuid": "a69075c6-ff5c-4b6a-b217-12026cb72e4f", "email": "john@doe.com", "first_name": null, "last_name": null, "extra_attributes": [], "tags": [], "uuid": "2a0c72d9-f91a-4fd2-88a7-589dfd75f464", "subscribed_at": "2020-08-06T13:24:31.000000Z", "unsubscribed_at": null, "created_at": "2020-08-06T13:24:31.000000Z", "updated_at": "2020-08-06T13:24:31.000000Z" }, ... ], "links": { "first": "https:///api/email-lists/a69075c6-ff5c-4b6a-b217-12026cb72e4f/subscribers?page=1", "last": "https:///api/email-lists/a69075c6-ff5c-4b6a-b217-12026cb72e4f/subscribers?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "path": "https:///api/email-lists/a69075c6-ff5c-4b6a-b217-12026cb72e4f/subscribers", "per_page": 15, "to": 3, "total": 3 } } ``` -------------------------------- ### Subscriber Import Creation Response Source: https://www.mailcoach.app/api-documentation/endpoints/subscriber-imports Example JSON response after successfully creating a subscriber import, showing its initial 'draft' status. ```json { "data": { "id": 1, "uuid": "363fb337-7030-4bfd-8f8a-716493bb6c24", "subscribers_csv": "email\njohn@doe.com", "status": "draft", "email_list_uuid": "befd416e-a776-40c8-8d26-c3322091d697", "subscribe_unsubscribed": true, "unsubscribe_others": false, "imported_subscribers_count": null, "error_count": 0 } } ``` -------------------------------- ### Successful Campaign Creation Response Source: https://www.mailcoach.app/api-documentation/endpoints/campaigns This is an example of a successful response when a campaign is created. It includes the campaign's UUID and other details. ```json { "data": { "uuid": "0762df4d-8516-4eb3-95db-b26492cf221c", "name": "Campaign name", "html": "...\n", ... } } ``` -------------------------------- ### List Subscribers with Pagination using Mailcoach SDK Source: https://www.mailcoach.app/api-documentation/introduction/sdk This example demonstrates how to list all subscribers for a given email list and handle pagination. The SDK's `->next()` method is used to retrieve subsequent pages of results. ```php // listing all subscribers of a list $subscribers = $mailcoach->emailList('use-a-real-email-list-uuid-here')->subscribers(); do { foreach($subscribers as $subscriber) { echo $subscriber->email; } } while($subscribers = $subscribers->next()) ``` -------------------------------- ### Add Suppression Payload Example Source: https://www.mailcoach.app/api-documentation/endpoints/suppressions Example of the JSON payload structure for adding a suppression. The 'email' field is mandatory. ```json { "email": "info@example.com", "reason": "manual" } ``` -------------------------------- ### List All Templates Response Sample Source: https://www.mailcoach.app/api-documentation/reference This is a sample JSON response for listing all templates. It includes pagination details and template information. ```json { "data": [ { "uuid": "00000000-0000-0000-0000-000000000000", "name": "Monthly newsletter", "html": "string", "fields": { }, "structured_html": "string", "created_at": "2026-01-15T12:00:00.000000Z", "updated_at": "2026-01-15T12:00:00.000000Z" } ], "links": { "first": "https://your-app.com/api/templates?page=1", "last": "https://your-app.com/api/templates?page=5", "prev": "http://example.com", "next": "http://example.com" }, "meta": { "current_page": 1, "from": 1, "last_page": 5, "links": [ { "url": "http://example.com", "label": "string", "active": true } ], "path": "http://example.com", "per_page": 15, "to": 15, "total": 73 } } ``` -------------------------------- ### Laravel Example: Add Automation Mail with Template Source: https://www.mailcoach.app/api-documentation/endpoints/automation-mails Demonstrates how to add an automation mail using Laravel's HTTP client, including specifying a template and its fields. ```php use Illuminate\Support\Facades\Http; Http::withToken($yourMailcoachApiToken) ->acceptJson() ->post('https:///api/automation-mails', [ 'name' => 'Welcome email', 'subject' => 'Welcome aboard', 'template_uuid' => '86232043-4924-40a1-a0c6-6c9568c4e540', // a valid template uuid 'fields' => [ 'title' => 'Value that will fill the title field of the template', 'content' => 'This value will fill the content field. Can be markdown', ], ]); ``` -------------------------------- ### Get a specific send Source: https://www.mailcoach.app/api-documentation/endpoints/sends Retrieve details of a specific send record by its UUID. This allows you to get information about a particular email that was sent. ```APIDOC ## Get a specific send ### Description Retrieve details of a specific send record by its UUID. This allows you to get information about a particular email that was sent. ### Method GET ### Endpoint /api/sends/{uuid} ### Parameters #### Path Parameters - **uuid** (string) - Required - The unique identifier of the send record. ### Request Example ```bash $ MAILCOACH_TOKEN="your API token" $ curl https:///api/sends/e2cf1b63-6505-3d7a-9c51-a9eb67d97a48 \ -H "Authorization: Bearer $MAILCOACH_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - Contains the details of the send record. - **uuid** (string) - The unique identifier of the send. - **transport_message_id** (string) - The message ID from the transport service, if available. - **campaign_uuid** (string) - The UUID of the campaign this send belongs to. - **automation_mail_uuid** (string) - The UUID of the automation mail this send belongs to. - **transactional_mail_log_item_uuid** (string) - The UUID of the transactional mail log item, if applicable. - **subscriber_uuid** (string) - The UUID of the subscriber who received this send. - **sent_at** (string) - The timestamp when the email was sent. - **failed_at** (string) - The timestamp when the email failed, if applicable. - **failure_reason** (string) - The reason for the failure, if applicable. - **open_count** (integer) - The number of times the email was opened. - **click_count** (integer) - The number of times a link in the email was clicked. - **first_opened_at** (string) - The timestamp of the first open. - **last_opened_at** (string) - The timestamp of the last open. - **first_clicked_at** (string) - The timestamp of the first click. - **last_clicked_at** (string) - The timestamp of the last click. - **created_at** (string) - The timestamp when the record was created. - **updated_at** (string) - The timestamp when the record was last updated. #### Response Example ```json { "data": { "uuid": "e2cf1b63-6505-3d7a-9c51-a9eb67d97a48", "transport_message_id": null, "campaign_uuid": "caaec36d-b5b7-31ab-8f1a-9aff08f47045", "automation_mail_uuid": "9bbdca04-a68f-3bfd-b3c9-e2be829c5f23", "transactional_mail_log_item_uuid": "e3d8b659-cbad-36b9-bb4b-428f78a851be", "subscriber_uuid": "2051c60c-a9f3-31d0-a58c-7adcc32ea2e3", "sent_at": "2022-11-10T09:59:44.000000Z", "failed_at": null, "failure_reason": null, "open_count": null, "click_count": null, "first_opened_at": null, "last_opened_at": null, "first_clicked_at": null, "last_clicked_at": null, "created_at": "2022-11-10T09:58:44.000000Z", "updated_at": "2022-11-10T09:58:44.000000Z" } } ``` ``` -------------------------------- ### Campaign Opens Response Sample Source: https://www.mailcoach.app/api-documentation/reference Example JSON response structure for a successful request to list campaign opens. Includes subscriber details, open counts, and timestamps. ```json { "data": [ { "subscriber_uuid": "00000000-0000-0000-0000-000000000000", "subscriber_email_list_uuid": "00000000-0000-0000-0000-000000000000", "subscriber_email": "user@example.com", "open_count": 0, "first_opened_at": "2026-01-15T12:00:00.000000Z", "last_opened_at": "2026-01-15T12:00:00.000000Z" } ], "links": { "first": "https://your-app.com/api/templates?page=1", "last": "https://your-app.com/api/templates?page=5", "prev": "http://example.com", "next": "http://example.com" }, "meta": { "current_page": 1, "from": 1, "last_page": 5, "links": [ { "url": "http://example.com", "label": "string", "active": true } ], "path": "http://example.com", "per_page": 15, "to": 15, "total": 73 } } ``` -------------------------------- ### 200 OK Response Sample Source: https://www.mailcoach.app/api-documentation/reference This is a sample JSON response for a successful request, typically returning a list of data with pagination information. ```json { "data": [ { "campaign_uuid": "00000000-0000-0000-0000-000000000000", "campaign": { "uuid": "00000000-0000-0000-0000-000000000000", "name": "March 2026 Newsletter", "email_list_uuid": "00000000-0000-0000-0000-000000000000", "email_list": { "uuid": "00000000-0000-0000-0000-000000000000", "name": "Newsletter subscribers", "active_subscribers_count": 1234, "campaigns_feed_enabled": true, "default_from_email": "user@example.com", "default_from_name": "string", "default_reply_to_email": "string", "default_reply_to_name": "string", "allow_form_subscriptions": true, "honeypot_field": "string", "redirect_after_subscribed": "string", "redirect_after_already_subscribed": "string", "redirect_after_subscription_pending": "string", "redirect_after_unsubscribed": "string", "requires_confirmation": true, "confirmation_mailable_class": "string", "campaign_mailer": "string", "automation_mailer": "string", "transactional_mailer": "string", "report_recipients": "string", "report_campaign_sent": true, "report_campaign_summary": true, "report_email_list_summary": true, "email_list_summary_sent_at": "2026-01-15T12:00:00.000000Z", "created_at": "2026-01-15T12:00:00.000000Z", "updated_at": "2026-01-15T12:00:00.000000Z" }, "template_uuid": "bc655329-a633-48b7-8552-661ece461685", "template": { "uuid": "00000000-0000-0000-0000-000000000000", "name": "Monthly newsletter", "html": "string", "fields": { }, "structured_html": "string", "created_at": "2026-01-15T12:00:00.000000Z", "updated_at": "2026-01-15T12:00:00.000000Z" }, "from_email": "user@example.com", "from_name": "string", "status": "draft", "html": "string", "structured_html": "string", "email_html": "string", "webview_html": "string", "fields": { }, "mailable_class": "string", "utm_tags": true, "sent_to_number_of_subscribers": 0, "segment_uuid": "12640c7d-053a-4444-bc16-acf72a5f8a7f", "segment_class": "string", "segment_description": "string", "open_count": 0, "unique_open_count": 0, "open_rate": 0.1, "click_count": 0, "unique_click_count": 0, "click_rate": 0.1, "unsubscribe_count": 0, "unsubscribe_rate": 0.1, "bounce_count": 0, "bounce_rate": 0.1, "sent_at": "2019-08-24T14:15:22Z", "statistics_calculated_at": "2019-08-24T14:15:22Z", "scheduled_at": "2019-08-24T14:15:22Z", "summary_mail_sent_at": "2019-08-24T14:15:22Z", "created_at": "2026-01-15T12:00:00.000000Z", "updated_at": "2026-01-15T12:00:00.000000Z" }, "subscriber_uuid": "00000000-0000-0000-0000-000000000000", "subscriber_email": "user@example.com", "subscriber": { "uuid": "00000000-0000-0000-0000-000000000000", "email_list_uuid": "00000000-0000-0000-0000-000000000000", "email": "john@example.com", "first_name": "John", "last_name": "Doe", "extra_attributes": { }, "tags": [ "newsletter", "vip" ], "subscribed_at": "2026-01-15T12:00:00.000000Z", "unsubscribed_at": "2019-08-24T14:15:22Z", "created_at": "2026-01-15T12:00:00.000000Z", "updated_at": "2026-01-15T12:00:00.000000Z" } } ], "links": { "first": "https://your-app.com/api/templates?page=1", "last": "https://your-app.com/api/templates?page=5", "prev": "http://example.com", "next": "http://example.com" }, "meta": { "current_page": 1, "from": 1, "last_page": 5, "links": [ { "url": "http://example.com", "label": "string", "active": true } ], "path": "http://example.com", "per_page": 15, "to": 15, "total": 73 } } ``` -------------------------------- ### Get a specific tag Source: https://www.mailcoach.app/api-documentation/endpoints/tags-segments Retrieves the details of a specific tag using its UUID. This allows you to get information about a single tag without fetching all tags. ```APIDOC ## Get a specific tag ### Description Retrieves the details of a specific tag using its UUID. This allows you to get information about a single tag without fetching all tags. ### Method GET ### Endpoint /api/email-lists/{uuid}/tags/{tagUuid} ### Parameters #### Path Parameters - **uuid** (string) - Required - The UUID of the email list. - **tagUuid** (string) - Required - The UUID of the tag to retrieve. ### Response #### Success Response (200) - **data** (object) - Contains the tag details. - **uuid** (string) - The unique identifier for the tag. - **name** (string) - The name of the tag. - **email_list** (object) - Details of the associated email list. - **email_list_uuid** (string) - The UUID of the associated email list. - **created_at** (string) - The timestamp when the tag was created. - **updated_at** (string) - The timestamp when the tag was last updated. ### Response Example ```json { "data": { "uuid": "38b9e5cf-d10f-4463-b74d-bf26495e9f5b", "name": "one", "email_list": { "uuid": "7413f633-2652-386d-9eae-25e589538a03", "name": "Another list", ... }, "email_list_uuid": "7413f633-2652-386d-9eae-25e589538a03", "created_at": "2023-02-22T15:11:13.000000Z", "updated_at": "2023-02-22T15:11:13.000000Z" } } ``` ``` -------------------------------- ### Get a specific subscriber Source: https://www.mailcoach.app/api-documentation/endpoints/subscribers Retrieve the details of a specific subscriber by sending a GET request to the /api/subscribers/ endpoint. Authentication is required using an API token. ```APIDOC ## Get a specific subscriber ### Description Retrieve the details of a specific subscriber using their unique identifier. ### Method GET ### Endpoint /api/subscribers/{uuid} ### Parameters #### Path Parameters - **uuid** (string) - Required - The unique identifier of the subscriber. ### Request Example ```bash $ MAILCOACH_TOKEN="your API token" $ curl https:///api/subscribers/2a0c72d9-f91a-4fd2-88a7-589dfd75f464 \ -H "Authorization: Bearer $MAILCOACH_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - Contains the subscriber's details. - **email_list_uuid** (string) - **email** (string) - **first_name** (string | null) - **last_name** (string | null) - **extra_attributes** (array) - **tags** (array) - **uuid** (string) - **subscribed_at** (string) - **unsubscribed_at** (string | null) - **created_at** (string) - **updated_at** (string) #### Response Example ```json { "data": { "email_list_uuid": "a69075c6-ff5c-4b6a-b217-12026cb72e4f", "email": "john@doe.com", "first_name": null, "last_name": null, "extra_attributes": [], "tags": [], "uuid": "2a0c72d9-f91a-4fd2-88a7-589dfd75f464", "subscribed_at": "2020-08-06T13:24:31.000000Z", "unsubscribed_at": null, "created_at": "2020-08-06T13:24:31.000000Z", "updated_at": "2020-08-06T13:24:31.000000Z" } } ``` ``` -------------------------------- ### Create Campaign with Template and Fields using Laravel Source: https://www.mailcoach.app/api-documentation/endpoints/campaigns This Laravel HTTP client example demonstrates creating a campaign using a template and providing custom field values. It includes essential parameters like 'from_email', 'from_name', 'subject', 'email_list_uuid', and 'template_uuid'. ```php use Illuminate\Support\Facades\Http; Http::withToken($yourMailcoachApiToken) ->acceptJson() ->post('https:///api/campaigns', [ 'name' => 'Name of your campaign', 'fields' => [ 'title' => 'Value that will fill the title field of the template', 'content' => 'This value will fill the content field. Can be markdown', ], 'from_email' => 'johndoe@example.com', 'from_name' => 'John Doe', 'subject' => "This will be used as the subject of the outgoing mails", 'email_list_uuid' => '590f564a-3f79-4981-8814-188fe39cc918', // a valid email list uuid 'template_uuid' => '86232043-4924-40a1-a0c6-6c9568c4e540', // a valid template uuid ]); ``` -------------------------------- ### Get Specific Subscriber Details Source: https://www.mailcoach.app/api-documentation/endpoints/subscribers Retrieve the details of a specific subscriber by sending a GET request to the /api/subscribers/ endpoint. Ensure your API token is set. ```bash $ MAILCOACH_TOKEN="your API token" $ curl https:///api/subscribers/2a0c72d9-f91a-4fd2-88a7-589dfd75f464 \ -H "Authorization: Bearer $MAILCOACH_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` ```json { "data": { "email_list_uuid": "a69075c6-ff5c-4b6a-b217-12026cb72e4f", "email": "john@doe.com", "first_name": null, "last_name": null, "extra_attributes": [], "tags": [], "uuid": "2a0c72d9-f91a-4fd2-88a7-589dfd75f464", "subscribed_at": "2020-08-06T13:24:31.000000Z", "unsubscribed_at": null, "created_at": "2020-08-06T13:24:31.000000Z", "updated_at": "2020-08-06T13:24:31.000000Z" } } ``` -------------------------------- ### Create Subscriber Import Source: https://www.mailcoach.app/api-documentation/endpoints/subscriber-imports Create a new subscriber import by sending a POST request with subscriber data and email list information. All fields are required. ```bash $ MAILCOACH_TOKEN="your API token" $ curl -x POST https:///api/subscriber-imports \ -H "Authorization: Bearer $MAILCOACH_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{"subscribers_csv":"email\njohn@doe.com", "email_list_uuid": "befd416e-a776-40c8-8d26-c3322091d697", "subscribe_unsubscribed": true, "unsubscribe_others": false}' ```