Subjects - Create
  • 22 Dec 2023
  • 1 Minute to read
  • Dark
    Light

Subjects - Create

  • Dark
    Light

Article summary

Create a Subject

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

Name

Example

Description

name
string

"Cat"

(required) Brief descriptive name of the subject. It 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"
}' | json_pp
import cogniac

cc = cogniac.CogniacConnection(username="test@cogniac.co", 
                               password="myPassword", 
                               tenant_id="63QhzFLc9tg4")

subject = cc.create_subject(name="Cat",
                            description="Domestic cats from catdoor camera", 
                            external_id="ABCcat123")

print(subject.subject_uid)
{
Subject_name = Cat
Subject_description = Domestic cats from catdoor camera
Subject_uid = .....
}


Was this article helpful?