Create API Document
Create an API document.
Path Parameters
- Type: stringnamespacerequired
Body
required
application/json
- Type: stringdocumentrequired
- Type: stringslugrequired
- Type: stringtitlerequired
- versionrequired
- Type: stringdescription
- Type: booleanis
Private - Type: stringruleset
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"
}