> For the complete documentation index, see [llms.txt](https://alexisvisco.gitbook.io/kcd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alexisvisco.gitbook.io/kcd/hooks-and-extractors/render-hook.md).

# Render hook

The render hook is the last call of KCD, it takes the response returned by your handler and sends a marshaled version of the output back to the client with the default status code provided by the `kcd.handler`.

A render hook must have this signature:

```go
type RenderHook func(w http.ResponseWriter, r *http.Request, response interface{}, defaultStatusCode int) error
```

{% hint style="info" %}
Check out the default [render hook implementation here](https://github.com/alexisvisco/kcd/blob/master/pkg/hook/render.go).

Check out the signature of the [RenderHook](https://github.com/expectedsh/kcd/blob/master/pkg/hook/hooks.go#L19).

[Here](/kcd/real-world-use-case/conditionally-render-your-outputs.md) you will find an example of render hook redefinition.
{% endhint %}
