API Reference

Technical documentation for the TourKit API

API Reference

The TourKit API allows you to programmatically manage tours, campaigns, and access analytics.

Authentication

All API requests require authentication using a Bearer token:

curl https://api.tourkit.software/v1/tours \
  -H "Authorization: Bearer YOUR_API_KEY"

Getting an API Key

  1. Go to SettingsAPI Keys
  2. Click "Generate New Key"
  3. Copy and securely store the key

Base URL

https://api.tourkit.software/v1

Endpoints

Tours

List Tours

GET /tours

Query parameters:

  • limit (default: 20)
  • offset (default: 0)
  • status (draft, published)

Response:

{
  "tours": [...],
  "total": 42
}

Get Tour

GET /tours/{id}

Create Tour

POST /tours

Request body:

{
  "title": "Tour Name",
  "description": "Optional description"
}

Update Tour

PUT /tours/{id}

Delete Tour

DELETE /tours/{id}

Publish Tour

POST /tours/{id}/publish

Steps

List Steps

GET /tours/{id}/steps

Add Step

POST /tours/{id}/steps

Update Step

PUT /tours/{tourId}/steps/{stepId}

Delete Step

DELETE /tours/{tourId}/steps/{stepId}

Reorder Steps

PUT /tours/{id}/steps/reorder

Request body:

{
  "stepIds": ["step-1", "step-3", "step-2"]
}

Campaigns

List Campaigns

GET /campaigns

Get Campaign

GET /campaigns/{id}

Create Campaign

POST /campaigns

Update Campaign

PUT /campaigns/{id}

Delete Campaign

DELETE /campaigns/{id}

Analytics

Tour Analytics

GET /tours/{id}/analytics

Query parameters:

  • startDate (ISO 8601)
  • endDate (ISO 8601)
  • granularity (day, week, month)

Response:

{
  "views": 1234,
  "uniqueViewers": 890,
  "completionRate": 0.67,
  "timeline": [...]
}

Video

Generate Video

POST /tours/{id}/video/generate

Get Video Status

GET /tours/{id}/video/status

Download Video

GET /tours/{id}/video/file

Rate Limits

| Plan | Requests/minute | |------|-----------------| | Free | 60 | | Pro | 300 | | Business | 1000 |

Error Handling

Errors return appropriate HTTP status codes with details:

{
  "error": {
    "code": "TOUR_NOT_FOUND",
    "message": "Tour with ID xyz not found"
  }
}

Common Status Codes

| Code | Meaning | |------|---------| | 200 | Success | | 201 | Created | | 400 | Bad Request | | 401 | Unauthorized | | 403 | Forbidden | | 404 | Not Found | | 429 | Rate Limited | | 500 | Server Error |

Webhooks

Configure webhooks to receive real-time notifications:

Events

  • tour.created
  • tour.published
  • tour.deleted
  • video.ready
  • view.completed

Webhook Payload

{
  "event": "tour.published",
  "timestamp": "2024-01-15T12:00:00Z",
  "data": {
    "tourId": "abc-123",
    "title": "My Tour"
  }
}

SDKs

Official SDKs are available for:

  • JavaScript/TypeScript: npm install @tourkit/sdk
  • Python: pip install tourkit

Support

  • Email: api-support@tourkit.software
  • Status: status.tourkit.software