---
title: "Grant client files to an agent"
method: POST
path: "/agents/{agentId}/file-grants"
tags: ["Files"]
---

# Grant client files to an agent

`POST /agents/{agentId}/file-grants`

## Request

- Base URL: `https://api.atako.ai`
- URL: `https://api.atako.ai/agents/{agentId}/file-grants`
- Auth: HTTP bearer

## Path parameters

- `agentId` string, required

## Request body

- object
  - `nodeIds` string[], required

## Response `201`

Newly inserted grants (already-granted nodeIds are silently skipped, so the array may be shorter than the request, even empty).

- FileGrant[]
  - `id` string, uuid, required
  - `agentId` string, uuid, required
  - `nodeId` string, uuid, required
  - `grantedBy` string, uuid
  - `createdAt` string, date-time, required
  - `node` object: Only present on the list endpoint (joined).
    - `id` string, uuid
    - `name` string
    - `type` 'folder' | 'file'
    - `storagePath` string, nullable
    - `mimeType` string, nullable
    - `fileSize` integer, nullable
    - `parentId` string, uuid, nullable
    - `agentTag` string, uuid, nullable
    - `uploadSource` 'client' | 'agent', nullable

## Other responses

- `400`: nodeIds array required
- `401`: Missing, malformed, or invalid bearer token / API key, or revoked session (SESSION_REVOKED).
- `404`: Not found, or the caller is not authorized to access this resource.

---

[API](https://skmtc.dev/atako/apis/atako-api.md) · [All operations](https://skmtc.dev/atako/apis/atako-api/llms.txt) · [OpenAPI document](https://skmtc.dev/atako/apis/atako-api/revisions/aa555c56fbd7?raw)
