# POST /scheduled-event-types

**Resource:** [Scheduled Event Types](./scheduled-event-types.md)  
**Scopes:** `company:write`  
**Write operation:** yes

Create a new scheduled event type template. name is required.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `name` | body | string | yes | Event type name. E.g. "Site Visit", "Follow-Up Call", "Demo" |
| `description` | body | string | no | Description shown in the dropdown |
| `icon` | body | string | no | Lucide icon name: calendar, video, phone, users, map-pin, coffee, briefcase, file-text, clock, calendar-clock |
| `color` | body | string | no | Color theme: primary, emerald, blue, amber, red, purple, pink, indigo |
| `is_meeting` | body | boolean | no | If true, uses Google Meet form (duration, invitees). If false, uses Standard Event form. |
| `default_duration_minutes` | body | number | no | Default meeting duration in minutes (only applies when is_meeting is true) |
| `event_queue_id` | body | uuid | no | Event queue UUID for auto-enrollment when this type is added to an opportunity |
| `enrollment_offset_minutes` | body | number | no | How far before the event to start the queue (0 = at event time, 1440 = 1 day before) |
| `sort_order` | body | number | no | Display order in the dropdown |
| `is_active` | body | boolean | no | Whether this type appears in the dropdown (default true) |
| `is_bookable` | body | boolean | no | If true, external bookers can book this type publicly |
| `slug` | body | string | no | URL-friendly slug for public booking page (auto-generated from name if omitted) |
| `buffer_before_minutes` | body | number | no | Buffer time before booking (minutes) |
| `buffer_after_minutes` | body | number | no | Buffer time after booking (minutes) |
| `min_notice_hours` | body | number | no | Minimum notice required (hours) |
| `max_advance_days` | body | number | no | Max days in advance to book |
| `slot_interval_minutes` | body | number | no | Time slot interval (minutes) |
| `booking_pipeline_id` | body | uuid | no | Pipeline for auto-created opportunities |
| `booking_stage_id` | body | uuid | no | Stage for auto-created opportunities |
| `booking_auto_create_deal` | body | boolean | no | Whether to auto-create a CRM opportunity when booked (default true). Param name preserved for backward compatibility. |
| `booking_lead_source` | body | string | no | Lead source for auto-created opportunities (default "booking") |
| `booking_deal_name_template` | body | string | no | Opportunity name template (param name preserved for backward compatibility). Variables: {event_type}, {customer_name}, {date}, {time} |
| `booking_assigned_user_ids` | body | array | no | Team member UUIDs to assign to opportunities and check calendar availability |
| `booking_default_tags` | body | array | no | Tags auto-applied to opportunities. Array of {name, color} objects. |
| `booking_default_products` | body | array | no | Products auto-attached to opportunities. Array of {id, quantity} objects. |
| `booking_confirmation_message` | body | string | no | Custom confirmation message shown after booking |
| `booking_deal_behavior` | body | string | no | How bookings interact with CRM opportunities (param name preserved for backward compatibility): "create" (always new), "update_or_create" (match existing or create), "never_create" (match only). Default: "create". |
| `booking_notifications` | body | object | no | Booking notifications. Object with keys: pre_meeting, meeting_start, late, no_show, rebooking. Each key is an array of { offset_minutes? (pre_meeting/rebooking), channels: ["email"\|"sms"], recipients: "booker"\|"booker_and_attendees"\|"team"\|"all", email_subject, email_body, sms_body, label }. Template vars: {booker_name}, {event_type}, {date}, {time}, {meet_link}, {duration}, {rebook_link} |

## Request example

```bash
curl -X POST \
  "https://api.trustpager.com/functions/v1/api/v1/scheduled-event-types" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Site Visit",
    "icon": "map-pin",
    "color": "emerald",
    "is_bookable": true,
    "default_duration_minutes": 30,
    "booking_deal_behavior": "update_or_create",
    "booking_notifications": {
      "pre_meeting": [
        { "offset_minutes": 1440, "channels": ["email"], "recipients": "booker", "email_subject": "See you tomorrow!", "email_body": "Hi {booker_name}, your meeting is tomorrow at {time}.", "label": "24hr reminder" }
      ]
    }
  }'
```

## Response example

```json
{
  "data": {
    "id": "a1b2c3d4-...",
    "name": "Site Visit",
    "icon": "map-pin",
    "color": "emerald",
    "is_bookable": true,
    "slug": "site-visit",
    "default_duration_minutes": 30,
    "booking_deal_behavior": "update_or_create",
    "booking_notifications": {
      "pre_meeting": [{ "offset_minutes": 1440, "channels": ["email"], "recipients": "booker", "email_subject": "See you tomorrow!", "email_body": "Hi {booker_name}, your meeting is tomorrow at {time}.", "label": "24hr reminder" }]
    },
    "is_active": true,
    "created_at": "2026-03-23T10:00:00Z",
    "updated_at": "2026-03-23T10:00:00Z"
  },
  "meta": { "credits_remaining": 9499 }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`