Rules

Update

Full replace of a rule (all fields required).

All fields are required. This is a full replace, not a patch.

PUT /api/public/v1/artifacts/rules/{rule_id}

Request body

Prop

Type

Example

curl -X PUT https://api.nairi.ai/api/public/v1/artifacts/rules/RULE_ID \
  -H "Authorization: Bearer $NAIRI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Code Style Rules",
    "description": "Updated guidelines",
    "content": "Updated content..."
  }'
const res = await fetch(`https://api.nairi.ai/api/public/v1/artifacts/rules/${ruleId}`, {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "Updated Code Style Rules",
    description: "Updated guidelines",
    content: "Updated content...",
  }),
});
const data = await res.json();
require "net/http"
require "json"
require "uri"

uri = URI("https://api.nairi.ai/api/public/v1/artifacts/rules/#{rule_id}")
req = Net::HTTP::Put.new(uri)
req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
req["Content-Type"] = "application/json"
req.body = {
  title: "Updated Code Style Rules",
  description: "Updated guidelines",
  content: "Updated content...",
}.to_json

res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)
import os
import requests

res = requests.put(
    f"https://api.nairi.ai/api/public/v1/artifacts/rules/{rule_id}",
    headers={
        "Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "title": "Updated Code Style Rules",
        "description": "Updated guidelines",
        "content": "Updated content...",
    },
)
data = res.json()
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	ruleID := os.Getenv("RULE_ID")
	body, _ := json.Marshal(map[string]any{
		"title":       "Updated Code Style Rules",
		"description": "Updated guidelines",
		"content":     "Updated content...",
	})
	req, _ := http.NewRequest("PUT", "https://api.nairi.ai/api/public/v1/artifacts/rules/"+ruleID, bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("NAIRI_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	raw, _ := io.ReadAll(res.Body)
	var data map[string]any
	json.Unmarshal(raw, &data)
	fmt.Println(data)
}

Response

{
  "id": "aar_01KJWRKX0ZNZP91YG3Q353776Q",
  "title": "Updated Code Style Rules",
  "description": "Updated guidelines",
  "created_at": "2026-03-04T15:49:11.000Z",
  "updated_at": "2026-04-12T18:50:00.000Z"
}

On this page