Knowledge
Knowledge sources
PUT/api/ai-agents/{id}/knowledge-bases
Set which bases this agent reads
Required scope: knowledge.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
baseIds | string[] | yes | ≤ 20 items |
bash
curl -X PUT "https://api.zapyflow.com.br/api/ai-agents/{id}/knowledge-bases" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK404— Not found — also returned when the resource belongs to another workspace422— Understood, but rejected by a rule
GET/api/knowledge-bases
The team's knowledge bases
Required scope: knowledge.read
bash
curl "https://api.zapyflow.com.br/api/knowledge-bases" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK
POST/api/knowledge-bases
Create a knowledge base
Required scope: knowledge.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | yes | min 1, max 80 |
description | string | no | max 500 |
bash
curl -X POST "https://api.zapyflow.com.br/api/knowledge-bases" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
201— Created409— Conflict with the current state
PATCH/api/knowledge-bases/{id}
Rename a knowledge base or edit its description
Required scope: knowledge.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | no | min 1, max 80 |
description | string | no | max 500 |
bash
curl -X PATCH "https://api.zapyflow.com.br/api/knowledge-bases/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK404— Not found — also returned when the resource belongs to another workspace409— Conflict with the current state
DELETE/api/knowledge-bases/{id}
Delete an empty knowledge base
Required scope: knowledge.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl -X DELETE "https://api.zapyflow.com.br/api/knowledge-bases/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
204— No content404— Not found — also returned when the resource belongs to another workspace409— Conflict with the current state
GET/api/knowledge-bases/{id}/sources
The sources in a knowledge base
Required scope: knowledge.read
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl "https://api.zapyflow.com.br/api/knowledge-bases/{id}/sources" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK404— Not found — also returned when the resource belongs to another workspace