Create API Document

Create an API document.

Path Parameters
  • namespace
    Type: string
    required
Body
required
application/json
  • document
    Type: string
    required
  • slug
    Type: string
    required
  • title
    Type: string
    required
  • version
    required
  • description
    Type: string
  • isPrivate
    Type: boolean
  • ruleset
    Type: string
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 createAPIDocument = await client.registry.createAPIDocument("namespace", {
  title: "",
  version: "x",
  slug: "",
  document: "",
});
console.log(createAPIDocument);
{
  "uid": "string",
  "versionUid": "string",
  "title": "string",
  "jsonSha": "string",
  "yamlSha": "string",
  "versionSha": "string"
}