Skip to main content
POST
/
v1
/
agents
/
{agentId}
/
access
Share an agent with a principal (create binding)
curl --request POST \
  --url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/access \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "principal_id": "<string>"
}
'
{
  "created": true,
  "binding": {
    "agent_id": "<string>",
    "principal_id": "<string>",
    "email": "<string>",
    "orgSlug": "<string>",
    "granted_by": "<string>",
    "role_slug": "<string>"
  }
}

Authorizations

Authorization
string
header
required

User-bound credential carrying an identity: either a session JWT or a user access token (at:*) generated from the user settings UI. Send as Authorization: Bearer <token>. Org API keys (iak_*) are not accepted here - they carry no user identity. Use the x-prismeai-api-key header instead (see OrgApiKeyAuth).

Path Parameters

agentId
string
required
Maximum string length: 64

Body

application/json
principal_type
enum<string>
required
Available options:
user,
group,
org
Maximum string length: 32
principal_id
string
required

User id (or email for user type, resolved server-side), group id, or org slug.

Maximum string length: 128
role_slug
string

Role to grant. Defaults to admin.

Maximum string length: 64

Response

Binding created.

created
boolean
Example:

true

binding
object

Access binding granting a principal a role on an agent.