2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- name: 'Users-Permissions - Auth'
|
|
|
|
description: 'Authentication endpoints'
|
|
|
|
externalDocs:
|
|
|
|
description: 'Find out more'
|
|
|
|
url: 'https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html'
|
|
|
|
|
|
|
|
- name: 'Users-Permissions - Users & Roles'
|
|
|
|
description: 'Users, roles, and permissions endpoints'
|
|
|
|
externalDocs:
|
|
|
|
description: 'Find out more'
|
|
|
|
url: 'https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html'
|
|
|
|
|
2022-06-01 23:12:16 +02:00
|
|
|
paths:
|
|
|
|
'/connect/(.*)':
|
|
|
|
get:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Login with a provider
|
|
|
|
description: Redirects to provider login before being redirect to /auth/{provider}/callback
|
2022-06-01 23:12:16 +02:00
|
|
|
responses:
|
|
|
|
301:
|
2022-06-02 10:22:20 +02:00
|
|
|
description: Redirect response
|
|
|
|
default:
|
|
|
|
description: Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Error'
|
2022-06-01 23:12:16 +02:00
|
|
|
/auth/local:
|
|
|
|
post:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Local login
|
|
|
|
description: Returns a jwt token and user info
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
identifier:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
|
|
|
example:
|
|
|
|
identier: foobar
|
|
|
|
password: Test1234
|
|
|
|
required: true
|
2022-06-01 23:12:16 +02:00
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Connection
|
2022-06-02 10:22:20 +02:00
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Users-Permissions-UserRegistration'
|
|
|
|
default:
|
|
|
|
description: Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Error'
|
2022-06-01 23:12:16 +02:00
|
|
|
/auth/local/register:
|
|
|
|
post:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Register a user
|
|
|
|
description: Returns a jwt token and user info
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
username:
|
|
|
|
type: string
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
|
|
|
example:
|
|
|
|
username: foobar
|
|
|
|
email: foo.bar@strapi.io
|
|
|
|
password: Test1234
|
|
|
|
required: true
|
2022-06-01 23:12:16 +02:00
|
|
|
responses:
|
|
|
|
200:
|
2022-06-02 10:22:20 +02:00
|
|
|
description: Successfull registration
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Users-Permissions-UserRegistration'
|
|
|
|
default:
|
|
|
|
description: Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Error'
|
2022-06-01 23:12:16 +02:00
|
|
|
|
2022-06-02 10:22:20 +02:00
|
|
|
/auth/{provider}/callback:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Default Callback from provider auth
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Returns a jwt token and user info
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Users-Permissions-UserRegistration'
|
|
|
|
default:
|
|
|
|
description: Error
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Error'
|
|
|
|
|
|
|
|
/auth/forgot-password:
|
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Send rest password email
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
example:
|
|
|
|
email: foo.bar@strapi.io
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Returns ok
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
ok:
|
|
|
|
type: enum
|
|
|
|
enum: [true]
|
2022-06-01 23:12:16 +02:00
|
|
|
/auth/reset-password:
|
2022-06-02 10:22:20 +02:00
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Rest user password
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
/auth/email-confirmation:
|
2022-06-02 10:22:20 +02:00
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Confirm user email
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
/auth/send-email-confirmation:
|
2022-06-02 10:22:20 +02:00
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- Users-Permissions - Auth
|
|
|
|
summary: Send confirmation email
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
|
|
|
|
/users-permissions/permissions:
|
|
|
|
get:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
/users-permissions/roles:
|
|
|
|
get:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
post:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
|
|
|
/users-permissions/roles/{id}:
|
2022-06-01 23:12:16 +02:00
|
|
|
get:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
|
|
|
/users-permissions/roles/{role}:
|
2022-06-01 23:12:16 +02:00
|
|
|
put:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
delete:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
|
|
|
|
/users:
|
|
|
|
get:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
post:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
/users/{id}:
|
|
|
|
get:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
put:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
delete:
|
2022-06-02 10:22:20 +02:00
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
204:
|
|
|
|
description: Successfull deletion
|
2022-06-01 23:12:16 +02:00
|
|
|
/users/me:
|
2022-06-02 10:22:20 +02:00
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
/users/count:
|
2022-06-02 10:22:20 +02:00
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- Users-Permissions - Users & Roles
|
|
|
|
responses:
|
|
|
|
default:
|
|
|
|
description: 'Success'
|
2022-06-01 23:12:16 +02:00
|
|
|
|
|
|
|
components:
|
|
|
|
schemas:
|
2022-06-02 10:22:20 +02:00
|
|
|
# TODO: generate dynamically from the CT at startup
|
|
|
|
Users-Permissions-User:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
id:
|
|
|
|
type: integer
|
|
|
|
example: 1
|
|
|
|
username:
|
|
|
|
type: string
|
|
|
|
example: 'foo.bar'
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
example: 'foo.bar@strapi.io'
|
|
|
|
provider:
|
|
|
|
type: string
|
|
|
|
example: 'local'
|
|
|
|
confirmed:
|
|
|
|
type: boolean
|
|
|
|
example: true
|
|
|
|
blocked:
|
|
|
|
type: boolean
|
|
|
|
example: false
|
|
|
|
createdAt:
|
|
|
|
type: datetime
|
|
|
|
example: '2022-06-02T08:32:06.258Z'
|
|
|
|
updatedAt:
|
|
|
|
type: datetime
|
|
|
|
example: '2022-06-02T08:32:06.267Z'
|
|
|
|
|
|
|
|
Users-Permissions-UserRegistration:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
jwt:
|
|
|
|
type: string
|
|
|
|
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
|
|
|
|
user:
|
|
|
|
$ref: '#/components/schemas/Users-Permissions-User'
|
|
|
|
|
2022-06-01 23:12:16 +02:00
|
|
|
parameters:
|
|
|
|
responses:
|