/userEntities

Entities can be redefined on a user (session ID) level. An example scenario could be when you have a @playlist entity that has generic playlist. As playlists are user-specific, @playlist entity could be defined in a request or for a given session.

If user entities are submitted via the /userEntities endpoint, they live in the session for 30 minutes.

BaseURL

https://api.dialogflow.com/v1/

User entity JSON object

Name Type Description
automatedExpansion Boolean Indicates if the entity can be expanded automatically.
entries Array of objects An array of entity objects.
- synonyms Array of strings This defines the possible synonyms for the entity.
- value String The string value of the entity.
extend Boolean A flag identifying whether the additional data should extend or replace the default entity definition.
Optional field. If not defined, the default value is false.
isEnum Boolean Indicates if the entity is a mapping or enum type entity.
isOverridable Boolean Indicates whether this entity can be overridden by a system or developer entity. Default is true.
name String Name of the entity.

GET /userEntities/{name}

Gets a user entity object by name.

GET /userEntities/{name} sample

HTTP

GET https://api.dialogflow.com/v1/userEntities/fruit?v=20150910&sessionId=12345

Headers:
Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN
Content-Type: application/json
    

cURL

curl -X GET \
'https://api.dialogflow.com/v1/userEntities/fruit?v=20150910&sessionId=12345' \
-H 'Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN' \
-H 'Content-Type: application/json'
    

GET /userentities/{name} response

POST /userEntities

Adds one or more session based entities.

POST /userEntities sample

HTTP

POST https://api.dialogflow.com/v1/userEntities?v=20150910&sessionId=12345

Headers:
Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN
Content-Type: application/json

POST body:
{
  "entities": [
    {
      "entries": [
        {
          "synonyms": [
            "user-apple",
            "user-red apple"
          ],
          "value": "user-apple"
        },
        {
          "synonyms": [
            "user-banana"
          ],
          "value": "user-banana"
        }
      ],
      "name": "user-fruit"
    }
  ],
  "sessionId": "12345"
}
    

cURL

curl -X POST \
'https://api.dialogflow.com/v1/userEntities?v=20150910&sessionId=12345' \
-H 'Authorization: Bearer CLIENT_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
--data '{
  "entities": [
    {
      "entries": [
        {
          "synonyms": [
            "user-apple",
            "user-red apple"
          ],
          "value": "user-apple"
        },
        {
          "synonyms": [
            "user-banana"
          ],
          "value": "user-banana"
        }
      ],
      "name": "user-fruit"
    }
  ],
  "sessionId": "12345"
}'
    

PUT /userEntities/{name}

Updates user entity specified by name.

PUT /userEntities/{name} sample

HTTP

PUT https://api.dialogflow.com/v1/userEntities?v=20150910&sessionId=12345

Headers:
Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN
Content-Type: application/json

PUT body:
{
  "entities": [
    {
      "entries": [
        {
          "synonyms": [
            "user-apple",
            "user-red apple"
          ],
          "value": "user-apple"
        },
        {
          "synonyms": [
            "user-banana"
          ],
          "value": "user-banana"
        }
      ],
      "name": "user-fruit"
    }
  ],
  "sessionId": "12345"
}
    

cURL

curl -X PUT \
'https://api.dialogflow.com/v1/userEntities/fruit?v=20150910&sessionId=12345' \
-H 'Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
--data '{
   "entities":[
      {
         "entries":[
            {
               "synonyms":[
                  "user-apple",
                  "user-red apple"
               "value":"user-apple",
               ]
            },
            {
               "synonyms":[
                  "user-banana"
               "value":"user-banana",
               ]
            }
         ],
         "name":"user-fruit"
      }
   ],
   "sessionId":"12345"
}'
    

DELETE /userEntities/{name}

Deletes a user entity object with a specified name.

DELETE /userEntities/{name} sample

HTTP

DELETE https://api.dialogflow.com/v1/userEntities/fruit?v=20150910&sessionId=12345

Headers:
Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN
Content-Type: application/json
    

cURL

curl -X DELETE \
'https://api.dialogflow.com/v1/userEntities/fruit?v=20150910&sessionId=12345' \
-H 'Authorization: Bearer YOUR_CLIENT_ACCESS_TOKEN' \
-H 'Content-Type: application/json'
    

POST, PUT and DELETE responses