# Check file upload capability (/docs/api-reference/knowledge-base/canUploadFile)

> Check whether a file can be uploaded based on size and type.



**POST** `/knowledge_base/can_upload`

Check whether a file can be uploaded based on size and type.

```yaml
operationId: canUploadFile
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - file_size
          - file_type
        properties:
          file_size:
            type: integer
            minimum: 1
            description: Size in bytes.
            example: 524288
          file_type:
            type: string
            description: File extension. Only `pdf` is accepted.
            example: pdf
responses:
  '200':
    description: Upload capability and quota information.
    content:
      application/json:
        schema:
          type: object
          properties:
            success:
              type: boolean
            message:
              type: string
            quota:
              type: object
              description: Knowledge-base storage quota in megabytes.
              properties:
                total:
                  type: number
                used:
                  type: number
                remaining:
                  type: number
        example:
          success: true
          message: File can be uploaded
          quota:
            total: 10
            used: 0
            remaining: 10
```

**Python SDK**

```python
# Check if a file of the given size can be uploaded
file_size = 1024 * 1024  # 1MB file
response = client.knowledge_base.can_upload(file_size)
print(response)
```

**curl**

```bash
curl -X POST "https://backend.omnidim.io/api/v1/knowledge_base/can_upload" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```
