HTTP API Reference

Create a new entity

Creates a new entity with the given attributes.

Arguments

The request body must contain a JSON object with the given fields:

name required type doc
id required string ID or name of the requested entity
doc optional string Short sentence describing this entity
values optional array Possible values for this entity

Definition

  POST https://api.wit.ai/entities

Example request

  $ curl -XPOST 'https://api.wit.ai/entities?v=20140916 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"doc":"A city that I like",
       "id":"favorite_city",
             "values":[{"value":"Paris",
                                    "expressions":["Paris", "City of Light", "Capital of France"]}]}'

Example response

  {
    "lang" : "en",
    "closed" : false,
    "exotic" : false,
    "values" : [ {
      "expressions" : [ "Paris" ],
      "value" : "Paris"
    } ],
    "builtin" : false,
    "doc" : "A city that I like",
    "name" : "favorite_city",
    "id" : "5418abc7-cc68-4073-ae9e-3a5c3c81d965"
  }