Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: API spec for user creation on user dashboard #127

Merged
merged 4 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 219 additions & 0 deletions api_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,225 @@ paths:
enum:
- Method not supported

rishabhpoddar marked this conversation as resolved.
Show resolved Hide resolved
/<tenantId>/dashboard/api/user/create/emailpassword:
post:
tags:
- User Creation
summary: Creates a new emailpassword user.
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
type: string
password:
type: string
responses:
200:
description: signup response
content:
application/json:
schema:
oneOf:
- type: object
properties:
status:
type: string
default: "OK"
user:
$ref: "#/components/schemas/authRecipeUser"
recipeUserId:
$ref: "#/components/schemas/userId"
- type: object
properties:
status:
type: string
default: "EMAIL_ALREADY_EXISTS_ERROR"
- type: object
properties:
status:
type: string
default: "FEATURE_NOT_ENABLED_ERROR"

/<tenantId>/dashboard/api/user/create/passwordless:
post:
tags:
- User Creation
summary: Creates a new passwordless user
requestBody:
content:
application/json:
schema:
oneOf:
- type: object
properties:
email:
$ref: "#/components/schemas/email"
example:
email: "[email protected]"
required:
- email
- type: object
properties:
phoneNumber:
$ref: "#/components/schemas/phoneNumber"
required:
- phoneNumber
rishabhpoddar marked this conversation as resolved.
Show resolved Hide resolved
responses:
200:
description: signup response
content:
application/json:
schema:
oneOf:
- type: object
properties:
status:
type: string
default: "OK"
createdNewRecipeUser:
type: boolean
default: true
user:
$ref: "#/components/schemas/authRecipeUser"
recipeUserId:
$ref: "#/components/schemas/userId"
- type: object
properties:
status:
type: string
default: "FEATURE_NOT_ENABLED_ERROR"
/<tenantId>/dashboard/api/login-methods:
get:
tags:
- Login Methods
summary: Gets all the available login methods for a tenant.
responses:
200:
description: login methods response.
content:
application/json:
schema:
type: object
properties:
status:
type: string
default: "OK"
loginMethods:
type: array
items:
oneOf:
- type: object
properties:
methodType:
type: string
default: "passwordless"
contactMethod:
type: string
enum: [PHONE, EMAIL, EMAIL_OR_PHONE]
- type: object
properties:
methodType:
type: string
default: "emailpassword"
- type: object
properties:
methodType:
type: string
default: "thirdparty"

components:
schemas:
authRecipeUser:
type: object
properties:
id:
$ref: "#/components/schemas/userId"
isPrimaryUser:
type: boolean
example: true
tenantIds:
type: array
items:
$ref: "#/components/schemas/tenantId"
timeJoined:
$ref: "#/components/schemas/timeJoined"
emails:
type: array
items:
$ref: "#/components/schemas/email"
phoneNumbers:
type: array
items:
$ref: "#/components/schemas/phoneNumber"
thirdParty:
type: array
items:
type: object
properties:
id:
$ref: "#/components/schemas/thirdPartyId"
userId:
$ref: "#/components/schemas/thirdPartyUserId"
loginMethods:
type: array
items:
type: object
properties:
tenantIds:
type: array
items:
$ref: "#/components/schemas/tenantId"
recipeUserId:
$ref: "#/components/schemas/userId"
verified:
type: boolean
example: true
timeJoined:
$ref: "#/components/schemas/timeJoined"
recipeId:
$ref: "#/components/schemas/recipeId"
email:
$ref: "#/components/schemas/email"
phoneNumber:
$ref: "#/components/schemas/phoneNumber"
thirdParty:
type: object
properties:
id:
$ref: "#/components/schemas/thirdPartyId"
userId:
$ref: "#/components/schemas/thirdPartyUserId"
recipeId:
type: string
enum:
- emailpassword
- passwordless
- thirdparty
thirdPartyId:
type: string
example: google
thirdPartyUserId:
type: string
example: 106347997792363865062
email:
type: string
example: [email protected]
userId:
type: string
example: fa7a0841-b533-4478-95533-0fde890c3483
timeJoined:
type: number
example: 1623918032231
phoneNumber:
type: string
example: "+14155552671"
tenantId:
type: string
example: "customer1"

servers:
# Added by API Auto Mocking Plugin
- description: SwaggerHub API Auto Mocking
Expand Down
Loading