Create API Document

​

Create an API document.

OAuth scopes
  • platform:write

Path Parameters

Body

required
application/json

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/apis/{namespace}
import Scalar from '@scalar/sdk';

const client = new Scalar({
  bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var
});

const registry = await client.registry.createAPIDocument('acme', {
  title: 'Acme API',
  version: '1.2.0',
  slug: 'acme-api',
  document: '{"openapi":"3.1.0","info":{"title":"Acme API","version":"1.2.0"},"paths":{}}',
});

console.log(registry);
{
  "uid": "UakgbKJ5m9gl0JDMbcJqL",
  "versionUid": "VakgbKJ5m9gl0JDMbcJqL",
  "title": "Acme API",
  "jsonSha": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
  "yamlSha": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
}