Skip to content

Commit 7de116d

Browse files
committed
fix: document POST /admin/users
The endpoint is routed to adminUserCreate and documented in the README, but was missing from the spec. AdminCreateUserSchema mirrors AdminUserParams: UserSchema describes a response and cannot express password, password_hash, email_confirm, phone_confirm or ban_duration, so a client generated against it could not exercise the endpoint.
1 parent 5be1ace commit 7de116d

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

‎openapi.yaml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,31 @@ paths:
15611561
$ref: "#/components/responses/UnauthorizedResponse"
15621562
403:
15631563
$ref: "#/components/responses/ForbiddenResponse"
1564+
post:
1565+
summary: Create a user.
1566+
tags:
1567+
- admin
1568+
security:
1569+
- APIKeyAuth: []
1570+
AdminAuth: []
1571+
requestBody:
1572+
content:
1573+
application/json:
1574+
schema:
1575+
$ref: "#/components/schemas/AdminCreateUserSchema"
1576+
responses:
1577+
200:
1578+
description: The user was created.
1579+
content:
1580+
application/json:
1581+
schema:
1582+
$ref: "#/components/schemas/UserSchema"
1583+
400:
1584+
$ref: "#/components/responses/BadRequestResponse"
1585+
401:
1586+
$ref: "#/components/responses/UnauthorizedResponse"
1587+
403:
1588+
$ref: "#/components/responses/ForbiddenResponse"
15641589

15651590
/admin/users/{userId}:
15661591
parameters:
@@ -3277,6 +3302,43 @@ components:
32773302
is_anonymous:
32783303
type: boolean
32793304

3305+
AdminCreateUserSchema:
3306+
type: object
3307+
description: Object describing the user to create. Either an email or a phone must be provided.
3308+
properties:
3309+
id:
3310+
type: string
3311+
format: uuid
3312+
description: Generated when omitted.
3313+
aud:
3314+
type: string
3315+
role:
3316+
type: string
3317+
email:
3318+
type: string
3319+
format: email
3320+
phone:
3321+
type: string
3322+
password:
3323+
type: string
3324+
description: Mutually exclusive with `password_hash`. A random password is generated when neither is given.
3325+
password_hash:
3326+
type: string
3327+
description: Mutually exclusive with `password`.
3328+
email_confirm:
3329+
type: boolean
3330+
description: Marks the email confirmed, skipping the confirmation email.
3331+
phone_confirm:
3332+
type: boolean
3333+
description: Marks the phone confirmed, skipping the confirmation SMS.
3334+
user_metadata:
3335+
type: object
3336+
app_metadata:
3337+
type: object
3338+
ban_duration:
3339+
type: string
3340+
description: Duration such as `24h` (units `ns`, `us`, `ms`, `s`, `m`, `h`), or `none`.
3341+
32803342
SAMLAttributeMappingSchema:
32813343
type: object
32823344
properties:

0 commit comments

Comments
 (0)