Skip to content
No results
MEC Knowledgebase
  • Installation
    • Installation
    • Activation
    • Auto Update
    • Manual Update
    • Change License Domain
  • Settings
    • General
    • Archive Page
    • Slugs/Permalinks
    • Currency
    • View All
  • Single Event
    • Single Event Settings
    • How to Add Event In MEC Plugin?
    • MEC Single Sidebar
    • Custom Fields
    • View All
  • Event Modules
    • Speakers
    • Organizers
    • Locations
    • Map
    • View All
  • Booking Settings
    • Booking Module
    • Booking Elements
    • Booking Form
    • Payment Gateways
    • View All
  • Event Submission
    • General
    • Access Level
    • FES Sections
    • Required Fields
    • View All
  • Integrations
    • Mailchimp
    • Paid Memberships Pro
    • BuddyPress
    • LearnDash
    • View All
  • Notifications
    • Booking Notification
    • Booking Confirmation
    • Booking Reminder
    • Admin Notification
    • View All
  • Addons
    • Elementor Single Builder Addon
    • Ticket and Invoice Addon
    • Event Seat Addon
    • Virtual Events Addon
    • View All
  • Other
    • Appearance Settings
    • Translation
    • Knowledge
    • Troubleshooting
    • Developer
MEC Knowledgebase

  • Categories
    • Installation
      • Installation
      • Activation
      • Auto Update
      • Manual Update
      • Change License Domain
    • General Settings
      • General
      • Archive Pages
      • Slugs/Permalinks
      • Currency
      • View All
    • Single Event
      • Single Event Settings
      • MEC Single Sidebar
      • How to Add Event In MEC Plugin?
      • Custom Fields
      • View All
    • Event Modules
      • Speakers
      • Organizers
      • Locations
      • Map
      • View All
    • Booking Settings
      • Booking Module
      • Add a Booking System
      • Booking Form
      • Organizer Payment Settings
      • View All
    • Event Submission
      • General
      • Access Level
      • FES Sections
      • Required Fields
      • View All
    • MEC Integrations
      • Mailchimp
      • BuddyPress
      • LearnDash
      • Paid Memberships Pro
      • View All
    • Notifications
      • Booking Notification
      • Booking Confirmation
      • Booking Reminder
      • Admin Notification
      • View All
    • Addons
      • Elementor Single Builder Addon
      • Ticket and Invoice Addon
      • Event Seat Addon
      • Virtual Events Addon
      • View All
    • Other
      • Appearance Settings
      • Translation
      • Knowledge
      • Troubleshooting
      • Developer

Submit a Ticket
MEC Knowledgebase

Toggle
  • Base URL
  • API Key
  • All Events
    • Request
    • Response
  • Single Event
    • Request
    • Response
  • Login
    • Request
    • Response
  • Upload Image
    • Request
    • Response
  • Upload File
    • Request
    • Response
  • Create Event
    • Request
    • Response
  • Edit Event
    • Request
    • Response
  • My Events
    • Request
    • Response
  • Trash Event
    • Request
    • Response
  • Delete Event
    • Request
    • Response
  • Taxonomy Entities
    • List Taxonomy Entities
      • Path Parameters:
      • Query Parameters:
      • Sample Response:
      • Notes:
    • Get Single Taxonomy Entity
      • Path Parameters:
      • Sample Response (Category):
      • Sample Response (Speaker):
      • Sample Response (Sponsor):
      • Sample Response (Label):
      • Sample Response (Tag):
    • Create Taxonomy Entity
      • Path Parameters:
      • Request Body:
      • Entity-specific parameters:
      • Sample Request (Category):
      • Sample Request (Speaker):
      • Sample Request (Sponsor):
      • Sample Request (Label):
      • Sample Request (Tag):
      • Sample Response:
    • Update Taxonomy Entity
      • Path Parameters:
      • Request Body:
      • Sample Request:
      • Sample Response:
    • Delete Taxonomy Entity
      • Path Parameters:
      • Sample Response:
    • Error Responses
      • Entity not found (404):
      • Unauthorized (401):
      • Validation error (400):
  • Custom Fields
    • Request
    • Response
  • Icons
    • Request
    • Response
  • Weather
    • Request
    • Response
  • Related Events
    • Request
    • Response
  • Next / Previous Events
    • Request
    • Response
  • Next Occurrences
    • Request
    • Response
  • Attendee Fields
    • Request
    • Response
  • Fixed Fields
    • Request
    • Response
  • Ticket Variations
    • Request
    • Response
  • Booking Tax / Fees
    • Request
    • Response
  • Tickets
    • Request
    • Response

Developer

MEC Restful API

