Rules
Delete
Permanently delete a rule from your Nairi organization. Fails if the rule is still attached to any agent — unassign the rule from all agents first.
DELETE /api/public/v1/artifacts/rules/{rule_id}Example
curl -X DELETE https://api.nairi.ai/api/public/v1/artifacts/rules/RULE_ID \
-H "Authorization: Bearer $NAIRI_API_KEY"await fetch(`https://api.nairi.ai/api/public/v1/artifacts/rules/${ruleId}`, {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
},
});require "net/http"
require "uri"
uri = URI("https://api.nairi.ai/api/public/v1/artifacts/rules/#{rule_id}")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }import os
import requests
requests.delete(
f"https://api.nairi.ai/api/public/v1/artifacts/rules/{rule_id}",
headers={"Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}"},
)package main
import (
"net/http"
"os"
)
func main() {
ruleID := os.Getenv("RULE_ID")
req, _ := http.NewRequest("DELETE", "https://api.nairi.ai/api/public/v1/artifacts/rules/"+ruleID, nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("NAIRI_API_KEY"))
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
}Deletion fails with 400 Bad Request if the rule is assigned to any agent. Unassign it from every agent first (see Agent resources).
Response: 204 No Content
Error responses
| HTTP | Body | When |
|---|---|---|
400 | {"error":"cannot delete rule: still assigned to N agent(s)"} | The rule is still attached to one or more agents. |
404 | {"error":"rule not found"} | No rule with that ID exists in the calling organization. |
Update
Full replace of a Nairi rule by its ID — every field is required. Use the partial update endpoints instead if you only need to change one or two fields.
Overview
What MCP configs are and how they give agents access to external tools. Manage Model Context Protocol server definitions through the Nairi REST API.