> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/cookbooks/platform-admin/give-people-access/give-a-team-access.md).

# Assign agents and apps to a team

Grant a team access to specific agents and apps.

`POST /teams/{teamId}/apps` adds data permissions to a team: the agents and apps its members can access. This is the API equivalent of [Assign agents and apps to a team](https://docs.uptiq.ai/platform-guides/admin/give-people-access/assign-agents-and-apps-to-a-team).

## At a glance

| Item            | Value                                           |
| --------------- | ----------------------------------------------- |
| ⚙️ Microservice | `Identity Hub`                                  |
| 🌍 Environment  | `QA`                                            |
| 🔗 Base URL     | `https://api-builder-qa.uptiq.dev/identity-hub` |
| ⌘ Endpoint      | `POST /teams/{teamId}/apps`                     |

{% columns %}
{% column %}

#### What it does

Grants a team access to specific agents or apps.
{% endcolumn %}

{% column %}

#### Success looks like

The service returns `200 OK` with the recorded assignment.
{% endcolumn %}
{% endcolumns %}

## Before you start

* Your API key needs the **Manage teams**, **View agents**, and **View apps** capabilities (`ManageTeam`, `ViewAgent`, `ViewApp`).
* Have the IDs of the agents or apps you're assigning — this call takes IDs, not names.

## Request

`POST /teams/{teamId}/apps`

| Field       | Type   | Required | What it does                                                     |
| ----------- | ------ | -------- | ---------------------------------------------------------------- |
| `module`    | string | Yes      | `app` or `agent` — which kind of resource `moduleIds` refers to. |
| `moduleIds` | array  | Yes      | The IDs to assign.                                               |

## Code snippets

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api-builder-qa.uptiq.dev/identity-hub/teams/TEAM_ID/apps \
  -H "x-platform-key: YOUR_API_KEY" \
  -H "accountid: YOUR_ACCOUNT_ID" \
  -H "content-type: application/json" \
  -d '{ "module": "agent", "moduleIds": ["agent_123", "agent_456"] }'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
await fetch(`https://api-builder-qa.uptiq.dev/identity-hub/teams/${teamId}/apps`, {
  method: "POST",
  headers: {
    "x-platform-key": process.env.UPTIQ_API_KEY,
    accountid: process.env.UPTIQ_ACCOUNT_ID,
    "content-type": "application/json",
  },
  body: JSON.stringify({ module: "agent", moduleIds: ["agent_123", "agent_456"] }),
});
```

{% endtab %}

{% tab title="Python" %}

```python
import os, requests

requests.post(
    f"https://api-builder-qa.uptiq.dev/identity-hub/teams/{team_id}/apps",
    headers={
        "x-platform-key": os.environ["UPTIQ_API_KEY"],
        "accountid": os.environ["UPTIQ_ACCOUNT_ID"],
    },
    json={"module": "agent", "moduleIds": ["agent_123", "agent_456"]},
)
```

{% endtab %}
{% endtabs %}

## Response

| Result     | What it means                                                      | Next action                                        |
| ---------- | ------------------------------------------------------------------ | -------------------------------------------------- |
| ✅ `200 OK` | `data` contains the recorded assignment and `message` confirms it. | Send a separate request for the other module type. |

## Developer notes

| Situation                | What to do                                                            |
| ------------------------ | --------------------------------------------------------------------- |
| Assign agents and apps   | Send one request with `module: "agent"` and one with `module: "app"`. |
| Remove an assignment     | Send `DELETE` to the same path with the same request body.            |
| Restrict resource access | Don't use this endpoint for enforcement. It records ownership only.   |

## Related

* [Assign agents and apps to a team](https://docs.uptiq.ai/platform-guides/admin/give-people-access/assign-agents-and-apps-to-a-team) — as a screen
* [Create a team](/cookbooks/platform-admin/give-people-access/create-a-team.md)
* [Review connector access](/cookbooks/platform-admin/agents-and-evidence/review-what-agents-can-reach.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uptiq.ai/cookbooks/platform-admin/give-people-access/give-a-team-access.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
