SmoothDeploy Docs
API Reference

Authentication

Authenticate SmoothDeploy API requests using the x-api-key, x-project-id, and x-branch-id headers. Learn how to create API keys in the console.

Every action is called at /v1/actions/<resource.verb>, for example /v1/actions/tests.list. GET actions take query parameters; all other actions take a JSON body with Content-Type: application/json. All API requests are authenticated with a key you create in the SmoothDeploy console. Keys are organization-scoped — one key can access any resource in your organization that its scopes allow.

To create a key, go to Operations → API Keys in the console. See API Keys for step-by-step instructions.

Request Headers

HeaderRequiredNotes
x-api-keyalwaysYour API key
x-project-idfor project-scoped actions: tests.*, test-revisions.*, steps.*, shared-steps.*, test-runs.*, schedules.*, branches.*UUID of the project to operate on. Not used by projects.*, email-inboxes.* and email-messages.*
x-branch-idnoUUID of a branch within that project. Defaults to the project's default branch when omitted

Example

curl "https://api.smoothdeploy.com/v1/actions/tests.list" \
  -H "x-api-key: sd_xxx..." \
  -H "x-project-id: 3f8a1b2c-1111-2222-3333-444455556666"

x-project-id is required whenever you call a tests, test-revisions, steps, shared-steps, test-runs, schedules, or branches action. Omitting it on those actions returns 400 { "error": "x-project-id header required" }. Supplying an ID that does not belong to your organization returns 404 { "error": "Project not found" }.

x-branch-id targets a specific branch within the project. When omitted, the request runs against the project's default branch. Supplying an ID that does not belong to the specified project returns 404 { "error": "Branch not found" }. If the project has no default branch and the header is omitted, these actions return 400 { "error": "x-branch-id header required (project has no default branch)" }.

Actions that take a branch parameter (tests.get, tests.list, tests.bulk-update-status) accept the branch there as an alternative to the header. If both are sent and differ, the request returns 400 with errorCode: "branch_conflict". An unknown branch returns 404 with errorCode: "branch_not_found" on reads and writes alike, never a silent fallback to the default branch. A missing scope returns 403 before any branch error.

Key Format

Keys start with sd_ followed by 48 hex characters:

sd_xxx...  (total length: 51 characters)

When you create a key, the full value is shown exactly once. Copy it to a secure secrets store immediately — it cannot be retrieved again after you close the dialog. The console only shows the first 8 characters (sd_XXXXX) as an identifier after creation.

Project-Restricted Keys

A key can be locked to a single project when it is created. If the key has a project restriction and the x-project-id header is present but refers to a different project, the request returns:

403 { "error": "API key is restricted to another project" }

When the key is restricted, the project ID in the header is optional — the key's own project is used automatically.

Key Expiry

Keys can be created with an expiry date. Once the expiry passes, every request returns 401 { "error": "Invalid API key" }. The console shows the expiry date on the Operations → API Keys page. There is no automatic rotation; create a new key and delete the old one before expiry.

IP Allowlist

A key can carry a list of allowed IPv4/IPv6 addresses or CIDR ranges (up to 50), set on the Operations → API Keys page or with api-keys.update-allowed-ips. A request from any other address returns 403. The client address is read from the last X-Forwarded-For entry.

Activity Tracking

The key's lastUsedAt timestamp is updated at most once per minute to avoid high write load on busy integrations. Very short-lived polling loops may see a lastUsedAt that lags up to 60 seconds behind real usage.

Revoked and Deleted Keys

Deleting a key marks it deleted and removes its value from the secret store; the row stays for the audit trail. A deleted key returns 401 Invalid API key on every request. The response body is:

{ "error": "Invalid API key" }

If a key returns 401 unexpectedly, check the Operations → API Keys page to confirm the key has not been deleted.

Error Body

All errors have the shape { "error": "message" }, optionally with errorCode and details.

Scope Errors

A valid key that lacks the scope required for an action returns 403 naming the missing scope, for example { "error": "API key lacks scope tests:update" }. Actions outside the public API return 403 { "error": "API keys cannot access this resource" }. Creating or changing a step that references a secret returns 403 because API keys never hold secrets:consume. Check which scopes the action requires in Scopes and recreate the key with the correct scopes.

Rate Limits

Each API key is limited to 300 requests per minute. A request over the limit returns 429 with a Retry-After header that gives the number of seconds to wait; the same value is in details.retryAfterSeconds of the body:

{ "error": "Too many requests", "details": { "retryAfterSeconds": 12 } }

The counter is kept in memory per server instance, so the effective limit can be higher behind several instances. Do not rely on that. When you poll a run for its status, keep the polling interval well inside this limit.

Security Guidance

  • Store keys in your CI/CD secret store (e.g. GitHub Actions Secrets, environment variables), never in source code.
  • Grant only the scopes an integration actually needs. A key that only reads test results should have testRuns:read only — not tests:delete or tests:run.
  • Rotate compromised keys immediately: delete the old key on the Operations → API Keys page and create a new one. Deletion takes effect instantly.
  • API keys are organization-scoped. A key created in one organization cannot access another.