For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
CommunityCreate AccountSign in
  • Overview
    • Welcome
    • Authentication
    • Using Environments
  • API Reference
      • GETList agents
      • POSTCreate an agent
      • GETGet an agent
      • GETList agent versions for an agent
      • GETRevert to a specific agent version
      • GETList Agent Roles
      • POSTAssign Role to Agent
      • DELRemove Role from Agent
      • GETGet logs for an agent
      • GETGet an agent log
      • GETGet all agent logs in your environment
      • GETGet all executions in your environment
      • DELDelete an agent
LogoLogo
LogoLogo
CommunityCreate AccountSign in
API ReferenceAgents

Assign Role to Agent

POST
https://api.x.flatfile.com/v1/agents/:agentId/roles
POST
/v1/agents/:agentId/roles
$curl -X POST https://api.x.flatfile.com/v1/agents/agentId/roles \
> -H "X-Disable-Hooks: true" \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "roleId": "roleId",
> "resourceId": "resourceId"
>}'
1{
2 "data": {
3 "id": "id",
4 "roleId": "roleId",
5 "actorId": "actorId",
6 "resourceId": "resourceId",
7 "createdAt": "2024-01-15T09:30:00Z",
8 "updatedAt": "2024-01-15T09:30:00Z"
9 }
10}
Assigns a role to a agent.
Was this page helpful?
Previous

Remove Role from Agent

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

agentIdstringRequired
The agent id

Headers

X-Disable-Hooks"true"Required

Request

This endpoint expects an object.
roleIdstringRequired
Role ID
resourceIdstringRequired

Response

This endpoint returns an object.
dataobject

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error