Skip to main content
POST
/
users.json
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{  
  "user":{  
    "login":"Peter",
    "password":"!Peter009",
    "email":"peter@gmail.com",
    "external_user_id":1236672,
    "facebook_id":"8887366",
    "full_name":"Peter Smith",
    "phone":"+73123555",
    "website":"https://mysite.com",
    "tag_list":"marketing,seo",
    "custom_data":"lead of marketing team"
  }
}' \
https://api.quickblox.com/users.json
{
  "user": {
    "id": 96752798,
    "full_name": "Peter Smith",
    "email": "peter@gmail.com",
    "login": "Peter",
    "phone": "+73123555",
    "website": "https://mysite.com",
    "created_at": "2019-08-27T20:19:08Z",
    "updated_at": "2019-08-27T20:19:08Z",
    "last_request_at": null,
    "external_user_id": 1236672,
    "facebook_id": "8887366",
    "blob_id": null,
    "custom_data": "lead of marketing team",
    "age_over16": false,
    "allow_statistics_analysis": false,
    "allow_sales_activities": false,
    "parents_contacts": "",
    "user_tags": "marketing,seo"
  }
}

Recipes

1

1. Use 'Authorization' header to pass API key

curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
    "user": {
      "login": "johndoe",
      "password":"quickblox",
      "full_name": "John Doe"
    }
}' \
https://api.quickblox.com/users.json
2

2. Use a `user` parameter to create a new user

curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
    "user": {
      "login": "johndoe",
      "password":"quickblox",
      "full_name": "John Doe"
    }
}' \
https://api.quickblox.com/users.json
3

3. Set values for the fields

curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
    "user": {
      "login": "johndoe",
      "password":"quickblox",
      "full_name": "John Doe"
    }
}' \
https://api.quickblox.com/users.json
4

4. As a result, the API returns a created user

curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
    "user": {
      "login": "johndoe",
      "password":"quickblox",
      "full_name": "John Doe"
    }
}' \
https://api.quickblox.com/users.json
Trailing whitespaces in string data (except for the password) will be trimmed.
The request can contain all, some or none of the optional parameters. Login, email, Facebook ID, and the external user ID should not be taken previously. If you want to create a user with some content (for example, with an avatar) you have to create a blob first. The blob is the entity that is a file in a system. To learn how to create a blob, review this section. You can assign tags to the user. The same tags can be used for any number of users.

Body Parameters

user
object
required

Headers

QB-Token
string
required
A user or application session token. See Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
Authorization
string
default:"ApiKey {your_api_key}"
required
API key from Dashboard. Expected format: ApiKey {your_api_key}. Must be used either QB-Token or Authorization.

Responses

A successful response
user
object
An error response
code
string
message
string
An error response
errors
object
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{  
  "user":{  
    "login":"Peter",
    "password":"!Peter009",
    "email":"peter@gmail.com",
    "external_user_id":1236672,
    "facebook_id":"8887366",
    "full_name":"Peter Smith",
    "phone":"+73123555",
    "website":"https://mysite.com",
    "tag_list":"marketing,seo",
    "custom_data":"lead of marketing team"
  }
}' \
https://api.quickblox.com/users.json
{
  "user": {
    "id": 96752798,
    "full_name": "Peter Smith",
    "email": "peter@gmail.com",
    "login": "Peter",
    "phone": "+73123555",
    "website": "https://mysite.com",
    "created_at": "2019-08-27T20:19:08Z",
    "updated_at": "2019-08-27T20:19:08Z",
    "last_request_at": null,
    "external_user_id": 1236672,
    "facebook_id": "8887366",
    "blob_id": null,
    "custom_data": "lead of marketing team",
    "age_over16": false,
    "allow_statistics_analysis": false,
    "allow_sales_activities": false,
    "parents_contacts": "",
    "user_tags": "marketing,seo"
  }
}
I