Cortex API
Search…
updateSubject
This method is to update an existing subject.
This method was added in Cortex 2.1

Parameters

Name
Type
Required
Description
cortexToken
string
yes
A token returned by authorize.
subjectName
string
yes
The name of the subject.
dateOfBirth
string
no
The date of birth of the subject. The format must be "YYYY-MM-DD", e.g. "1980-12-25".
sex
string
no
Must be "M", "F" or "U". These letters stands for male, female and unknown respectively.
countryCode
string
no
The Alpha-2 ISO code of the country the subject lives in.
state
string
no
The state the subject lives in.
city
string
no
The city the subject lives in.
attributes
array of objects
no
A list of demographic attribute objects. See Subject object.
A subject is identified by his/her name, so you must provide the name of the subject you want to update. Then you can set one or more of the not required fields to update their value.

Result

The result is a subject object representing the updated subject.

Examples

Update the date of birth of a subject.
Request
Response
1
{
2
"id": 1,
3
"jsonrpc": "2.0",
4
"method": "updateSubject",
5
"params": {
6
"cortexToken": "xxx",
7
"subjectName": "Bob Smith",
8
"dateOfBirth": "1978-11-21"
9
}
10
}
Copied!
1
{
2
"id": 1,
3
"jsonrpc": "2.0",
4
"result": {
5
"attributes": [],
6
"city": "",
7
"countryCode": "",
8
"countryName": "",
9
"dateOfBirth": "1978-11-21",
10
"experimentsCount": 0,
11
"modifiedDatetime": "2019-07-01T11:49:50.332+07:00",
12
"sex": "U",
13
"state": "",
14
"subjectName": "Bob Smith"
15
}
16
}
Copied!
Copy link