Spec0docsCLI 0.7.0
API Explorer

Publish or update a public API

First call (no publicApiId) creates a new public API. Subsequent calls with the same publicApiId update the existing one. Each call records an immutable version snapshot keyed on version.

POST
/api/v1/public/apis

Authorization

BearerAuth
AuthorizationBearer <token>

Bearer token. Either a Personal Access Token (pat_...) or a Service Account Token (sat_...). Issued via the Spec0 dashboard or /me/personal-access-tokens.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://app.spec0.io/api/v1/public/apis" \  -H "Content-Type: application/json" \  -d '{    "openapiSpec": "string"  }'
{
  "publicApiId": "6cdb160e-37b9-4802-86c1-ee5fed60dba5",
  "apiSlug": "string",
  "orgSlug": "string",
  "version": "string",
  "visibility": "string",
  "created": true,
  "versionCreated": true,
  "publicUrl": "string",
  "lintScore": 0
}
{
  "status": 0,
  "title": "string",
  "detail": "string",
  "type": "string",
  "instance": "string"
}
{
  "error": "string",
  "message": "string"
}
{
  "status": 0,
  "title": "string",
  "detail": "string",
  "type": "string",
  "instance": "string"
}
{
  "status": 0,
  "title": "string",
  "detail": "string",
  "type": "string",
  "instance": "string"
}
{
  "status": 0,
  "title": "string",
  "detail": "string",
  "type": "string",
  "instance": "string"
}
Was this helpful?