/user
User
POST
https://api-org.synap.ac/users
Register a new user to your organisation.
Headers
{
"user": {
"objectId": "A123TESTX9",
"email": "test@email.com",
"password": "Password123",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
}
"timestamp": "2020-03-30T10:05:16.754Z"
}
// Email already exists in our database
{
"code": 400,
"error": "Account already exists for this username.";
}
// insufficient password security
{
"code": 400,
"error": "Password does not meet the password policy requirements.";
}
Body Parameters
User
Actions
Examples
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": "test@email.com",
"password": "Password123",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
},
"actions": {
"addToUserGroup": "U6CoTESTL7"
}
}'
{
"user": {
"email": "test@email.com",
"password": "Password123",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
},
"actions": {
"addToUserGroup": "U6CoTESTL7"
}
}
{
"objectId": "A123TESTX9",
"email": "test@email.com",
"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 user
DELETE
{API_URL}/users/:objectId
Permanently remove the user and all their data from your organisation.
Query Parameters
Headers
{
"objectId": "A123TESTX9",
"createdAt": "2020-03-27T12:00:00.000Z",
"updatedAt": "2020-03-27T12:00:00.000Z",
"email": "test@email.com",
"name": "Tom Smith",
"attr": {
"foo": true,
"bar": 123
}
"timestamp": "2020-03-30T10:05:16.754Z"
}
{
"code": 404,
"error": "Object not found.";
}
Examples
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": "test@email.com",
"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 updated