The RESTful API in Modern Events Calendar allows developers to programmatically access, retrieve, and manage event data from external applications, websites, or services. It provides a structured and standardized way to interact with MEC data (such as events, locations, organizers, and schedules) without relying on the WordPress interface. This makes it suitable for integrations with mobile apps, third-party platforms, or custom front-end implementations.

Base URL

The base URL is different per website but the general pattern is like the following.

http://example.com/wp-json/mec/v1.0

API Key

The API key is required for all the following commands. You should send the API key in headers with the name of mec-token If you don’t send mec-token in headers then you will receive an invalid_api_token error.

All Events

GET    /events/

This is a public command, it means all users with an API key can run it.

Request

Send the following parameters as JSON.

NameTypeAccepted ValuesExample
limitinteger 12
orderstringASC / DESCASC
offsetinteger 0
startstringtoday / date / tomorrow / yesterday/ start_last_month / start_current_month / start_next_monthdate
start_datestring(yyyy-mm-dd)2024-12-15
show_only_past_eventsinteger0,10
include_past_eventsinteger0,10
show_only_ongoing_eventsinteger0,10
include_ongoing_eventsinteger0,10

Response

You will receive all events in the events key of the response. Events are categorized based on their start date so you can utilize that to display the events in any format you need like list view, monthly calendar view, weekly timetable view or anything else.

You can also use the pagination key of the response to read all events page by page. Just send the next_date value as start_date of your next request and send next_offset as the value of the offset parameter.

{
   "events": {
      "2025-01-15": [{ ... }],
	...
   },
   "pagination": {
       "next_date": "2025-12-15",
       "next_offset": 1,
       "has_more_events": true,
       "found": 12
   }
}

Single Event

GET    /events/{id}

This is a public command, it means all users with an API key can run it.

Request

Send the following parameters as a query string.

NameTypeExample
id *integer1
occurrenceinteger1747335600

Response

You will receive a bunch of information included but not limited to the following. The data key has many useful information about the event that you can use in your application. The dates key has upcoming dates of the event. You can send the start timestamp value that you can see as an occurrence value in the query string to move forward in the time. Also the date key holds information about the current occurrence.

{
   "ID": 1,
   "data": { ... },
   "dates": [{
     "start": {
         "date": "2025-05-15",
         "hour": 7,
         "minutes": "0",
         "ampm": "PM",
         "timestamp": 1747335600
     },
     "end": {
         "date": "2025-05-15",
         "hour": 11,
         "minutes": "0",
         "ampm": "PM",
         "timestamp": 1747350000
     },
     "allday": "0",
     "hide_time": "0",
     "past": 0
   }],
   "date": {}
}

Login

POST    /login

Request

Send the following parameters as regular-form data.

NameTypeExample
username *stringuser
password *string12345678

Response

Use the token to authorize users in other commands. You should send it as a new header named user-token for those commands that require authentication like my-events or trash events commands.

{
   "success": 1,
   "id": 1,
   "token": "W2X53XpClol8TquAIKWaZo0j68L0tuho3o4wmwD0"
}

Upload Image

POST    /images

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

Send following parameters as JSON.

NameTypeExample
image *file

Response

Use the image_id in other commands like creating events, etc.

{
    "success": 1,
    "image_id": 10
}

Upload File

POST    /files

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

Send the following parameters as JSON.

NameTypeExample
file *file

Response

Use the file_id in other commands like creating events, etc.

{
    "success": 1,
    "file_id": 10
}

Create Event

POST    /events

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

Send the following parameters as JSON.

NameTypeExample
title *stringEvent Title
contentstringEvent Content
location[name]stringArt Gallery
location[address]textArt Gallery, City
location[latitude]float
location[longitude]float
location[thumbnail]int10
organizer[name]string John Due
organizer[email] email [email protected]
organizer[tel]tel +13007772299
organizer[url]url https://google.com
organizer[thumbnail]number 10
start_datedate (yyyy-mm-dd)2025-06-01
start_hourint10
start_minutesint15
start_ampmstring AM
end_datedate (yyyy-mm-dd)2025-06-01
end_hourint2
end_minutesint45
end_ampmstringPM

Response

Use the event_id in other commands like get single event, etc.

{
    "success": 1,
    "message": "The event is published.",
    "event_id": 12
}

Edit Event

PUT    /events/{id}

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

The request is exactly like the create event command.

Response

The response is also exactly like the create event command.

My Events

GET    /my-events

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

Send the following parameters as JSON.

NameTypeExample
limit *integer12
pages *integer1

Response

You can loop through the events to display all events. Use the pagination data to navigate through the pages of events.

