Overview

Create API Document

POST/v1/apis/{namespace}
Features

Create an API document.

Input8
Authorizationheaderrequired
Your API key, sent as Authorization: Bearer YOUR_SCALAR_ACCESS_TOKEN.Sent from your browser straight to the API — never to Docsbook, never stored.
namespacestring · pathrequired
titlestring · bodyrequired
descriptionstring · body
versionstring · bodyrequired
slugstring · bodyrequired
rulesetstring · body
isPrivateboolean · body
documentstring · bodyrequired
Output6
uidstring
versionUidstring
titlestring
jsonShastring
yamlShastring
versionShastring
Responses
200Default Response
400Bad request
401No auth
403Forbidden
404Not found
422Invalid payload
500Uncaught error
Example input
curl -X POST 'https://access.scalar.com/v1/apis/{namespace}' \
  -H 'Authorization: Bearer YOUR_SCALAR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "<title>",
    "version": "<version>",
    "slug": "<slug>",
    "document": "<document>"
  }'
Example output
{
  "uid": "<uid>",
  "versionUid": "<versionUid>",
  "title": "<title>",
  "jsonSha": "<jsonSha>",
  "yamlSha": "<yamlSha>",
  "versionSha": "<versionSha>"
}

Updated

Was this page helpful?