API Reference
Overview

Public API v1

Automate your Odoo deployments, integrate oec.sh into your CI/CD pipelines, and build infrastructure-as-code workflows with the oec.sh Public API.

Requires Starter plan or higher. API access is available on Starter (19/mo),Pro(19/mo), Pro (39/mo), and Agency ($199/mo) plans.


What You Can Automate

The Public API gives you programmatic access to the core oec.sh platform:

ResourceWhat you can do
ProjectsList projects, get details, check status
EnvironmentsList, get, start, stop, restart environments
Deploy ActionsTrigger deployments, redeploys, module updates
WebhooksCreate and manage outgoing webhook subscriptions
API KeysList and revoke API keys

Common Use Cases

  • CI/CD pipelines — Trigger a deployment after your Git branch is merged
  • Infrastructure as code — Manage environments from Terraform or Ansible
  • Status dashboards — Poll environment health for custom monitoring
  • Slack bots — Deploy on slash command, post status updates to channels
  • Staging automation — Auto-deploy to staging on every push, deploy to production on tag

Base URL

https://api.oec.sh/api/public/v1

All API endpoints are relative to this base URL.


Interactive Documentation

Explore and test every endpoint directly in your browser:

ToolURL
Swagger UIapi.oec.sh/api/public/v1/docs (opens in a new tab)
ReDocapi.oec.sh/api/public/v1/redoc (opens in a new tab)

Both are generated live from the OpenAPI schema — they always reflect the current API.


Quick Start

Create an API Key

  1. Log in to the oec.sh platform
  2. Go to Settings → API Keys
  3. Click Create Key
  4. Choose a key type:
    • Read-only — for monitoring, dashboards, read-only integrations
    • Full access — for deployments, automation, CI/CD pipelines
  5. Choose the scope:
    • Organization — access all projects in your org
    • Project — scoped to a single project
  6. Copy the key immediately — it is shown only once
⚠️

Store your API key in a secrets manager (GitHub Secrets, HashiCorp Vault, AWS Secrets Manager, etc.). It cannot be retrieved after creation — only revoked and recreated.

Make Your First Request

List all projects in your organization:

curl https://api.oec.sh/api/public/v1/projects \
  -H "Authorization: Bearer oec_live_rw_your_key_here"

A successful response looks like:

{
  "items": [
    {
      "id": "proj_01abc...",
      "name": "Client ERP",
      "slug": "client-erp",
      "environment_count": 3,
      "created_at": "2025-09-15T10:30:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "page_size": 20
}

Explore Endpoints

From here you can:

  • GET /projects/{id}/environments — list environments for a project
  • POST /environments/{id}/actions/redeploy — trigger a redeployment
  • GET /environments/{id} — check environment status

See the sidebar for full documentation on each resource.


Versioning

The current version is v1. The base path includes the version: /api/public/v1.

When breaking changes are introduced, a new version (v2) will be added and v1 will continue working with a deprecation notice. Non-breaking additions (new fields, new endpoints) are added to the current version without a version bump.


Response Format

All responses are JSON. Successful responses return the resource directly or a paginated list:

{
  "items": [...],
  "total": 42,
  "page": 1,
  "page_size": 20
}

Errors use a consistent format documented in Errors & Status Codes.