CountdownMail API

This guide will help you start using the CountdownMail API. It covers how to set up, authenticate, handle errors, and work with countdown timers.

Quickstart

This section will get you ready to use the CountdownMail API and show you how to make your first API request.

  1. Get your API key:
    • Log in to your CountdownMail account.
    • Go to Profile » API.
    • Copy your API key.
  2. Make your first API request:
    • We’ll use the “Create a Timer” endpoint as an example.
    • Use a tool like cURL or Postman to send a POST request to https://countdownmail.com/api/create.
    • Add your API key in the Authorization header.
    • Include the required timer details in the request body (in JSON format).

Here’s an example using cURL:

Request

POST
https://countdownmail.com/api/create

curl -v \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-X POST "https://countdownmail.com/api/create" \
-d '{
    "skin_id": 1,
    "name": "Big Sale!",
    "time_end": "2025-04-21 20:00:00",
    "time_zone": "America/Los_Angeles",
    "font_family": "Roboto-Bold",
    "color_primary": "FF3A43",
    "color_text": "FFFFFF",
    "color_bg": "000000"
}'
                                    
  • Replace YOUR_API_KEY with your actual API key.
  • If everything works, you’ll get a response like this:

Response


{
    "status": "success",
    "message": {
        "id": 1057,
        "code": "td",
        "src": "http://i.countdownmail.com/td.gif"
    }
}
                                    

This response includes a timer code (e.g., "td") and a URL for the timer image.


Authentication

To use the CountdownMail API, you need to authenticate every request with your API key. Here’s how:

  • Add an Authorization header to your request. The value is your API key.
  • Alternatively, use basic authentication: set your API key as the username and leave the password empty.

Example with Authorization Header (cURL):

Request

GET
https://countdownmail.com/api/some_endpoint

curl -v \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-X GET "https://countdownmail.com/api/some_endpoint"
                                    
  • Replace YOUR_API_KEY with your actual API key.
  • Always include authentication, or you’ll get a 401 Unauthorized error.

Using Postman

If you use Postman makes it easy to test API requests. To use it with CountdownMail:

  • Click it to import the CountdownMail API collection. Run in Postman
  • Add your API key to the collection’s authentication settings, and you’re ready to start making requests.

Errors

Sometimes, API requests fail. The CountdownMail API uses HTTP status codes to tell you what went wrong. Here’s a list of possible errors, what they mean, and what to do:

CodeStatus NameDescriptionSuggested Action
400Bad RequestSomething’s wrong with your request.Check your request matches the documentation and uses correct syntax.
401UnauthorizedYou don’t have permission to make this request. Ensure you’re using a valid API key in the Authorization header.
404Not FoundThe server can’t find what you asked for. Verify your URL matches a valid API endpoint.
405Method Not AllowedThe endpoint doesn’t support that method. Use the correct HTTP method (e.g., GET, POST) as shown in the docs.
429Too Many RequestsThe client has sent too many requests in 1 minute. You can use the headers that are sent with each response to determine the current status of your rate limit.
Header nameDescription
X-RateLimit-LimitThe maximum number of requests that you can make per minute
X-RateLimit-RemainingThe number of requests remaining in the current rate limit
X-RateLimit-ResetThe time at which the current rate limit resets, in UTC epoch seconds
500Internal Server ErrorSomething broke on CountdownMail’s side.Try again later. If it keeps happening, contact support.
503Service UnavailableThe server is too busy right now.Wait a bit and try again.

Example Error Response (401 Unauthorized):

Response


{
    "status": "error",
    "message": "Unauthorized"
}
                                    

If you see an error, check the status code and message, then follow the suggested action.


Timer Model

The Timer resource contains all the information about countdown timer. These are the fields available for defining a countdown timer:

