Create a rule

​

Create a rule in a namespace.

Path Parameters

Body

required
application/json

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/rulesets/{namespace}
import Scalar from '@scalar/sdk';

const client = new Scalar({
  bearerAuth: process.env['BEARER_AUTH'], // defaults to the BEARER_AUTH env var
});

const uid = await client.rules.createRuleset('acme', {
  title: 'Acme API Rules',
  slug: 'acme-rules',
  document: 'extends: ["spectral:oas"]\nrules:\n  info-contact: warn\n',
});

console.log(uid);
{
  "uid": "UakgbKJ5m9gl0JDMbcJqL"
}