SMAO API Documentation
Public APICalendars

Create a calendar

Creates a new calendar. You can optionally seed one or more schedules (opening hours, service hours, etc.) along with their weekly template and date-specific overrides in a single request. Calendar names must be unique within your organization.

POST
/calendars
AuthorizationBearer <token>

API key in the Authorization: Bearer <key> header. Keys are created in the SMAO dashboard (Settings → API Keys).

In: header

namestring

Whitespace is trimmed; the trimmed name must be at least 1 character.

Length1 <= length <= 100
timezone?string

IANA timezone string. Validated server-side.

Default"Europe/Berlin"
Length1 <= length <= 100
schedules?
Default[]

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.smao.ai/api/v1/calendars" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "data": {
    "id": "65f8fa6f1a9d8e0012ab34cd",
    "name": "Main Office",
    "timezone": "Europe/Berlin",
    "schedules": [
      {
        "id": "65f8fa6f1a9d8e0012ab34cd",
        "type": "opening_hours",
        "weekly_schedule": {
          "mon": {
            "is_open": true,
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          },
          "tue": {
            "is_open": true,
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          },
          "wed": {
            "is_open": true,
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          },
          "thu": {
            "is_open": true,
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          },
          "fri": {
            "is_open": true,
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          },
          "sat": {
            "is_open": true,
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          },
          "sun": {
            "is_open": true,
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          }
        },
        "overrides": [
          {
            "date": "2026-12-24",
            "type": "closed",
            "reason": "Christmas Eve",
            "slots": [
              {
                "from": "09:00",
                "to": "17:00"
              }
            ]
          }
        ]
      }
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "validation_failed",
    "message": "Validation failed"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing API key"
  }
}
{
  "error": {
    "code": "subscription_required",
    "message": "This feature is not available in your current subscription. Please upgrade to a higher plan"
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "No permission"
  }
}
{
  "error": {
    "code": "conflict",
    "message": "A calendar with this name already exists"
  }
}
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded"
  }
}
{
  "error": {
    "code": "internal_error",
    "message": "An unexpected error occurred."
  }
}