Subjects - Create

Create a Subject

To create a new subject the following fields should be passed:

NameExampleDescription
name
string
"Cat"(required) Brief descriptive name of the subject. Can be multiple words, with max length <= 70
description
string
"Domestic cats only."(optional) Full description of the subject. Use this field to capture detailed subject semantics and feedback instructions.
external_id
string
"ABCcat123"(optional) User supplied id for the subject
POST /1/subjects
Host: https://api.cogniac.io

Example: Create a Subject

curl -X POST https://api.cogniac.io/1/subjects \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \
-H "Content-Type: application/json" \
-d '{
"name":"Cat",
"description":"Domestic cats from catdoor camera",
"external_id":"ABCcat123"
}'
import cogniac

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

# create the subject with keyword arguments
subject = cc.create_subject(name="Cat",
                            description="Domestic cats from catdoor camera", 
                            external_id="ABCcat123")

print subject.subject_uid
{
  "subject_uid": "cat_123",
  "name": "Cat",
  "description": "Domestic cats from catdoor camera",
  "created_at": 1463175250.216059,
  "external_id":"ABCcat123",
  "modified_at": 1463175250.216059,
  "created_by": "[email protected]",
  "tenant_id": "lmulcvdfluyw"
}