{"_id":"5450c5c87abbbc0800a5e9a6","category":{"_id":"5450c103a66f020800dba819","__v":5,"pages":["5450c240a66f020800dba827","5450c5c87abbbc0800a5e9a6","5450c792a66f020800dba83e","5450c8c67abbbc0800a5e9c0","5450cec17abbbc0800a5e9df"],"project":"543d1e263a300f20000d31fb","version":"543d1e5e5276641a00a593cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-29T10:27:15.385Z","from_sync":false,"order":9,"slug":"user","title":"User"},"project":"543d1e263a300f20000d31fb","user":"54352decadf50e0800b89024","version":{"_id":"543d1e5e5276641a00a593cf","forked_from":"543d1e263a300f20000d31fe","project":"543d1e263a300f20000d31fb","__v":16,"createdAt":"2014-10-14T13:00:14.946Z","releaseDate":"2014-10-14T13:00:14.946Z","categories":["543d1e5f5276641a00a593d0","543d1ee45276641a00a593da","5448e2cbc64edd1a00453c29","5449135acdc944220048845c","544a0a93778b3e08002b2289","544a0a9727b7fc140078da58","544a456f27b7fc140078daff","544e027cbd51b9080037f680","544e029ab80812080035bba6","544e3a2eb80812080035bd67","5450b7c5a66f020800dba7b3","5450c0e47abbbc0800a5e989","5450c0f97abbbc0800a5e98a","5450c103a66f020800dba819","54f99f588d09b7390007ea45","565c81dbf3e9360d00823e43"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"parentDoc":null,"__v":0,"editedParams2":true,"is_link":false,"editedParams":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-29T10:47:36.738Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"try":true,"basic_auth":false,"method":"post","results":{"codes":[{"name":"","code":"{\n    \"id\": 1337,\n    \"ern\": \"ern:user:1337\",\n    \"gender\": \"male\",\n    \"birth_year\": 1989,\n    \"name\": \"Foo Bar\",\n    \"email\": \"foo:::at:::bar.com\",\n    \"permissions\": {\n        \"user\": [\"api.public\"],\n        \"foo@bar.com\": [\n          \"api.users.1337.read\",\n          \"api.users.1337.update\",\n          \"api.users.1337.delete\"\n       \t]\n    }\n}","language":"json","status":201},{"name":"","code":"{\n\t/* Standard error response.\n  \t Check the code, message and details for info on error.\n     Error codes:\n     - 1530: Email already exists\n     - 400: Validation error. See \"failed_on_field\" key for what field failed validation. \n  */\n}","language":"json","status":400}]},"auth":"never","params":[{"_id":"5450c5c87abbbc0800a5e9b0","ref":"","in":"body","required":true,"desc":"Your API session token.","default":"","type":"string","name":"_token"},{"_id":"5450c5c87abbbc0800a5e9af","ref":"","in":"body","required":false,"desc":"Your API session signature.","default":"","type":"string","name":"_signature"},{"_id":"5450c5c87abbbc0800a5e9ae","ref":"","in":"body","required":true,"desc":"Users real name.","default":"","type":"string","name":"name"},{"_id":"5450c5c87abbbc0800a5e9ad","ref":"","in":"body","required":true,"desc":"Users email.","default":"","type":"string","name":"email"},{"_id":"5450c5c87abbbc0800a5e9ac","ref":"","in":"body","required":true,"desc":"URL to redirect to when user successfully verifies the user via email.","default":"","type":"string","name":"success_redirect"},{"_id":"5450c5c87abbbc0800a5e9ab","ref":"","in":"body","required":true,"desc":"URL to redirect to if verification via email fails.","default":"","type":"string","name":"error_redirect"},{"_id":"5450c5c87abbbc0800a5e9aa","ref":"","in":"body","required":false,"desc":"Users year of birth. Used to generate better recommendations for the user.","default":"","type":"int","name":"birth_year"},{"_id":"5450c5c87abbbc0800a5e9a9","ref":"","in":"body","required":true,"desc":"Gender. Used to generate better recommendations. Valid options are: \"none\", \"male\", \"female\"","default":"","type":"string","name":"gender"},{"_id":"5450c5c87abbbc0800a5e9a8","ref":"","in":"body","required":true,"desc":"Desired account password. Minimum 6 characters.","default":"","type":"string","name":"password"},{"_id":"5450c5c87abbbc0800a5e9a7","ref":"","in":"body","required":true,"desc":"Users country/language. e.g. da_DK, en_US.","default":"","type":"string","name":"locale"}],"url":"/v2/users"},"isReference":false,"order":1,"body":"Create a new user in the system.\n\nA verification email is sent to the given email.\nThe email contains a verification link. When the user clicks the link,\nthe user is either taken to `success_redirect` or `error_redirect` depending on how the verification went (`success_redirect` and `error_redirect` can be the same URL).\n\nThe redirect call will, in addition to what is given as `success_redirect`, also contain a query string argument `_data` and `_state`.\n\n`_state` is either `created` or `updated`, depending on what action lead to the verification email. (See \"User Update\").\n\nThe `_data` field is a base64 encoded json string, containing the user object of the newly created user.\nYou can base64 decode and JSON parse this field to get the user model.\nThis is useful for displaying a personalized success message, like \"Hey {user.name}, your account is now verified!\"","excerpt":"","slug":"user-create","type":"endpoint","title":"User Create"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

_token:
required
string
Your API session token.
_signature:
string
Your API session signature.
name:
required
string
Users real name.
email:
required
string
Users email.
success_redirect:
required
string
URL to redirect to when user successfully verifies the user via email.
error_redirect:
required
string
URL to redirect to if verification via email fails.
birth_year:
integer
Users year of birth. Used to generate better recommendations for the user.
gender:
required
string
Gender. Used to generate better recommendations. Valid options are: "none", "male", "female"
password:
required
string
Desired account password. Minimum 6 characters.
locale:
required
string
Users country/language. e.g. da_DK, en_US.

Result Format


Documentation

Create a new user in the system. A verification email is sent to the given email. The email contains a verification link. When the user clicks the link, the user is either taken to `success_redirect` or `error_redirect` depending on how the verification went (`success_redirect` and `error_redirect` can be the same URL). The redirect call will, in addition to what is given as `success_redirect`, also contain a query string argument `_data` and `_state`. `_state` is either `created` or `updated`, depending on what action lead to the verification email. (See "User Update"). The `_data` field is a base64 encoded json string, containing the user object of the newly created user. You can base64 decode and JSON parse this field to get the user model. This is useful for displaying a personalized success message, like "Hey {user.name}, your account is now verified!"