{"_id":"59c33dff9aea850010ac4304","project":"568bdc1483d2061900d86cdc","version":{"_id":"59a72290d61777001b6c42c3","project":"568bdc1483d2061900d86cdc","__v":29,"createdAt":"2017-08-30T20:39:44.453Z","releaseDate":"2017-08-30T20:39:44.453Z","categories":["59a7236e3fe4d90025117c10","59a72eb6cb0db3001b84cfe2","59a734eb757d030019b85af8","59c0243b1b2d07001a9d2b76","59c035e42126e10028effb12","59c06c40df5b3c0010584a13","59c1a5852cabe5002641a3e7","59c2fb00b2b45c0010b7a3d7","59c32ceb9aea850010ac4130","59c32e6e190c90003cb0d12f","59c33affb2b45c0010b7aa23","59c7dfa457bd8200105444dc","59c7e975c50cf30010d712a0","59cffdef0cd4dd0010294d54","59d0622ca91a810032c8f60c","59d06733c1aec60026253065","59d174d44ac471001a07b123","59d5a5e323e6e800103defb2","59ecf1d8ed507c001c52b255","59f76fef8581dc0010593e6f","5a0c003680a35b0012c35db0","5a8358722e78660075e45f42","5a846645b5ec3a001203517e","5b258091bc7a6700033b9cb5","5b26e48e024807000315a740","5b44edff3306680003663f5c","5b468abd3d4a9e0003789111","5b468d8f3dcb6a0003c6e374","5b47b0b93d4a9e000378a33a"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.0","version":"0"},"category":{"_id":"59c33affb2b45c0010b7aa23","project":"568bdc1483d2061900d86cdc","version":"59a72290d61777001b6c42c3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-09-21T04:07:27.858Z","from_sync":false,"order":24,"slug":"users-api","title":"Users API"},"user":"58cc41f21751ce2f003be3b7","__v":14,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-21T04:20:15.082Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"59a85b6b02c545000f08a77f","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"token\": \"_UDTEj2600z8jitmXbX-48v-pij3iANkLLG54XK4uNtrFPkBKHD0ZMhDIYxuJ9-m07GWc7Ck-9FdKHshuXM4c2YDrWy42i6PDS7dR1daxxNoPj6ZdYm9dVrlXsS9N10Pa\"\n}","name":"Updated"},{"status":201,"language":"json","code":"{\n    \"token\": \"_GhaNYmg5HgmoJWJDpQPgguQv5bwasNECMUfcWD2EB0yf5Ijs8PGpMA-bV0NcA6FzRgGcmYmB49WanwUSFGRjPFG8IuUtl9s930z2DYLnskkC0yRqknitwiUB00Dxu1h5\"\n}","name":""},{"code":"{\n    \"errorType\": \"InvalidParams\",\n    \"errors\": [\n        {\n            \"in\": \"query\",\n            \"message\": \"contains fields that are not allowed: [ query ]\",\n            \"path\": \"additional parameters\"\n        }\n    ]\n}","language":"json","status":400,"name":"Invalid Query Parameter"},{"code":"{\n    \"errorType\": \"InvalidParams\",\n    \"errors\": [\n        {\n            \"in\": \"query\",\n            \"message\": \"expected field to be a number\",\n            \"path\": \"ttl\"\n        }\n    ]\n}","language":"json","name":"Token Duration Invalid","status":400},{"status":400,"code":"{\n    \"errorType\": \"InvalidParams\",\n    \"errors\": [\n        {\n            \"in\": \"query\",\n            \"message\": \"field must be one of the following values: Infinite, FixedTtl, SlidingTtl\",\n            \"path\": \"expiryType\"\n        }\n    ]\n}","language":"json","name":"Token Expiration Type Invalid"},{"status":400,"code":"{\n    \"errorType\": \"InvalidParams\",\n    \"errors\": [\n        {\n            \"in\": \"query\",\n            \"message\": \"expected field to be a boolean\",\n            \"path\": \"generateToken\"\n        }\n    ]\n}","language":"json","name":"Token Generation Invalid"},{"status":400,"code":"{\n    \"errorType\": \"Internal Server Error\"\n}","language":"json","name":"Metadata Format Invalid"},{"code":"{\n    \"errorType\": \"Internal Server Error\"\n}","language":"json","name":"Environment Access Format Invalid","status":400},{"code":"Ecosystem with id Ca933243b68505e7cf9ef2ec2 does not exist.","language":"text","name":"Ecosystem Not Found","status":404}]},"examples":{"codes":[{"code":"PUT https://ioe.droplit.io/api/users/C59eb8eae278b6bf402e39d25;newUser?generateToken=true&ttl=20&expiryType=SlidingTtl HTTP/1.1\nauthorization: AUTH_TOKEN\ncontent-type: application/json\nx-system-metadata-prefix: \"#\"\n\n{\n\t\"access\" : [\n\t\t{\n\t\t\t\"environmentId\" : \"Eb86d758c507b788286866a3e\",\n\t\t\t\"accessLevel\" : \"Full\"\n\t\t},\n\t\t\t\"environmentId\" : \"Ee6c4b94f872676661915310c\",\n\t\t\t\"accessLevel\" : \"None\"\n\t\t],\n    \"email\" : \"newUser:::at:::droplit.io\",\n    \"meta\" : {\n    \t\"#label\": \"New User\"\n    }\n}","language":"http"}]},"method":"put","auth":"required","params":[{"_id":"59c33c119aea850010ac42b7","ref":"","in":"path","required":true,"desc":"The ID of the ecosystem.","default":"","type":"string","name":"ecosystemId"},{"_id":"59c33c119aea850010ac42b6","ref":"","in":"path","required":true,"desc":"The new unique ID of the user to be created, or the ID of the user to be updated.","default":"","type":"string","name":"userId"},{"_id":"59c33dff9aea850010ac430b","ref":"","in":"query","required":false,"desc":"If set to \"True\", will generate a new user token.","default":"False","type":"boolean","name":"generateToken"},{"_id":"59c33dff9aea850010ac4309","ref":"","in":"query","required":false,"desc":"Time To Live. The length of time, in seconds, for which the newly generated user token will be valid.","default":"3600","type":"int","name":"ttl"},{"_id":"59c33dff9aea850010ac430a","ref":"","in":"query","required":false,"desc":"How the newly generated user token will expire. There are three methods of expiration: \"Infinite\" (token never expires), \"FixedTtl\" (token will expire after a set amount of time), and \"SlidingTtl\" (token will expire after it has not been used for a set amount of time).","default":"FixedTtl","type":"string","name":"expiryType"},{"_id":"59c33dff9aea850010ac4308","ref":"","in":"body","required":false,"desc":"Each element contains an environment ID and the user's access level to that environment. There are two access levels: \"Full\" and \"None\". If a user's access level is updated to \"None\", that environment's entry will be removed.","default":"","type":"array_object","name":"access"},{"_id":"59c33dff9aea850010ac4307","ref":"","in":"body","required":false,"desc":"The user's email address.","default":"","type":"string","name":"email"},{"_id":"59c33dff9aea850010ac4306","ref":"","in":"body","required":false,"desc":"Any proprietary information that is to be stored with the user.","default":"","type":"object","name":"meta"},{"_id":"5b292abc36a5030003c3ffce","ref":"","in":"header","required":true,"desc":"The user's authorization token.","default":"","type":"string","name":"authorization"},{"_id":"59c33dff9aea850010ac4305","ref":"","in":"header","required":false,"desc":"A custom metadata prefix.","default":"$","type":"string","name":"x-system-metadata-prefix"}],"url":"/:ecosystemId;:userId"},"isReference":false,"order":1,"body":"Create a new user, or update the properties of an existing user.\n\nThe token generation parameters should only be used if a new user is being created or if a significant update to the user is being made. Do not use this token specifically to generate a user token without creating or making changes to a user. Use endpoint `GET api/users/:id/tokens` when a new token should be generated without changing or creating a user.\n\nAn account token or server token may be used to run this endpoint.","excerpt":"","slug":"users-create-update","type":"endpoint","title":"Create or Update a User."}

