tec-calendar-create-update-entities
Create or update events, venues, organizers, and tickets in The Events Calendar. Manage calendar posts with flexible date formats and ticketing options.
Instructions
Create or update a calendar post (Event, Venue, Organizer, or Ticket).
For creating: provide postType and data. For updating: provide postType, id, and data.
FREE TICKETS: To create free tickets, omit the price field entirely. WordPress will automatically default to price 0. Do NOT set price to 0 explicitly as this triggers validation errors. Both Tickets Commerce and RSVP providers support free tickets when the price field is omitted.
TICKET AVAILABILITY DATES: Use start_date and end_date fields to control when tickets are available for purchase. start_date is when tickets become available, end_date is when sales stop (typically the event start time). All ticket date fields must be in Y-m-d H:i:s format (e.g., "2024-12-25 15:30:00"). If not provided, defaults to 1 week before event (start) and event start time (end). By default, end_date will be capped to the event start unless you pass allow_end_after_event: true.
SALE PRICING: To offer tickets at a reduced price during specific periods:
price: Regular ticket price
sale_price: Discounted price (must be less than regular price)
sale_price_start_date: When the sale price becomes active
sale_price_end_date: When the sale price expires (reverts to regular price)
Example: Regular $50 ticket on sale for $35 from Dec 1-15:
{
"price": 50,
"sale_price": 35,
"sale_price_start_date": "2024-12-01",
"sale_price_end_date": "2024-12-15"
}NOTE: Ticket availability dates (start_date, end_date) must be provided in Y-m-d H:i:s format. Sale price dates (sale_price_start_date, sale_price_end_date) must be provided in YYYY-MM-DD format. UNLIMITED TICKETS: To create unlimited tickets, set stock_mode to "unlimited".
IMPORTANT: Ensure your event dates and times use the expected formats and timezone context.
Date Formats Supported
ISO 8601:
"2024-12-25T15:00:00"Date and time:
"2024-12-25 15:00:00"Natural language:
"tomorrow 2pm","next monday","first thursday of next month"Relative:
"+3 days","+2 hours","3 days 1 hour"Specific dates:
"December 15, 2024 7:00 PM"
Workflow for Events with Dates
Calculate appropriate dates for your event
Create/update event with calculated dates
Create Examples
Event Creation
The Events Calendar event post type with date, location, and ticketing information
Example 1: Standard event with ISO dates
{
"postType": "event",
"data": {
"title": "Conference Next Week",
"start_date": "next monday 9am",
"end_date": "next friday 5pm",
"all_day": false,
"timezone": "America/New_York",
"venues": [
456
],
"organizers": [
789
]
}
}Example 2: Event with natural language dates
{
"postType": "event",
"data": {
"title": "Holiday Party",
"start_date": "December 15, 2024 7:00 PM",
"end_date": "December 15, 2024 11:30 PM",
"all_day": false,
"timezone": "America/Denver",
"venues": [
789
],
"cost": "$25 per person"
}
}Example 3: All-day event
{
"postType": "event",
"data": {
"title": "All Day Workshop",
"start_date": "tomorrow",
"end_date": "tomorrow",
"all_day": true,
"timezone": "Europe/London",
"cost": "Free"
}
}Example 4: Event with venue and organizers
{
"postType": "event",
"data": {
"title": "Summer Music Festival",
"start_date": "2024-07-15 18:00:00",
"end_date": "2024-07-15 23:00:00",
"all_day": false,
"timezone": "America/Los_Angeles"
}
}Venue Creation
Location where events take place, including address and contact information
Example 1: Complete venue with address
{
"postType": "venue",
"data": {
"title": "The Grand Ballroom",
"venue": "Grand Ballroom at the Historic Hotel",
"address": "456 Park Avenue",
"city": "New York",
"state": "NY",
"zip": "10022",
"country": "USA",
"phone": "+1 (212) 555-0123",
"website": "https://grandballroom.example.com"
}
}Example 2: Virtual/online venue
{
"postType": "venue",
"data": {
"title": "Beachside Resort",
"venue": "Sunset Beach Resort & Spa",
"address": "1000 Coastal Highway",
"city": "Miami Beach",
"state": "FL",
"zip": "33139",
"country": "US",
"phone": "305-555-BEACH",
"website": "https://sunsetbeachresort.example.com",
"geo_lat": 25.7906,
"geo_lng": -80.13
}
}Organizer Creation
Person or organization responsible for hosting events
Example 1: Organization with full contact
{
"postType": "organizer",
"data": {
"title": "Local Arts Council",
"email": "info@localartscouncil.org",
"website": "https://localartscouncil.org",
"phone": "(555) 123-4567"
}
}Example 2: Individual organizer
{
"postType": "organizer",
"data": {
"title": "DJ Mike Stevens",
"organizer": "Mike Stevens - Professional DJ",
"email": "bookings@djmikestevens.com",
"phone": "+1-555-DJ-MIKE",
"website": "https://djmikestevens.example.com"
}
}Ticket Creation
Event ticket as returned by the API, including read-only fields like sold count and calculated values.
Example 1: Paid general admission
{
"postType": "ticket",
"data": {
"title": "General Admission",
"event": 123,
"price": 25,
"stock": 100,
"capacity": 100,
"sku": "GA-2024-001"
}
}Example 2: VIP ticket with limited availability
{
"postType": "ticket",
"data": {
"title": "VIP Pass",
"event": 123,
"price": 150,
"stock": 20,
"capacity": 30,
"sku": "VIP-2024-001"
}
}Update Examples
Updating Events
The Events Calendar event post type with date, location, and ticketing information
Partial update example 1
{
"postType": "event",
"id": 124,
"data": {
"title": "Conference Next Week",
"start_date": "next monday 9am",
"end_date": "next friday 5pm"
}
}Partial update example 2
{
"postType": "event",
"id": 127,
"data": {
"title": "Holiday Party",
"start_date": "December 15, 2024 7:00 PM",
"end_date": "December 15, 2024 11:30 PM"
}
}Updating Venues
Location where events take place, including address and contact information
Partial update example 1
{
"postType": "venue",
"id": 457,
"data": {
"address": "456 Park Avenue",
"city": "New York",
"phone": "+1 (212) 555-0123"
}
}Partial update example 2
{
"postType": "venue",
"id": 461,
"data": {
"address": "1000 Coastal Highway",
"city": "Miami Beach",
"phone": "305-555-BEACH"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| postType | Yes | The type of post to create or update | |
| id | No | Post ID (required for updates, omit for creation) | |
| data | Yes | The post data. Required fields depend on postType: Event (title, start_date, end_date), Venue (title or venue, address, city, country), Organizer (title or organizer), Ticket (title, event_id or event). Note: For Venue and Organizer, you can use "title" which will be converted to the appropriate field. For Tickets, all date fields must be in Y-m-d H:i:s format (e.g., "2024-12-25 15:30:00"). Sales dates default to 1 week before event (start) and event start date (end) if not specified. By default, ticket end_date will be capped to the event start date unless allow_end_after_event: true is provided. |