Skip to content
Navigation

setGrant

POST
/api/v1/agents/{agentId}/grants

Grant a role to a workspace member or to the whole workspace (agent admin). Replaces an existing grant for the same subject.

Authorization

  • session
    optional
    API key in cookie
  • token
    optional
    HTTP Bearer

    Authorization: Bearer <token>

Path parameters

  • agentId
    string
    required

Request body JSON required

  • subjectType
    user
    or
    workspace
    required
  • role
    viewer
    or
    operator
    or
    admin
    required
  • userId
    optional
    string

    Required for subjectType user; must be a workspace member.

Returns

200

Saved.

JSON
  • id
    string
    required
  • subjectType
    user
    or
    workspace
    required
  • role
    viewer
    or
    operator
    or
    admin
    required
  • createdAt
    string
    required
    format: date-time
  • user
    optional
    object
    • id
      string
      required
    • email
      string
      required
    • name
      string
      required
    • avatarUrl
      string
      required

400

Error.
JSON
  • error
    string
    required

403

Error.
JSON
  • error
    string
    required

404

Error.
JSON
  • error
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close