PropertyTypeDescriptionRequiredNotes
skin_idintegerThe timer’s design style (template).YesMust be a number between 1 and 23.
namestringThe timer’s name.YesMax 100 characters. Example: Big Sale!
time_endstringWhen the timer ends (YYYY-MM-DD HH:MM:SS). YesExample: 2025-04-09 04:57:16
time_zonestringThe timer’s timezone.YesExample: America/Los_Angeles. See all available time_zone values.
font_familystringFont for the timer text.NoExample: Roboto-Bold. See all available font_family values.
label_font_familystringFont for timer labels.NoExample: Roboto-Bold. See all available font_family values.
color_primarystringMain color (hex code).NoExample: FF3A43 (red).
color_textstringText color (hex code).NoExample: FFFFFF (white).
color_bgstringBackground color (hex code).NoExample: 000000 (black).
font_sizeintegerSize of the timer text.NoBetween 14 and 73.
label_font_sizeintegerSize of the label text.NoBetween 0 and 50.
dayintegerShow days (0 = no, 1 = yes).NoMust be 0 or 1.
langstringLanguage code (ISO 2-letter).NoExample: en (English). Valid values are: 'ar', 'bg', 'cs', 'da', 'de', 'el', 'en', 'es', 'fa', 'fi', 'fr', 'he', 'hi', 'hu', 'it', 'ja', 'ko', 'lt', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sv', 'th', 'tr', 'uk', 'vi', 'zh'
transparentintegerBackground: 0 = solid, 1 = transparent.NoMust be 0 or 1.
expired_mes_onintegerShow expiry message (0 = no, 1 = yes).NoMust be 0 or 1.
expired_messtringMessage when timer expires.NoMax 100 characters. Example: This offer has expired.
labelsintegerUse custom labels (0 = no, 1 = yes).NoMust be 0 or 1.
daysstringLabel for days.NoMax 15 characters. Example: days.
hoursstringLabel for hours.NoMax 15 characters. Example: hours.
minutesstringLabel for minutes.NoMax 15 characters. Example: minutes.
secondsstringLabel for seconds.NoMax 15 characters. Example: seconds.
advanced_paramsobjectExtra settings (e.g., separator color).No

Example


{
    "separator_color"  : "4275BC",
    "separator_size" : 1.3,
    "separator_style" : 6,
    "labels_color" : "A3A3A3"
}
                                    

Create a Timer

This endpoint allows you to create a timer. To create a new timer, you must provide all required properties.

Example Request:

Request

POST
https://countdownmail.com/api/create

{
    "skin_id":3,
    "name":"Big Sale!",
    "time_end":"2025-05-12 20:00:00",
    "time_zone":"America\/Los_Angeles",
    "font_family":"Roboto-Bold",
    "color_primary":"FF3A43",
    "color_text":"FFFFFF",
    "color_bg":"000000",
    "transparent":"0",
    "lang_local":"0",
    "font_size":"38",
    "day":"1",
    "lang":"en",
    "expired_mes_on":"1",
    "expired_mes":"This offer has expired",
    "labels":"1",
    "days":"days",
    "hours":"hours",
    "minutes":"minutes",
    "seconds":"seconds"
}
                                    

Response


{
    "status": "success",
    "message": {
        "id": 1057,
        "code": "td",
        "src": "http://i.countdownmail.com/td.gif"
    }
}
                                    

Update a Timer

This endpoint allows you to update any timer attribute. To update a timer, send a PUT request to /update/{code} with the fields you want to update. Replace {code} with the timer’s code (e.g., "td").

Example Request:

Request

PUT
https://countdownmail.com/api/update/{code}

{
    "skin_id":6,
    "name":"Flash Sale!",
    "time_end":"2025-05-12 20:00:00"
}
                                    

Response


{
    "status": "success",
    "message": {
        "id": 1057,
        "code": "td",
        "src": "http://i.countdownmail.com/td.gif"
    }
}
                                    

Duplicate a Timer

To make a copy of an existing timer, send a POST request to /duplicate/{code}. Replace {code} with the unique code of the timer you want to copy. This will create a new timer that starts with the same settings as the original one.

You can also update some details of the new timer by adding a JSON object in the request body. This lets you change specific attributes, like the end time or name, while keeping everything else the same as the original. The attributes you can update are the same ones you can set when creating a new timer (check the Timer Model section for the full list). If you don’t include an attribute in the request body, it will stay the same as it was in the original timer.

Important: The original timer does not change. Only the new timer is affected by the updates you send in the request.

Example Request:

Request

POST
https://countdownmail.com/api/duplicate/{code}

{
    "skin_id":6,
    "name":"Flash Sale!",
    "time_end":"2025-05-12 20:00:00"
}
                                    

Response


{
    "status": "success",
    "message": {
        "id": 1057,
        "code": "td",
        "src": "http://i.countdownmail.com/td.gif"
    }
}
                                    

Deactivate a Timer

To stop a timer (archive), send a GET request to /deactivate/{code}. Replace {code} with the timer’s code.


Activate a Timer

To activate a timer again, send a GET request to /activate/{code}. Replace {code} with the timer’s code.


Delete a Timer

To delete a timer, send a DELETE request to /delete/{code}. Replace {code} with the timer’s code.


This guide should give you everything you need to start using the CountdownMail API. Keep your API key safe, and refer to the official documentation for more details on fields like timezones or fonts!

🍪 Cookie Notice

This website uses only necessary cookies, which do not contain personal data. You can find out more about the cookies used in our privacy policy