Complete reference of every operation, grouped by resource. See the README for usage and configuration.
RegistrySchemasLoginPortalsRulesThemesTeamsScalarDocsNamespacesAuthentication
import Scalar from "@scalar/sdk";
const client = new Scalar({
bearerAuth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var
});List all API documents across every namespace the caller can access.
| Direction | Type |
|---|---|
| Response | RegistryListAllAPIDocumentsResponse |
const listAllAPIDocuments = await client.registry.listAllAPIDocuments();List API documents in a namespace.
| Direction | Type |
|---|---|
| Response | RegistryListAPIDocumentsResponse |
const listAPIDocuments = await client.registry.listAPIDocuments("namespace");Create an API document.
| Direction | Type |
|---|---|
| Request | RegistryCreateAPIDocumentParams |
| Response | RegistryCreateAPIDocumentResponse |
const createAPIDocument = await client.registry.createAPIDocument("namespace", {
title: "",
version: "x",
slug: "",
document: "",
});Update metadata for an API document.
| Direction | Type |
|---|---|
| Request | RegistryUpdateAPIDocumentParams |
| Response | RegistryUpdateAPIDocumentResponse |
await client.registry.updateAPIDocument("slug", {
namespace: "namespace",
});Delete an API document and all versions.
| Direction | Type |
|---|---|
| Request | RegistryDeleteAPIDocumentParams |
| Response | RegistryDeleteAPIDocumentResponse |
await client.registry.deleteAPIDocument("slug", {
namespace: "namespace",
});Get a specific API document version.
| Direction | Type |
|---|---|
| Request | RegistryRetrieveAPIDocumentVersionParams |
| Response | RegistryRetrieveAPIDocumentVersionResponse |
const string_ = await client.registry.retrieveAPIDocumentVersion("semver", {
namespace: "namespace",
slug: "slug",
});Update the registry file content for an API document version.
| Direction | Type |
|---|---|
| Request | RegistryUpdateAPIDocumentVersionParams |
| Response | RegistryUpdateAPIDocumentVersionResponse |
const updateAPIDocumentVersion = await client.registry.updateAPIDocumentVersion("semver", {
namespace: "namespace",
slug: "slug",
document: "",
});Delete a specific API document version.
| Direction | Type |
|---|---|
| Request | RegistryDeleteAPIDocumentVersionParams |
| Response | RegistryDeleteAPIDocumentVersionResponse |
await client.registry.deleteAPIDocumentVersion("semver", {
namespace: "namespace",
slug: "slug",
});Get metadata (uid, content shas, version sha, tags) for a specific API document version.
| Direction | Type |
|---|---|
| Request | RegistryListAPIDocumentVersionMetadataParams |
| Response | RegistryListAPIDocumentVersionMetadataResponse |
const listAPIDocumentVersionMetadata = await client.registry.listAPIDocumentVersionMetadata("semver", {
namespace: "namespace",
slug: "slug",
});Create a new API document version.
| Direction | Type |
|---|---|
| Request | RegistryCreateAPIDocumentVersionParams |
| Response | RegistryCreateAPIDocumentVersionResponse |
const createAPIDocumentVersion = await client.registry.createAPIDocumentVersion("slug", {
namespace: "namespace",
version: "x",
document: "",
});Add an access group to an API document.
| Direction | Type |
|---|---|
| Request | RegistryCreateAPIDocumentAccessGroupParams |
| Response | RegistryCreateAPIDocumentAccessGroupResponse |
await client.registry.createAPIDocumentAccessGroup("slug", {
namespace: "namespace",
accessGroupSlug: "xxx",
});Remove an access group from an API document.
| Direction | Type |
|---|---|
| Request | RegistryDeleteAPIDocumentAccessGroupParams |
| Response | RegistryDeleteAPIDocumentAccessGroupResponse |
await client.registry.deleteAPIDocumentAccessGroup("slug", {
namespace: "namespace",
accessGroupSlug: "xxx",
});List schemas in a namespace.
| Direction | Type |
|---|---|
| Response | SchemaListResponse |
const list = await client.schemas.list("namespace");Create a schema in a namespace.
| Direction | Type |
|---|---|
| Request | SchemaCreateParams |
| Response | SchemaCreateResponse |
const create = await client.schemas.create("namespace", {
title: "",
version: "x",
slug: "",
document: "",
});Update schema metadata.
| Direction | Type |
|---|---|
| Request | SchemaUpdateParams |
| Response | SchemaUpdateResponse |
await client.schemas.update("slug", {
namespace: "namespace",
});Delete a schema and all related versions.
| Direction | Type |
|---|---|
| Request | SchemaDeleteParams |
| Response | SchemaDeleteResponse |
await client.schemas.delete("slug", {
namespace: "namespace",
});Get a specific schema version document.
| Direction | Type |
|---|---|
| Request | VersionRetrieveSchemaParams |
| Response | VersionRetrieveSchemaResponse |
const string_ = await client.schemas.version.retrieveSchema("semver", {
namespace: "namespace",
slug: "slug",
});Delete a schema version.
| Direction | Type |
|---|---|
| Request | VersionDeleteSchemaParams |
| Response | VersionDeleteSchemaResponse |
await client.schemas.version.deleteSchema("semver", {
namespace: "namespace",
slug: "slug",
});Create a schema version.
| Direction | Type |
|---|---|
| Request | VersionCreateSchemaParams |
| Response | VersionCreateSchemaResponse |
const createSchema = await client.schemas.version.createSchema("slug", {
namespace: "namespace",
version: "x",
document: "",
});Add an access group to a schema.
| Direction | Type |
|---|---|
| Request | AccessGroupCreateSchemaParams |
| Response | AccessGroupCreateSchemaResponse |
await client.schemas.accessGroup.createSchema("slug", {
namespace: "namespace",
accessGroupSlug: "xxx",
});Remove an access group from a schema.
| Direction | Type |
|---|---|
| Request | AccessGroupDeleteSchemaParams |
| Response | AccessGroupDeleteSchemaResponse |
await client.schemas.accessGroup.deleteSchema("slug", {
namespace: "namespace",
accessGroupSlug: "xxx",
});Get a login portal by slug.
| Direction | Type |
|---|---|
| Response | LoginPortalRetrieveResponse |
const retrieve = await client.loginPortals.retrieve("slug");Update metadata for a login portal.
| Direction | Type |
|---|---|
| Request | LoginPortalUpdateParams |
| Response | LoginPortalUpdateResponse |
await client.loginPortals.update("slug", {});Delete a login portal.
| Direction | Type |
|---|---|
| Response | LoginPortalDeleteResponse |
await client.loginPortals.delete("slug");Create a login portal for the current team.
| Direction | Type |
|---|---|
| Request | LoginPortalCreateParams |
| Response | LoginPortalCreateResponse |
const create = await client.loginPortals.create({
title: "",
slug: "",
email: {
logo: "",
logoSize: "100",
buttonText: "Login",
message: "Click to access private documentation hosted by scalar.com",
title: "Private Docs",
mainColor: "#2a2f45",
mainBackground: "#f6f6f6",
cardColor: "2a2f45",
cardBackground: "#fff",
buttonColor: "#fff",
buttonBackground: "#0f0f0f",
},
page: {
title: "Scalar Private Docs",
description: "Login to access your documentation",
head: "",
script: "",
theme: "",
companyName: "",
logo: "",
logoURL: "",
favicon: "",
termsLink: "",
privacyLink: "",
formTitle: "Scalar Private Docs",
formDescription: "Login to access your documentation",
formImage: "",
},
});List all login portals for the current team.
| Direction | Type |
|---|---|
| Response | LoginPortalListResponse |
const list = await client.loginPortals.list();List all rulesets in a namespace.
| Direction | Type |
|---|---|
| Response | RuleListRulesetsResponse |
const listRulesets = await client.rules.listRulesets("namespace");Create a rule in a namespace.
| Direction | Type |
|---|---|
| Request | RuleCreateRulesetParams |
| Response | RuleCreateRulesetResponse |
const createRuleset = await client.rules.createRuleset("namespace", {
title: "",
slug: "",
document: "",
});Update rule metadata by slug.
| Direction | Type |
|---|---|
| Request | RuleUpdateRulesetParams |
| Response | RuleUpdateRulesetResponse |
await client.rules.updateRuleset("slug", {
namespace: "namespace",
});Delete a rule by slug.
| Direction | Type |
|---|---|
| Request | RuleDeleteRulesetParams |
| Response | RuleDeleteRulesetResponse |
await client.rules.deleteRuleset("slug", {
namespace: "namespace",
});Get a rule document by slug.
| Direction | Type |
|---|---|
| Request | RuleRetrieveRulesetDocumentParams |
| Response | RuleRetrieveRulesetDocumentResponse |
const string_ = await client.rules.retrieveRulesetDocument("slug", {
namespace: "namespace",
});Grant an access group to a rule.
| Direction | Type |
|---|---|
| Request | RuleCreateRulesetAccessGroupParams |
| Response | RuleCreateRulesetAccessGroupResponse |
await client.rules.createRulesetAccessGroup("slug", {
namespace: "namespace",
accessGroupSlug: "xxx",
});Remove an access group from a rule.
| Direction | Type |
|---|---|
| Request | RuleDeleteRulesetAccessGroupParams |
| Response | RuleDeleteRulesetAccessGroupResponse |
await client.rules.deleteRulesetAccessGroup("slug", {
namespace: "namespace",
accessGroupSlug: "xxx",
});List all team themes.
| Direction | Type |
|---|---|
| Response | ThemeListResponse |
const list = await client.themes.list();Create a team theme.
| Direction | Type |
|---|---|
| Request | ThemeCreateParams |
| Response | ThemeCreateResponse |
const create = await client.themes.create({
name: "",
slug: "",
document: "",
});Update theme metadata.
| Direction | Type |
|---|---|
| Request | ThemeUpdateParams |
| Response | ThemeUpdateResponse |
await client.themes.update("slug", {});Replace the theme document.
| Direction | Type |
|---|---|
| Request | ThemeReplaceDocumentParams |
| Response | ThemeReplaceDocumentResponse |
await client.themes.replaceDocument("slug", {
document: "",
});Delete a theme by slug.
| Direction | Type |
|---|---|
| Response | ThemeDeleteResponse |
await client.themes.delete("slug");Get the theme document by slug.
| Direction | Type |
|---|---|
| Response | ThemeRetrieveResponse |
const string_ = await client.themes.retrieve("slug");List all available teams
| Direction | Type |
|---|---|
| Response | TeamListResponse |
const list = await client.teams.list();List all guide projects.
| Direction | Type |
|---|---|
| Response | ScalarDocListGuidesResponse |
const listGuides = await client.scalarDocs.listGuides();Create a guide project.
| Direction | Type |
|---|---|
| Request | ScalarDocCreateGuideParams |
| Response | ScalarDocCreateGuideResponse |
const createGuide = await client.scalarDocs.createGuide({
name: "",
isPrivate: false,
allowedUsers: [],
allowedDomains: [],
});Start a new publish process.
| Direction | Type |
|---|---|
| Response | ScalarDocPublishGuideResponse |
const publishGuide = await client.scalarDocs.publishGuide("slug");Get all namespaces for the current team
| Direction | Type |
|---|---|
| Response | NamespaceListResponse |
const list = await client.namespaces.list();Exchange an API key for an access token.
| Direction | Type |
|---|---|
| Request | AuthenticationExchangePersonalTokenParams |
| Response | AuthenticationExchangePersonalTokenResponse |
const exchangePersonalToken = await client.authentication.exchangePersonalToken({
personalToken: "",
});Get the authenticated user, including their available teams and theme.
| Direction | Type |
|---|---|
| Response | AuthenticationListCurrentUserResponse |
const listCurrentUser = await client.authentication.listCurrentUser();