Pin a connected agent to projects
curl --request PUT \
--url https://app.hookie.ai/admin/api/agents/{grant_id}/projects \
--header 'Content-Type: application/json' \
--data '
{
"projects": [
{
"project_id": "<string>",
"level": "read"
}
]
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({projects: [{project_id: '<string>', level: 'read'}]})
};
fetch('https://app.hookie.ai/admin/api/agents/{grant_id}/projects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/agents/{grant_id}/projects"
payload = { "projects": [
{
"project_id": "<string>",
"level": "read"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"agent_id": "<string>",
"tenant_id": "<string>",
"projects": [
{
"project_id": "<string>",
"level": "read"
}
],
"projects_pinned": true,
"ok": true
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}Connected agents
Pin a connected agent to projects
Replaces the agent’s pins in the workspace it acts in (#665). A pinned agent sees only its pinned projects, each at most at its level: every other project, the Default one included, answers 404; it cannot create projects; and workspace-wide views that span every project (the audit log, data workspace, an unscoped live stream) are refused with project_restricted. An empty list unpins it. Only the agent’s own person may pin it, from the workspace it acts in, and only to projects that person can see. Workspace-level settings still follow the grant’s level.
PUT
/
admin
/
api
/
agents
/
{grant_id}
/
projects
Pin a connected agent to projects
curl --request PUT \
--url https://app.hookie.ai/admin/api/agents/{grant_id}/projects \
--header 'Content-Type: application/json' \
--data '
{
"projects": [
{
"project_id": "<string>",
"level": "read"
}
]
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({projects: [{project_id: '<string>', level: 'read'}]})
};
fetch('https://app.hookie.ai/admin/api/agents/{grant_id}/projects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/agents/{grant_id}/projects"
payload = { "projects": [
{
"project_id": "<string>",
"level": "read"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"agent_id": "<string>",
"tenant_id": "<string>",
"projects": [
{
"project_id": "<string>",
"level": "read"
}
],
"projects_pinned": true,
"ok": true
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"max_projects": 123,
"projects": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true,
"feature": "<string>"
}Response
Pins replaced; effective on the agent's next request.