API Reference

Calendar Events

Standalone events or events linked to a specific job

Calendar events represent anything time-based — appointments, internal reminders, blocked-out slots — and can optionally be linked to a job via ticketId. Standalone events and job-linked events live in the same collection, so a single list request can power a unified calendar view.

Endpoints

  • GET/organisations/{orgId}/calendar-events — List events (paginated)
  • POST/organisations/{orgId}/calendar-events — Create event
  • GET/organisations/{orgId}/calendar-events/{eventId} — Get event
  • PUT/organisations/{orgId}/calendar-events/{eventId} — Update event
  • DELETE/organisations/{orgId}/calendar-events/{eventId} — Delete event

List filters

Query paramDescription
limitPage size (max 100, default 50)
startAfterCursor — pass the previous response's nextCursor
fromFilter to events on or after this ISO date
toFilter to events on or before this ISO date
assignedToIdFilter to events assigned to a specific user
ticketIdFilter to events linked to a specific job

To fetch every event linked to a single job, pass ?ticketId={ticketId}. Standalone events (no ticketId set) are returned alongside job-linked events when no ticketId filter is applied.

GET
/organisations/{orgId}/calendar-events
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

Query Parameters

limit?integer

Maximum number of items to return (max 100)

Default50
Range1 <= value <= 100
startAfter?string

Cursor for pagination - ID of the last item from previous page

from?string

Filter events starting from this date (ISO 8601)

Formatdate-time
to?string

Filter events ending before this date (ISO 8601)

Formatdate-time
assignedToId?string

Filter by assigned user ID

ticketId?string

Filter by associated ticket ID

Response Body

application/json

application/json

application/json

curl -X GET "https://developer.servicebay.io/api/v1/organisations/string/calendar-events"
{
  "success": true,
  "data": {
    "events": [
      {
        "id": "string",
        "title": "string",
        "description": "string",
        "notes": "string",
        "from": "2019-08-24T14:15:22Z",
        "to": "2019-08-24T14:15:22Z",
        "allDay": true,
        "assignedTo": "string",
        "assignedToId": "string",
        "ticketId": "string",
        "ticketLocation": "string",
        "color": 0
      }
    ],
    "pagination": {
      "limit": 0,
      "hasMore": true,
      "nextCursor": "string"
    }
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
POST
/organisations/{orgId}/calendar-events
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://developer.servicebay.io/api/v1/organisations/string/calendar-events" \  -H "Content-Type: application/json" \  -d '{    "title": "Service Appointment",    "from": "2025-01-15T10:00:00Z",    "to": "2025-01-15T11:00:00Z",    "allDay": false,    "assignedToId": "user123",    "ticketId": "1"  }'
{
  "success": true,
  "data": {
    "id": "string",
    "title": "string",
    "description": "string",
    "notes": "string",
    "from": "2019-08-24T14:15:22Z",
    "to": "2019-08-24T14:15:22Z",
    "allDay": true,
    "assignedTo": "string",
    "assignedToId": "string",
    "ticketId": "string",
    "ticketLocation": "string",
    "color": 0
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
GET
/organisations/{orgId}/calendar-events/{eventId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

eventId*string

Calendar event ID

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://developer.servicebay.io/api/v1/organisations/string/calendar-events/string"
{
  "success": true,
  "data": {
    "id": "string",
    "title": "string",
    "description": "string",
    "notes": "string",
    "from": "2019-08-24T14:15:22Z",
    "to": "2019-08-24T14:15:22Z",
    "allDay": true,
    "assignedTo": "string",
    "assignedToId": "string",
    "ticketId": "string",
    "ticketLocation": "string",
    "color": 0
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
PUT
/organisations/{orgId}/calendar-events/{eventId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

eventId*string

Calendar event ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://developer.servicebay.io/api/v1/organisations/string/calendar-events/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "success": true,
  "data": {
    "id": "string",
    "title": "string",
    "description": "string",
    "notes": "string",
    "from": "2019-08-24T14:15:22Z",
    "to": "2019-08-24T14:15:22Z",
    "allDay": true,
    "assignedTo": "string",
    "assignedToId": "string",
    "ticketId": "string",
    "ticketLocation": "string",
    "color": 0
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
DELETE
/organisations/{orgId}/calendar-events/{eventId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

eventId*string

Calendar event ID

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://developer.servicebay.io/api/v1/organisations/string/calendar-events/string"
{
  "success": true,
  "data": {
    "message": "Operation completed successfully"
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}

Machine-readable version: OpenAPI 3.1 spec.

On this page