Agent resources

Assign

Attach a resource (rule, MCP config, skill, vault, integration, or model) to an agent.

POST /api/public/v1/agents/{agent_id}/resources

{agent_id} accepts either the ULID (cci_...) or the human-readable slug (the agent's agent_id field).

Request body

Prop

Type

Entity types

Typeentity_id formatDescription
agent_artifact_ruleaar_…Rule artifact
agent_artifact_mcp_cfgamc_…MCP configuration artifact
agent_artifact_skillask_…Skill artifact
vaultvlt_…Secrets vault
github_repository_integrationULIDGitHub repository integration (list IDs via GET /integrations/github-repos)
anthropic_integrationai_…Anthropic API integration (list IDs via GET /integrations/llm)
llm_modelmodel slug (opus-4.5, sonnet-4.6, …)LLM model configuration (list available models via GET /models)

If the referenced entity does not exist, the response is 404 Not Found (not 400).

Example

curl -X POST https://api.nairi.ai/api/public/v1/agents/AGENT_ID/resources \
  -H "Authorization: Bearer $NAIRI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entity_type": "agent_artifact_rule",
    "entity_id": "aar_01KJWRKX0ZNZP91YG3Q353776Q"
  }'
const res = await fetch(
  `https://api.nairi.ai/api/public/v1/agents/${agentId}/resources`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.NAIRI_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      entity_type: "agent_artifact_rule",
      entity_id: "aar_01KJWRKX0ZNZP91YG3Q353776Q",
    }),
  },
);
const data = (await res.json()) as { id: string };
require "net/http"
require "json"
require "uri"

uri = URI("https://api.nairi.ai/api/public/v1/agents/#{agent_id}/resources")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV['NAIRI_API_KEY']}"
req["Content-Type"] = "application/json"
req.body = {
  entity_type: "agent_artifact_rule",
  entity_id: "aar_01KJWRKX0ZNZP91YG3Q353776Q",
}.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.post(
    f"https://api.nairi.ai/api/public/v1/agents/{agent_id}/resources",
    headers={
        "Authorization": f"Bearer {os.environ['NAIRI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "entity_type": "agent_artifact_rule",
        "entity_id": "aar_01KJWRKX0ZNZP91YG3Q353776Q",
    },
)
data = res.json()
package main

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

func main() {
	agentID := os.Getenv("AGENT_ID")
	body, _ := json.Marshal(map[string]any{
		"entity_type": "agent_artifact_rule",
		"entity_id":   "aar_01KJWRKX0ZNZP91YG3Q353776Q",
	})
	req, _ := http.NewRequest(
		"POST",
		"https://api.nairi.ai/api/public/v1/agents/"+agentID+"/resources",
		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: 201 Created

{
  "id": "ccr_01KRK2A1B2C3D4E5F6G7H8J9K0",
  "container_id": "cci_01KEQ6963XS96YDP3NF9NKB7QJ",
  "entity_type": "agent_artifact_rule",
  "entity_id": "aar_01KJWRKX0ZNZP91YG3Q353776Q",
  "created_at": "2026-04-12T18:45:12.000Z"
}

On this page