# Status Code in FastAPI

*noun*

say it: **“STAT-us KOHD in FAST-AY-PEE-EYE”** **/ˈstætəs ˈkoʊd ɪn ˈfæstˌeɪˌpiˌaɪ/**

The number a FastAPI route answers with when it succeeds, set with status_code= on its decorator, such as 201 for a newly created item.

## What is **Status Code in FastAPI**?

Set an endpoint's success **status code** with `status_code=`, such as `201` for created.

```python
@app.post('/reviews', status_code=201)
def add_review(review: ReviewIn):
    return save_review(review)
```

## In a sentence

- “The bakery's POST route sets its **status code** to 201, since it creates a special.”
- “Without status_code=201, FastAPI answers every success with the **status code** 200.”

Level: Apprentice · [More FastAPI terms at this level](https://www.ask-codey.com/glossary?category=fastapi&level=2)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/status-code-in-fastapi
