Create a rule

Create a rule in a namespace.

Path Parameters
  • namespace
    Type: string
    required
Body
required
application/json
  • document
    Type: string
    required
  • slug
    Type: string
    required
  • title
    Type: string
    required
  • description
    Type: string
  • isPrivate
    Type: boolean
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 scalar = new Scalar({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await scalar.rules.createRuleset({
    namespace: "<value>",
    requestBody: {
      title: "<value>",
      slug: "<value>",
      document: "<value>",
    },
  });

  console.log(result);
}

run();
{
  "uid": "string"
}