Create a User
To create a user, send a POST request to /api/users
HTTP request
POST /api/users
Parameters
Parameter | Type | Description | Required | Notes |
---|---|---|---|---|
form_configuration_name | String | Name of the form configuration | Required | |
form | UserForm | UserForm parameters that corresponds with FormConfiguration configuration | Required |
User Parameters
Parameter | Type | Description | Required | Notes |
---|---|---|---|---|
String | User's email address | Required | Default validation for presence, uniqueness, email format | |
external_id | String | custom external ID for the user, example in a third party database | Optional | |
featured | Boolean | Whether the user is featured | Optional | |
first_name | String | User's first name | Optional | |
last_name | String | User's last name | Optional | |
middle_name | String | User's middle name | Optional | |
name | String | Name of the user | Optional | |
password | String | password for the user | Optional | Default validation minimum 6 chars |
profiles | Hash[String=>UserProfileForm] | Form for updating profiles for this user | Optional | |
public_profile | Boolean | whether the profile has been marked as public | Optional | |
relationship_users | Hash[String=>RelationshipUserForm] | Form for updating relationship users for this profile | Optional | |
transactables | Hash[String=>TransactableForm] | Form for updating a user's transactable(s) | Optional |
Example request
"authorization: Token token=[YOUR API TOKEN]"
"accept: application/json"
"content-type: application/json"
{
"form_configuration_name": "reference_rest_api_create_user",
"form": {
"first_name": "Example",
"email": "example1@example.com",
"password": "somepassword"
}
}
Element | Type | Description | Required? |
---|---|---|---|
form_configuration_name | String | Name of the defined FormConfiguration | Required |
form | UserForm | Attributes for user, should match configuration defined in corresponding FormConfiguration | Required |
Example response
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"id": 1,
"errors": {}
}
Element | Type | Description |
---|---|---|
id | Integer | Object identifier |
errors | Object | Validation errors |
Error and Status Codes
Code | Message | Meaning |
---|---|---|
201 | Created | Resource was created |
401 | Unathorized | Invalid Authentication |
406 | Not Acceptable | Wrong parameters passed |
422 | Unprocessable Entity | Wrong values, not matched validations |