Skip to content
Get started

Create user

client.users.create(UserCreateParams { id, email, firstName, 5 more } body?, RequestOptionsoptions?): User { id, email, firstName, 5 more }
POST/user

This can only be done by the logged in user.

ParametersExpand Collapse
body: UserCreateParams { id, email, firstName, 5 more }
id?: number
formatint64
email?: string
firstName?: string
lastName?: string
password?: string
phone?: string
username?: string
userStatus?: number

User Status

formatint32
ReturnsExpand Collapse
User { id, email, firstName, 5 more }
id?: number
formatint64
email?: string
firstName?: string
lastName?: string
password?: string
phone?: string
username?: string
userStatus?: number

User Status

formatint32

Create user

import RpTestDocs1 from 'rp-test-docs-1';

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

const user = await client.users.create();

console.log(user.id);
{
  "id": 10,
  "email": "john@email.com",
  "firstName": "John",
  "lastName": "James",
  "password": "12345",
  "phone": "12345",
  "username": "theUser",
  "userStatus": 1
}
Returns Examples
{
  "id": 10,
  "email": "john@email.com",
  "firstName": "John",
  "lastName": "James",
  "password": "12345",
  "phone": "12345",
  "username": "theUser",
  "userStatus": 1
}