These docs are for v1.0. Click to read the latest docs for v2.0.

Create User

Generates an identifier(user id)for the user to record sleep, and one can use this identifier to continuously manage the user's sleep.
The identifier of the generated user can be stored and managed in the appropriate storage of the customer for continuous use.

1. Request

2.1 URL

POST https://api.asleep.ai/ai/v1/users

2.2 Header

ParameterTypeRequiredDescription
x-api-keyStringOAPI Key

Example

curl "https://api.asleep.ai/ai/v1/users" -XPOST \
  -H "x-api-key: <YOUR_API_KEY>"

2. Response

2.1 201 Created

  • User Identifier Creation Successful

Body (result field)

FieldTypeDescription
user_idStringuser id
{
  "detail": "success",
  "result": {
    "user_id": "<USER_ID>"
  }
}