Skip to main content

Use the REST API

The Skysize REST API lets your own scripts, CI pipelines and business tools operate the Odoo environments you already have: trigger a rebuild after a merge, follow a build until it finishes, read logs and metrics, take a backup before a risky change, or create a fresh SaaS database on demand.

The REST API is available on paid plans. See pricing for the plans that include it.

For the full list of endpoints, request bodies and responses, see the API reference.


Create an API token​

  1. Sign in to app.skysize.io and open Account > API Tokens.
  2. Give the token a name that tells you where it is used, for example ci-deploy.
  3. Under Use, choose REST API. A token serves one surface: create a separate one for an AI agent (MCP).
  4. Choose an Access level. Read only is preselected:
    • Read only: list and read everything the API exposes.
    • Read and write: also rebuild, restart, take backups, change environment variables and branch settings, create databases.
    • Full, including destructive actions: also delete, drop a deployment and restore a backup.
  5. Choose an expiry and click Create token.

The token is shown once. Copy it then; if you lose it, revoke it and create a new one.

caution

A token acts on your behalf, on every project you can access. Store it in your CI secret store, never in a repository, and give it the lowest access level the job needs.


Make a request​

Send the token in the X-API-Token header. The base URL is https://api.skysize.io/v1.

curl -H "X-API-Token: $SKYSIZE_TOKEN" https://api.skysize.io/v1/projects

Requests and responses are JSON. Errors come back as {"error": "<code>"} with a matching HTTP status:

StatusCodeMeaning
401unauthorizedMissing, expired or revoked token
402api_requires_paid_planThe project is on the free tier
403insufficient_token_accessThe token's access level is too low for this action
403endpoint_not_available_via_tokenThis action is available in the dashboard only
404project_not_found, branch_not_found, ...Not found, or you have no access to it
429rate_limitedMore than 120 requests in a minute; retry after the Retry-After delay

What the API covers​

The API operates environments that already exist:

  • Projects and branches: read them, update branch settings, restart, apply environment variables, update the Odoo image, drop a deployment.
  • Builds: list, read, rebuild a branch, cancel.
  • Logs and metrics: build and runtime logs (live or downloaded), log search, slow queries, CPU and memory history, uptime and health signals.
  • Backups: list, take a manual backup, restore a backup onto a branch.
  • Environment variables: list, create, update, delete. Sensitive values are never returned.
  • SaaS databases: list, create and delete the databases of a SaaS-mode branch.
  • Platform jobs (install, update, backup, restore logs): on Bring Your Own Server projects only.

These stay in the dashboard: creating or deleting projects and branches, members and groups, custom domains, git connections, backup and storage credentials, billing, and backup files (importing or downloading an archive).


Follow a live log​

Log and event streams use server-sent events. With curl, disable buffering with -N:

curl -N -H "X-API-Token: $SKYSIZE_TOKEN" \
https://api.skysize.io/v1/projects/$PROJECT_ID/branches/$BRANCH_ID/logs/stream

Each data: line is one log line as JSON. A : heartbeat comment arrives every 30 seconds so the connection stays open while nothing happens.


Example: rebuild after a merge​

A CI job with a Read and write token can rebuild the staging branch and wait for the result:

API=https://api.skysize.io/v1
H="X-API-Token: $SKYSIZE_TOKEN"

build=$(curl -s -X POST -H "$H" -H "Content-Type: application/json" \
-d "{\"branch_id\": \"$BRANCH_ID\"}" "$API/projects/$PROJECT_ID/builds")
echo "$build"

# Then poll the branch's builds until the newest one has finished.
curl -s -H "$H" "$API/projects/$PROJECT_ID/branches/$BRANCH_ID/builds"

A failed build carries a failure_reason code and the log that shows the problem in failure_log.


Example: one demo database per lead​

On a SaaS-mode branch, each database is its own Odoo instance on its own address. A CRM button can create a database for a prospect, fill it with relevant demo data, and delete it after the demo.

  1. Create the database (Read and write). The name becomes its address and must be unique, so add a short random suffix:

    curl -s -X POST -H "$H" -H "Content-Type: application/json" \
    -d '{"name": "acme-demo-x7k2", "lang": "fr_FR", "admin_password": "a-long-random-password"}' \
    "$API/projects/$PROJECT_ID/branches/$BRANCH_ID/databases"

    The response carries an id, the database's url (for example https://acme-demo-x7k2.skysize.io) and "pending": true.

  2. Poll GET .../databases/{id} with that id until pending is gone. On success you get the database record. If the creation failed, the answer has "failed": true and a failure_reason:

    • db_name_taken: someone claimed the name meanwhile. Pick another name.
    • create_failed: retry, and contact support if it keeps failing.
    • cancelled: the creation was cancelled.
  3. Fill it through Odoo's own external API (XML-RPC or JSON-RPC) at that url, signing in as admin with the password you chose: install the apps for the demo, then create the customers, products and orders that match the lead.

  4. After the demo, delete it (Full): DELETE .../databases/{database_id}. A final backup is taken before the database is dropped.

Each demo database runs in the branch's container and uses its workers and storage, so remove the ones you no longer need.