{
   "events": [
       {
           "id": 2645,
           "title": "Monthly",
           "url": "http://example.com/events/monthly/",
           "status": "publish"
       }
   ],
   "pagination": {
       "current_page": 2,
       "total_pages": 5
   }
}

Trash Event

DELETE    /events/{id}/trash

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
   "success": 1
}

Delete Event

DELETE    /events/{id}

Users must be authenticated for this command. Both mec-token and user-token should be included in the headers.

This command will force delete an event. It doesn’t matter if the event is already trashed or not.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
   "success": 1
}

Taxonomy Entities

These endpoints allow you to manage MEC taxonomy entities including categories, tags, labels, speakers, and sponsors.

Users must be authenticated for these commands. Both mec-token and user-token should be included in the headers.

List Taxonomy Entities

GET    /taxonomies/{entity}

Path Parameters:

ParameterTypeDescription
entitystringThe entity type. One of: categories, tags, labels, speakers, sponsors

Query Parameters:

ParameterTypeDefaultDescription
limitint20Number of items per page
pagedint1Page number
orderbystringnameSort field. Options: name, slug, count, term_id
orderstringASCSort order. Options: ASC, DESC
searchstringSearch term to filter results
hide_emptybooleanfalseWhether to hide empty terms

Sample Response:

{
    "data": {
        "categories": [
            {
                "id": 1,
                "name": "Music",
                "slug": "music",
                "description": "",
                "count": 5,
                "taxonomy": "mec_category",
                "icon": "",
                "color": "",
                "fallback_image": "",
                "parent": 0
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 20,
            "total": 1,
            "total_pages": 1
        }
    },
    "status": 200
}

Notes:

  • For categories, each item includes icon, color, fallback_image, and parent fields.
  • For labels, each item includes color and style fields.
  • For speakers, each item includes type, job_title, tel, email, website, mec_index, facebook, twitter, instagram, linkedin, and thumbnail fields.
  • For sponsors, each item includes link and logo fields.
  • For tags, only default term fields (id, name, slug, description, count, taxonomy) are returned.
  • Speakers and sponsors must be enabled in MEC settings to be accessible.

Get Single Taxonomy Entity

GET    /taxonomies/{entity}/{id}

Path Parameters:

ParameterTypeDescription
entitystringThe entity type. One of: categories, tags, labels, speakers, sponsors
idintThe term ID

Sample Response (Category):

{
    "data": {
        "category": {
            "id": 1,
            "name": "Music",
            "slug": "music",
            "description": "",
            "count": 5,
            "taxonomy": "mec_category",
            "icon": "",
            "color": "#ff0000",
            "fallback_image": "",
            "parent": 0
        }
    },
    "status": 200
}

Sample Response (Speaker):

{
    "data": {
        "speaker": {
            "id": 2,
            "name": "John Doe",
            "slug": "john-doe",
            "description": "",
            "count": 3,
            "taxonomy": "mec_speaker",
            "type": "person",
            "job_title": "CEO",
            "tel": "+1234567890",
            "email": "[email protected]",
            "website": "https://example.com",
            "mec_index": "1",
            "facebook": "https://facebook.com/johndoe",
            "twitter": "https://twitter.com/johndoe",
            "instagram": "",
            "linkedin": "",
            "thumbnail": ""
        }
    },
    "status": 200
}

Sample Response (Sponsor):

{
    "data": {
        "sponsor": {
            "id": 3,
            "name": "Acme Inc",
            "slug": "acme-inc",
            "description": "",
            "count": 2,
            "taxonomy": "mec_sponsor",
            "link": "https://acme.com",
            "logo": "https://example.com/logo.png"
        }
    },
    "status": 200
}

Sample Response (Label):

{
    "data": {
        "label": {
            "id": 5,
            "name": "Featured",
            "slug": "featured",
            "description": "",
            "count": 12,
            "taxonomy": "mec_label",
            "color": "#ff0000",
            "style": ""
        }
    },
    "status": 200
}

Sample Response (Tag):

{
    "data": {
        "tag": {
            "id": 7,
            "name": "Workshop",
            "slug": "workshop",
            "description": "Hands-on workshop sessions",
            "count": 8,
            "taxonomy": ""
        }
    },
    "status": 200
}

Create Taxonomy Entity

POST    /taxonomies/{entity}

Path Parameters:

ParameterTypeDescription
entitystringThe entity type. One of: categories, tags, labels, speakers, sponsors

Request Body:

Common parameters for all entity types:

ParameterTypeRequiredDescription
namestringYesThe entity name
slugstringNoURL-friendly slug (auto-generated if omitted)
descriptionstringNoDescription of the entity

Entity-specific parameters:

For categories:

ParameterTypeRequiredDescription
parentintNoParent category ID
iconstringNoCSS class for the category icon
colorstringNoHex color code (e.g., #ff0000)
fallback_imagestringNoURL for fallback image

For labels:

ParameterTypeRequiredDescription
colorstringNoHex color code for the label
stylestringNoLabel style

For speakers:

ParameterTypeRequiredDescription
typestringNoperson or group. Default: person
job_titlestringNoJob title of the speaker
telstringNoTelephone number
emailstringNoEmail address
websitestringNoWebsite URL
mec_indexintNoDisplay order index. Default: 99
facebookstringNoFacebook profile URL
twitterstringNoTwitter profile URL
instagramstringNoInstagram profile URL
linkedinstringNoLinkedIn profile URL
thumbnailstringNoThumbnail image URL

For sponsors:

ParameterTypeRequiredDescription
linkstringNoSponsor website URL
logostringNoSponsor logo image URL

Sample Request (Category):

{
    "name": "Conference",
    "slug": "conference",
    "description": "Conference events",
    "color": "#3498db",
    "icon": "mec-fa-video"
}

Sample Request (Speaker):

{
    "name": "Jane Smith",
    "job_title": "Keynote Speaker",
    "email": "[email protected]",
    "type": "person",
    "twitter": "https://twitter.com/janesmith"
}

Sample Request (Sponsor):

{
    "name": "Tech Corp",
    "link": "https://techcorp.com",
    "logo": "https://techcorp.com/logo.png"
}

Sample Request (Label):

{
    "name": "VIP",
    "color": "#9b59b6",
    "style": ""
}

Sample Request (Tag):

{
    "name": "Technology",
    "description": "Technology-related events"
}

Sample Response:

{
    "data": {
        "success": 1,
        "category": {
            "id": 10,
            "name": "Conference",
            "slug": "conference",
            "description": "Conference events",
            "count": 0,
            "taxonomy": "mec_category",
            "icon": "mec-fa-video",
            "color": "#3498db",
            "fallback_image": "",
            "parent": 0
        }
    },
    "status": 200
}

Update Taxonomy Entity

PUT    /taxonomies/{entity}/{id}

Path Parameters:

ParameterTypeDescription
entitystringThe entity type. One of: categories, tags, labels, speakers, sponsors
idintThe term ID to update

Request Body:

Same parameters as Create. Only include the fields you want to update.

Sample Request:

{
    "name": "International Conference",
    "color": "#e74c3c"
}

Sample Response:

{
    "data": {
        "success": 1,
        "category": {
            "id": 10,
            "name": "International Conference",
            "slug": "conference",
            "description": "Conference events",
            "count": 0,
            "taxonomy": "mec_category",
            "icon": "mec-fa-video",
            "color": "#e74c3c",
            "fallback_image": "",
            "parent": 0
        }
    },
    "status": 200
}

Delete Taxonomy Entity

DELETE    /taxonomies/{entity}/{id}

Path Parameters:

ParameterTypeDescription
entitystringThe entity type. One of: categories, tags, labels, speakers, sponsors
idintThe term ID to update

Sample Response:

{
    "data": {
        "success": 1
    },
    "status": 200
}

Error Responses

Entity not found (404):

{
    "data": {
        "code": "404",
        "message": "Taxonomy entity not found!"
    },
    "status": 404
}

Unauthorized (401):

{
    "data": {
        "code": "401",
        "message": "You're not authorized to manage this taxonomy!"
    },
    "status": 401
}

Validation error (400):

{
    "data": {
        "code": "400",
        "message": "Name field is required!"
    },
    "status": 400
}

Custom Fields

GET    /config/custom-fields

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fields": {
        "1": {
            "mandatory": "1",
            "type": "text",
            "label": "Your Comment"
        },
        "2": {
            "mandatory": "0",
            "type": "date",
            "label": "Preferred Date"
        },
        "3": {
            "mandatory": "0",
            "ignore": "0",
            "type": "select",
            "label": "Gender",
            "options": {
                "1": {
                    "label": "Male"
                },
                "2": {
                    "label": "Female"
                }
            }
        }
    }
}

