# Metadata and quotas

> What Files records about each file, custom metadata, and the limits you set per bucket.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://files.docs.sypnia.com/buckets/metadata-and-quotas/

For agents: Files metadata: row per file in sypnia_files.objects (id, bucket_id, name, owner from token, size, content_type, checksum SHA-256, scan_status, metadata JSON, case, timestamps, last_accessed_at), queryable/joinable/policy-able; upload with metadata option. Per-bucket limits: maxFileSize (413), allowedTypes (sniffed from bytes), scan on/off, cacheControl. Cloud project quotas: storage and monthly transfer; over storage → uploads refused insufficient_storage, downloads keep working.

## What is recorded

Each file is a row in `sypnia_files.objects`: `id`, `bucket_id`, `name` (the path), `owner` (the user who uploaded it, from the token), `size`, `content_type`, `checksum` (SHA-256), `scan_status`, `metadata` (your own JSON), `case` (the [use case](https://files.docs.sypnia.com/buckets/use-cases) that last wrote it), `created_at`, `updated_at`, `last_accessed_at`.

Because it is a table in your project's database, you can query it with SQL, join it with your own tables and write policies on it.

```ts
await files.bucket('receipts').upload('order-1042.pdf', pdf, { metadata: { orderId: 1042 } });
```

## Per-bucket limits

| Setting        | Effect                                                                                                   |
| -------------- | -------------------------------------------------------------------------------------------------------- |
| `maxFileSize`  | uploads larger than this are refused with `413`                                                          |
| `allowedTypes` | a list of MIME types or patterns (`image/*`); the type is checked from the bytes, not only the file name |
| `scan`         | `off`, or `on` to serve files only after a clean malware scan                                            |
| `cacheControl` | the `Cache-Control` header for public files                                                              |

## Project quotas **\[Cloud]**

A project has a storage quota and a monthly transfer quota from its plan. Near the limit you are notified; over it, uploads are refused with `insufficient_storage` until you add credits or capacity. Downloads keep working.
