# Validate hook

The validate hook is the hook called to validate your input after it has been parsed. The default expected error for a validation error by the error hook is a `map[string]error` . By default the hook use [ozzo-validation](https://github.com/go-ozzo/ozzo-validation).

A validate hook must have this signature:

```go
type ValidateHook func(ctx context.Context, input interface{}) error
```

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

Check out the signature of the [validate hook](https://github.com/expectedsh/kcd/blob/master/pkg/hook/hooks.go#L27).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alexisvisco.gitbook.io/kcd/hooks-and-extractors/validate-hook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
