# Upload knowledge files

```http
POST https://trydimmi.com/api/v1/knowledge/uploads
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:write`.

## Body

- `filename` (string): filename of the file being uploaded
- `name` (string): general purpose name for multipart form value

## Response 201 (Created)

- `data` (object, required)
  - `key` (string, required): The key that names the uploaded archive. Put it in a source's settings to read from this upload.
  - `name` (string, required): The uploaded file's name.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/knowledge/uploads' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "filename": "<string>",
  "name": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "key": "<string>",
    "name": "<string>",
    "object": "<string>"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
