Subjects - Update

Update Subject

The following fields can be updated (with certain restrictions).

NameExampleDescription
name
string
"Cat"Brief descriptive name of the subject. Can be multiple words, with max_length <= 70
description
string
"Domestic cats only."Full description of the subject. Use this field to capture detailed subject semantics and feedback instructions.
POST /1/subjects/{subject_uid}/cat_123
Host: https://api.cogniac.io

Example: Update a Subject

curl -X POST https://api.cogniac.io/1/subjects/cat_123 \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \
-H "Content-Type: application/json" \
-d '{
"name":"Cats and Dogs",
"description":"Cats and dogs from catdoor camera"
}'
import cogniac

# connect to the tenant
cc = cogniac.CogniacConnection(username="[email protected]", 
                               password="myPassword", 
                               tenant_id="63QhzFLc9tg4")

# retrieve the subject to change
subject = cogniac.get_subject("cat_123")

# update the subject by changing attribute values
subject.name = "Cats and Dogs"
subject.description = "Cats and dogs from catdoor camera"

print subject.name
print subject.description
{
  "subject_uid": "cat_123",
  "name": "Cats and Dogs",
  "description": "Cats and dogs from catdoor camera",
  "created_at": 1463175250.216059,
  "modified_at": 1455044770,
  "created_by": "[email protected]",
  "tenant_id": "lmulcvdfluyw"
}

πŸ“˜

Subject Name

A subject's name field can be changed without affecting any pre-existing media associations. A subject_uid never changes.

Most subjects are one word and use standard characters, but non-standard and diacritic characters are allowed, and it is possible to include upper-case characters and multiple words in a subject name.