---
title: "Attach a tool (agent) to a stack profile"
method: POST
path: "/api/v1/stack-profiles/{profile_id}/agents"
tags: ["stack-profiles-curated"]
---

# Attach a tool (agent) to a stack profile

`POST /api/v1/stack-profiles/{profile_id}/agents`

## Request

- Base URL: `https://api.qualityclouds.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.qualityclouds.ai/api/v1/stack-profiles/{profile_id}/agents`
- Auth: one of:
  - HTTP bearer
  - OpenID Connect (`https://account.qualityclouds.com//realms/ai-production/.well-known/openid-configuration`)

## Path parameters

- `profile_id` string, uuid, required

## Request body

- AttachAgentRequest: Request body for POST /api/v1/stack-profiles/{profile_id}/agents.
  - `tool_id` string, required

## Response `201`

Successful Response

- StackProfileAgentResponse: Response body for a single tool link (agent) on a stack profile.
  - `stack_profile_id` string, uuid, required
  - `tool_id` string, required
  - `origin` 'local' | 'inherited', required: Whether the agent was directly attached or inherited from a parent.
  - `added_at` string, date-time, required
  - `description` string, nullable
  - `base_tool_scope` BaseToolScopeResponse: Scope row from base_tools (tool_id FK) for API consumers.
    - `scope_type` 'global' | 'org' | 'workspace' | 'project', required: Four-level scope hierarchy for curated stack profiles.
    - `org_id` string, uuid, nullable
    - `workspace_id` string, uuid, nullable
    - `repository_id` string, nullable
  - `targets` StackTargetSummaryResponse[], nullable
    - `id` string, required
    - `layer` 'Language' | 'Framework' | 'Platform', required
    - `target_key` string, required
    - `target_name` string, required
    - `description` string, nullable
  - `agent_features` AgentFeatureSummaryResponse[], nullable
    - `id` string, required
    - `name` string, required
    - `description` string, nullable

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `422`: Validation Error

---

[API](https://skmtc.dev/qualityclouds/apis/qai-orchestrator-api.md) · [All operations](https://skmtc.dev/qualityclouds/apis/qai-orchestrator-api/llms.txt) · [OpenAPI document](https://skmtc.dev/qualityclouds/apis/qai-orchestrator-api/revisions/250c849925af?raw)
