Core
API v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

validate #

Deprecated since 1.5.0

This API route is deprecated and should not be used. Instead, use document:validate.

Validates data against existing validation rules.

Messages are always valid if no validation rules are defined on the provided index and collection.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/<index>/<collection>/_validate
Method: POST
Body:
{
  // data to validate
}

Other protocols #

{
  "index": "<index>",
  "collection": "<collection>",
  "controller": "realtime",
  "action": "validate",
  "body": {
    // data to validate
  }
}

Arguments #

  • collection: collection name
  • index: index name

Body properties #

Data content to validate against validation rules.


Response #

Returns an object with the following properties:

  • errorMessages: the exhaustive list of violated validation rules. Present only if valid is false
  • valid: a boolean telling whether the provided pass all validation rules
{
  "status": 200,
  "error": null,
  "index": "<index>",
  "collection": "<collection>",
  "controller": "realtime",
  "action": "validate",
  "result": {
    "valid": true
  }
}