Icons

GET    /config/icons

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "icons": [
        {
            "name": "Location Marker Icon",
            "default": "<i class=\"mec-sl-location-pin\"></i>",
            "modules": [
                "single",
                "shortcode"
            ],
            "value": "<img class=\"mec-custom-image-icon\" src=\"http://site.com/wp-content/uploads/2025/03/location.jpg\" alt=\"location-pin\">"
        }
    ]
}

Weather

GET    /events/{id}/weather

This is a public command, it means all users with an API key can run it.

Request

Send following parameters as query string.

NameTypeExample
datestringyyyy-mm-dd

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "weather": {
        "icon": "//cdn.weatherapi.com/weather/64x64/day/113.png",
        "condition": "Sunny",
        "temp_c": 13.699999999999999,
        "temp_f": 56.700000000000003,
        "wind_kph": 9,
        "wind_mph": 5.5999999999999996,
        "humidity": 58,
        "feelslike_c": 13.199999999999999,
        "feelslike_f": 55.799999999999997
    }
}

Related Events

GET    /events/{id}/related-events

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "related_events": [
        {
            "id": 21,
            "title": "Daily Event",
            "url": "http://site.com/events/daily-event/",
            "timestamp": 1746432000,
            "date": "May 5, 2025"
        }
    ]
}