putCreate or Update a User.


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

ecosystemId:
required
string
The ID of the ecosystem.
userId:
required
string
The new unique ID of the user to be created, or the ID of the user to be updated.

Query Params

generateToken:
booleanFalse
If set to "True", will generate a new user token.
ttl:
integer3600
Time To Live. The length of time, in seconds, for which the newly generated user token will be valid.
expiryType:
stringFixedTtl
How the newly generated user token will expire. There are three methods of expiration: "Infinite" (token never expires), "FixedTtl" (token will expire after a set amount of time), and "SlidingTtl" (token will expire after it has not been used for a set amount of time).

Body Params

access:
array of objects
Each element contains an environment ID and the user's access level to that environment. There are two access levels: "Full" and "None". If a user's access level is updated to "None", that environment's entry will be removed.
email:
string
The user's email address.
meta:
object
Any proprietary information that is to be stored with the user.

Headers

authorization:
required
string
The user's authorization token.
x-system-metadata-prefix:
string$
A custom metadata prefix.

Examples


Result Format


Documentation

Create a new user, or update the properties of an existing user. The token generation parameters should only be used if a new user is being created or if a significant update to the user is being made. Do not use this token specifically to generate a user token without creating or making changes to a user. Use endpoint `GET api/users/:id/tokens` when a new token should be generated without changing or creating a user. An account token or server token may be used to run this endpoint.

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}