Versions

By default, all requests receive the last version of the REST API. We encourage you to explicitly request this version via the Accept header if you’re building an application and care about the stability of the API.

Accept: application/vnd.mailcare.v1+json

Authentication

Authentication is required to access MailCare API endpoints. To authenticate, you need to generate an API token via the “Api Tokens” menu with the appropriate permissions. Once generated, include the token in the Authorization header with the Bearer scheme.

Steps to Retrieve Your API Token

  1. Log In: Go to mailcare.io and log in to your account.
  2. Navigate to API Tokens:
    • Click on your avatar in the top right corner.
    • Go to “Manage Account” > “API Tokens”.
  3. Create a New Token:
    • Enter a token name.
    • Select the appropriate permissions (e.g., email:view).
    • Click the “Create” button.
  4. Copy the Token: Copy the token that is displayed. This token will not be shown again, so make sure to store it securely.

Authorization: Bearer YOUR_TOKEN_HERE

Base URL

All API calls should be made to the following base URL:

https://mailcare.io/api/teams/{teamId}

This serves as the base URL for all API requests. Replace {teamId} with the appropriate team identifier.

Steps to Retrieve Your Team ID

  1. Log In: Go to mailcare.io and log in to your account.
  2. Select Your Team: Use the team selector to choose the team you want to work with.
  3. Navigate to Team Settings:
    • Click on “Team Settings”.
    • The URL will be in the format https://mailcare.io/teams/{teamId}, where {teamId} is your team identifier.

How to Test

You can test the MailCare API using a simple curl command. Here’s an example:

curl -X GET "https://mailcare.io/api/teams/{teamId}/emails" \
     -H "Accept: application/vnd.mailcare.v1+json" \
     -H "Authorization: Bearer YOUR_TOKEN_HERE"

Replace with your actual team ID and YOUR_TOKEN_HERE with your API token.

This command will send a GET request to the specified endpoint, allowing you to test the API and verify that it is working correctly.

This guide should help users get started with the MailCare API, providing clear instructions on authentication, base URL setup, general API usage tips, and how to test the API using a simple curl command.