/user
post
https://api-org.synap.ac
/users
User
User
Attribute | Type | Required | Description |
email | string | yes | The user's email address |
password | string | yes | At least 8 characters, mixture of 1 uppercase, 1 lowercase and 1 digit |
name | string | yes | The user's name |
attr | object | optional | Custom attributes you wish to set for the user |
Actions
Attribute | Type | Required | Description |
addToUserGroup | object | optional | Provide the id of the usergroup the new user should be added to |
cURL Request
Request Body
Response
curl --request POST \
--url https://api-org.synap.ac/users \
--header 'content-type: application/json' \
--header 'x-syn-org-id: org123test' \
--header 'x-syn-org-secret: secret123test' \
--header 'x-api-key: test123api' \
--data '{
"user": {
"email": "[email protected]",
"password": "Password123",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
},
"actions": {
"addToUserGroup": "U6CoTESTL7"
}
}'
{
"user": {
"email": "[email protected]",
"password": "Password123",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
},
"actions": {
"addToUserGroup": "U6CoTESTL7"
}
}
{
"objectId": "A123TESTX9",
"email": "[email protected]",
"password": "Password123",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
"timestamp": "2020-03-30T10:05:16.754Z"
}
--
403 Forbidden
{
"code": 403,
"error": "Unauthorised request."
}
delete
{API_URL}
/users/:objectId
Delete user
cURL Request
Response
curl --request DELETE \
--url https://api-org.synap.ac/users/A123TESTX9 \
--header 'x-syn-org-id: org123test' \
--header 'x-syn-org-secret: secret123test' \
--header 'x-api-key: test123api' \
200 Ok
{
"objectId": "A123TESTX9",
"createdAt": "2020-03-27T12:00:00.000Z",
"updatedAt": "2020-03-27T12:00:00.000Z",
"email": "[email protected]",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
"timestamp": "2020-03-30T10:05:16.754Z"
}
--
403 Forbidden
{
"code": 403,
"error": "Unauthorised request."
}
--
404 Not Found
{
"code": 404,
"error": "Object not found."
}
Last modified 3yr ago