Next / Previous Events

GET    /events/{id}/next-previous-events

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "next": {
        "id": "21",
        "title": "Daily Event",
        "url": "http://rezamiri.test/events/daily-event/"
    },
    "previous": []
}

Next Occurrences

GET    /events/{id}/next-occurrences

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "occurrences": [
        {
            "start": {
                "date": "2025-05-10",
                "hour": "8",
                "minutes": "0",
                "ampm": "AM",
                "timestamp": 1746864000
            },
            "end": {
                "date": "2025-05-10",
                "hour": 6,
                "minutes": "0",
                "ampm": "PM",
                "timestamp": 1746900000
            },
            "allday": "0",
            "hide_time": "0",
            "past": 0
        }
    ]
}

Attendee Fields

GET    /config/attendee-fields

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fields": [
        {
            "mandatory": "1",
            "type": "mec_email",
            "label": "Email"
        },
        {
            "mandatory": "1",
            "type": "name",
            "label": "Name"
        },
        {
            "mandatory": "0",
            "type": "textarea",
            "label": "Text",
            "mapping": ""
        }
    ]
}

Fixed Fields

GET    /config/fixed-fields

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fields": {
        "1": {
            "mandatory": "0",
            "type": "text",
            "label": "Text"
        },
        "2": {
            "mandatory": "1",
            "type": "date",
            "label": "Date"
        }
    }
}

Ticket Variations

GET    /config/ticket-variations

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "ticket_variations": {
        "1": {
            "title": "Pizza",
            "price": "6",
            "max": "2"
        },
        "2": {
            "title": "Juice",
            "price": "4",
            "max": "3"
        }
    }
}

Booking Tax / Fees

GET    /events/{id}/fees

This is a public command, it means all users with an API key can run it.

Request

None.

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "fees": {
        "1": {
            "title": "Tax",
            "amount": "12",
            "type": "percent"
        },
        "2": {
            "title": "Deposit",
            "amount": "50",
            "type": "amount_per_booking"
        }
    }
}

Tickets

GET    /events/{id}/tickets

This is a public command, it means all users with an API key can run it.

Request

NameTypeExample
occurrencestringyyyy-mm-dd hh:mm:ss

Response

If the command was successful you will receive the following response otherwise an error object with proper http code will be returned.

{
    "success": 1,
    "tickets": {
        "1": {
            "name": "Ticket A",
            "ticket_start_time_hour": "08",
            "ticket_start_time_minute": "0",
            "ticket_end_time_hour": "06",
            "ticket_end_time_minute": "0",
            "description": "",
            "private_description": "",
            "price": "8.97",
            "price_label": "$8.97",
            "limit": "",
            "unlimited": "0",
            "seats": "1",
            "minimum_ticket": "1",
            "maximum_ticket": "",
            "stop_selling_value": "0",
            "stop_selling_type": "day",
            "dates": [],
            "ticket_start_time_ampm": "AM",
            "ticket_end_time_ampm": "PM",
            "category_ids": [],
            "id": 1,
            "variations": {
                "1": {
                    "title": "Pizza",
                    "price": "6",
                    "max": "2"
                },
                "2": {
                    "title": "Juice",
                    "price": "4",
                    "max": "3"
                }
            }
        }
    },
    "availability": {
        "1": 100,
        "seats_1": 1,
        "total": 100
    }
}

Share

Report Out Dated Content

If you think the content of this page does not reflect updated information, please let us know.

Report Now
2
3
Login Submit
0 Comments

No Comment.

Still no luck? We can help!

If you did not find what you were looking for, please submit a ticket in our support system.

Submit a Ticket
Webnus Banner
Modern Events Calendar

Please read our Terms and Conditions and Privacy Policy.

4.2 Great

About 11 Review us on Trustpilot

Copyright © 2023. All rights reserved. Webnus Inc.