Skip to main content

Create User (POST /user)

Register a new end-user under your client account.

List Users (GET /user)

Get paginated list of all users under your client account.

Get User (GET /user/:userId)

Fetch full profile details for a specific user.

Create User

POST /v1/user
curl -X POST https://api.useonion.xyz/v1/user \
  -H "x-api-key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": "+1234567890",
    "dob": "1990-01-01"
  }'
  • x-api-key (header): Active API key for authentication

Body

fieldtyperequireddescription
emailstringyesEmail address (unique)
firstNamestringyesFirst/given name
lastNamestringyesSurname/family name
phoneNumberstringyesE.164 formatted mobile number
dobstringyesDate of birth (YYYY-MM-DD)

Response: 201 Created

{
  "id": "user-id",
  "createdAt": "2025-05-05T12:34:56.789Z",
  "updatedAt": "2025-05-05T12:34:56.789Z",
  "firstName": "John",
  "lastName": "Doe",
  "phoneNumber": "+1234567890",
  "email": "[email protected]",
  "clientId": "client-id"
}

Errors

codepayload
400{ "error": "A user with this email already exists" }

List Users

GET /v1/user Get a paginated list of all users under your client account.
curl -X GET "https://api.useonion.xyz/v1/user?page=1&limit=10" \
  -H "x-api-key: sk_live_..."
  • x-api-key (header): Active API key for authentication

Query Parameters

fieldtypedefaultdescription
pagenumber1Page number for pagination
limitnumber10Number of users per page

Response: 200 OK

[
  {
    "id": "user-id-1",
    "createdAt": "2025-05-05T12:34:56.789Z",
    "updatedAt": "2025-05-05T12:34:56.789Z",
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": "+1234567890",
    "email": "[email protected]",
    "clientId": "client-id"
  },
  {
    "id": "user-id-2",
    "createdAt": "2025-05-05T12:30:00.000Z",
    "updatedAt": "2025-05-05T12:30:00.000Z",
    "firstName": "Jane",
    "lastName": "Smith",
    "phoneNumber": "+1987654321",
    "email": "[email protected]",
    "clientId": "client-id"
  }
]

Get User

GET /v1/user/:userId
curl -X GET https://api.useonion.xyz/v1/user/{userId} \
  -H "x-api-key: sk_live_..."
  • x-api-key (header): Active API key for authentication

Path Parameters

  • userId (path): User UUID

Response: 200 OK

{
  "id": "user-id",
  "createdAt": "2025-05-05T12:34:56.789Z",
  "updatedAt": "2025-05-05T12:34:56.789Z",
  "firstName": "John",
  "lastName": "Doe",
  "phoneNumber": "+1234567890",
  "email": "[email protected]",
  "clientId": "client-id"
}

Errors

codepayload
404{ "error": "User not found" }