Skip to main content

Using the API with AI assistants

A guide to using the API with an AI assistant of your choice

Written by Team Skedda

AI assistants such as Claude and ChatGPT can read the Skedda or AllBooked API (Beta) specification and write a working script for you, so you can automate tasks like exporting bookings without writing code from scratch. The assistant writes the script; you run it on your own computer.

The API (Beta) currently provides read-only access to booking data, with more capabilities to come.


Before you start

This guide is for people comfortable running a script from a terminal. You'll need:

  • API access, available on Skedda Premier and AllBooked Advanced plans, and an API key created under Integrations -> Developer (see Authentication).

  • An AI assistant, such as Claude, ChatGPT or a coding assistant like Claude Code or Codex.

How to do it

Step 1: Give the assistant the API specification

The specification describes every endpoint and parameter in the Skedda API:

https://api.skedda.com/api/v1/openapi/v1.json

Paste the URL into the chat, or download the file and attach it. Attaching is more reliable, as some assistants can't open URLs.

Step 2: Describe what you want

Tell the assistant what the script should do, for example "export last month's bookings to a CSV". The prompt below gives it the rules it needs to get the script right first time. Replace the last line with your task.

Attached is the OpenAPI specification for the Skedda API. 
Write a Python script that uses it.

- Read the API key from the SKEDDA_API_KEY environment variable.
- Date filters need a UTC offset, and one request can't span more than 31 days.
- Follow cursor pagination until paging.isLast is true.
- Only use parameters in the spec; unknown ones return 400.
- On a 429, wait for Retry-After before retrying.
- Tell me exactly how to install anything the script needs and how to run it.

Task: <describe what you want>

Step 3: Let your assistant do the work or run the script yourself

If you are using your AI assistant via it's desktop app or via the terminal, the work will be done for you.

If not, you will have to run the script yourself. If you've never run a script before, ask your IT team or a technical colleague to help with the first run. Open a terminal in the folder where you saved the script file. Set your API key for this session, then run the script.

macOS or Linux

export SKEDDA_API_KEY="your-api-key"
python3 export_bookings.py

Windows (PowerShell)

$env:SKEDDA_API_KEY="your-api-key"
python export_bookings.py

If the script fails, copy the error message (not your API key) back to the assistant and ask it to fix the script.

Keep your data safe

  • Never paste your API key into a chat. Set it in your terminal as shown in Step 4. If you paste it by accident, revoke it under Integrations -> Developer and create a new one.

  • Check before sharing API responses. Responses can include personal details and admin-only custom fields, so check your organisation's policies before pasting them into an AI tool.

  • Review the script before running it. Make sure it only fetches the data you asked for and saves it where you expect.

Troubleshooting

Error

What it means

What to do

401 Unauthorized

The API key is missing, wrong or revoked

Check SKEDDA_API_KEY is set in the same terminal window you're running the script from

400 Bad Request

The script used a parameter that isn't in the spec, or a date without a UTC offset

Paste the error into the assistant and ask it to fix the request

429 Too Many Requests

You've hit the rate limit

Make sure the script waits for the Retry-After time before retrying

Only some results returned

The script stopped after the first page

Ask the assistant to follow pagination until paging.isLast is true

python not found

Python isn't installed, or uses a different command

Install Python 3, or try python3 instead of python

Did this answer your question?