Create API Document
Create an API document.
OAuth scopes
- platform:write
Path Parameters
- Type: stringnamespacerequired
Body
required
application/json
- Type: stringdocumentrequired
- Type: stringslugrequired
- Type: stringtitlerequired
- Type:versionmin length:1required
- 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}
curl https://access.scalar.com/v1/apis/acme \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"title": "Acme API",
"description": "API for managing Acme products and orders.",
"version": "1.2.0",
"slug": "acme-api",
"ruleset": "extends: [\"spectral:oas\"]",
"isPrivate": false,
"document": "{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Acme API\",\"version\":\"1.2.0\"},\"paths\":{}}"
}'
{
"uid": "UakgbKJ5m9gl0JDMbcJqL",
"versionUid": "VakgbKJ5m9gl0JDMbcJqL",
"title": "Acme API",
"jsonSha": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"yamlSha": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
}