Canonical · Schema

PromptingRuleActionAdd

The schema the API uses for the 'add' action of /v2/interfaces/rules.

CanonicalCloudLinuxOpen SourceUbuntuContainersBare MetalCharmsIdentity

Properties

Name Type Description
action string The action to perform on the rules endpoint.
rule object
View JSON Schema on GitHub

JSON Schema

canonical-prompting-rule-action-add-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/canonical/main/json-schema/canonical-prompting-rule-action-add-schema.json",
  "title": "PromptingRuleActionAdd",
  "description": "The schema the API uses for the 'add' action of /v2/interfaces/rules.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canonical-experimental-api-openapi.yml#/components/schemas/PromptingRuleActionAdd",
  "type": "object",
  "required": [
    "action",
    "rule"
  ],
  "properties": {
    "action": {
      "type": "string",
      "description": "The action to perform on the rules endpoint.",
      "enum": [
        "add"
      ]
    },
    "rule": {
      "type": "object",
      "properties": {
        "snap": {
          "type": "string",
          "description": "The snap for which to add the rule."
        },
        "interface": {
          "type": "string",
          "description": "The interface for which to add the rule."
        },
        "constraints": {
          "oneOf": [
            {
              "$ref": "#/$defs/PromptingConstraintsCamera"
            },
            {
              "$ref": "#/$defs/PromptingConstraintsHome"
            }
          ]
        }
      }
    }
  },
  "$defs": {
    "PromptingConstraintsCamera": {
      "type": "object",
      "description": "Details about the applicability of the new rule to requests.",
      "required": [
        "permissions"
      ],
      "properties": {
        "permissions": {
          "type": "object",
          "description": "A map from permission name to the information about that permission.",
          "additionalProperties": {
            "$ref": "#/$defs/PromptingPermissionEntry"
          }
        }
      }
    },
    "PromptingConstraintsHome": {
      "type": "object",
      "description": "Details about the applicability of the new rule to requests.",
      "required": [
        "path-pattern",
        "permissions"
      ],
      "properties": {
        "path-pattern": {
          "type": "string",
          "description": "Path glob matching filepaths for which the rule applies."
        },
        "permissions": {
          "type": "object",
          "description": "A map from permission name to the information about that permission.",
          "additionalProperties": {
            "$ref": "#/$defs/PromptingPermissionEntry"
          }
        }
      }
    },
    "PromptingPermissionEntry": {
      "type": "object",
      "required": [
        "outcome",
        "lifespan"
      ],
      "properties": {
        "outcome": {
          "type": "string",
          "enum": [
            "allow",
            "deny"
          ]
        },
        "lifespan": {
          "type": "string",
          "description": "The lifespan for which the permission applies.\n\ntimespan: the permission applies for the given duration specified by the\nduration field or until it is deleted\n\nsession: the permission applies until the user logs out (specifically,\nuntil the systemd user session ends)\n\nforever: the permission applies until it is deleted",
          "enum": [
            "timespan",
            "session",
            "forever"
          ]
        },
        "duration": {
          "type": "string",
          "description": "The duration for which the permission is valid. Required if lifespan is\ntimespan, otherwise must be omitted.",
          "format": "Go duration"
        }
      }
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/canonical-prompting-rule-action-add"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.