# Upload a PDF

> POST /agents/{id}/knowledge. HeyRik API parameters and documented request and response examples.

Source: https://www.heyrik.com/docs/api-reference/knowledge/post-agents-id-knowledge-upload-a-pdf

POST https://server.heyrik.com/api/v1/agents/{id}/knowledge

## Path parameters

- id (required): Replace {id} in the request URL with the value for this resource.

## Headers

Authorization: Bearer $HEYRIK_API_KEY (required). Keep your key on your server.

## Parameters

- file (multipart PDF, required): A PDF document. Send multipart/form-data, not JSON.

## Notes

Text is extracted on upload and folded into the agent's context, so it applies to the very next call.

## Request example

```sh
curl -X POST https://server.heyrik.com/api/v1/agents/agc_9f2a1c30/knowledge \
  -H "Authorization: Bearer $HEYRIK_API_KEY" \
  -F "file=@pricing-2026.pdf"
```

## Response example

```json
{
  "data": { "id": "kb_71a4", "name": "pricing-2026.pdf", "type": "pdf", "chars": 18422 }
}
```
