Skip to content

Specly API

Start a deploy from CI, or read a site's analytics, with an organization API key.

2 min read

Updated

The Specly API has two calls. You can start a deploy of a site, and read its analytics. Both use an organization API key, so CI and scripts can call them without a person’s login.

The server is https://app.specly.xyz.

Open Settings › Organization › API keys in the dashboard. Only an admin of the organization can make or see keys.

  1. Give the key a name, such as the pipeline that uses it.
  2. Choose what it may do. Each choice is a scope.
  3. Choose where it works: every site in the organization, or only the sites you pick.
  4. Select Create key, and copy the key. Specly shows it once.

A key belongs to the organization, not to a person, so it keeps working when people leave. Revoke it on the same page.

deployscopebody

Start a deploy: POST /api/sites/{id}/deploy.

analytics:readscopebody

Read analytics: GET /api/sites/{id}/analytics.

Send the key as a bearer token. Every key starts with spk_org_. {id} is the site’s ID, which is in its address in the dashboard.

Deploy
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
https://app.specly.xyz/api/sites/{id}/deploy

Answers are JSON. A deploy answers 202 with the build it started.

401status

The key is missing, malformed, unknown or revoked. The answer has a WWW-Authenticate: Bearer header.

403status

The key can’t be used on this site, or doesn’t have the scope the call needs.

429status

Too many requests. Wait a minute. A key may start 10 deploys and make 60 analytics calls a minute.

Each error has an error field that says what went wrong. The pages in this tab show every call’s fields and answers. There’s no Send button, because the API doesn’t accept calls from a browser page. Use curl.

Was this page helpful?

Report a problem

What’s the problem?

The docs team sees this. Other readers don’t.