```python
from fastapi import FastAPI

import helpers  # noqa: F401

app = FastAPI()


@app.post("/documents", status_code=201)
def create_document(payload: dict):
    name = payload.get("name")
    text = payload.get("text")
    # Assuming the client provides both fields as per the spec.
    bytes_written = helpers.save_document(name, text)
    return {"bytes": bytes_written}
```