Skip to content
Get startedWebsite

Create user

client.users.create(UserCreateParams { email, first_name, last_name, 2 more } params, RequestOptionsoptions?): UserCreateResponse { status, user_id }
POST/api/v1/users

Create user

ParametersExpand Collapse
params: UserCreateParams { email, first_name, last_name, 2 more }
email: string

Body param

formatemail
first_name: string

Body param

last_name: string

Body param

password: string

Body param

formatpassword
xEnvironment: "sandbox" | "production"

Header param

One of the following:
"sandbox"
"production"
ReturnsExpand Collapse
UserCreateResponse { status, user_id }
status: string
user_id: string
formatuuid

Create user

import Rails from 'railsinfra';

const client = new Rails({
  apiKey: process.env['RAILS_API_KEY'], // This is the default and can be omitted
});

const user = await client.users.create({
  email: 'dev@stainless.com',
  first_name: 'first_name',
  last_name: 'last_name',
  password: 'password',
  'X-Environment': 'sandbox',
});

console.log(user.user_id);
{
  "status": "status",
  "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
Returns Examples
{
  "status": "status",
  "user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}