430 lines
11 KiB
YAML
Raw Normal View History

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:
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:
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:
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
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:
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:
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
/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-02 19:41:49 +02:00
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2022-06-01 23:12:16 +02:00
/auth/reset-password:
post:
tags:
- Users-Permissions - Auth
summary: Rest user password
2022-06-02 19:41:49 +02:00
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
password:
type: string
passwordConfirmation:
type: string
code:
type: string
example:
password: Test1234
passwordConfirmation: Test1234
code: zertyoaizndoianzodianzdonaizdoinaozdnia
responses:
2022-06-02 19:41:49 +02:00
200:
description: Returns a jwt token and user info
content:
application/json:
schema:
$ref: '#/components/schemas/Users-Permissions-UserRegistration'
default:
2022-06-02 19:41:49 +02:00
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2022-06-01 23:12:16 +02:00
/auth/email-confirmation:
get:
tags:
- Users-Permissions - Auth
summary: Confirm user email
2022-06-02 19:41:49 +02:00
parameters:
- in: query
name: confirmation
type: string
description: confirmation token received by email
responses:
2022-06-02 19:41:49 +02:00
301:
description: Redirects to the configure email confirmation redirect url
default:
2022-06-02 19:41:49 +02:00
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2022-06-01 23:12:16 +02:00
/auth/send-email-confirmation:
post:
tags:
- Users-Permissions - Auth
summary: Send confirmation email
2022-06-02 19:41:49 +02:00
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
responses:
2022-06-02 19:41:49 +02:00
200:
description: Returns email and boolean to confirm email was sent
content:
application/json:
schema:
type: object
properties:
email:
type: string
sent:
type: enum
enum: [true]
default:
2022-06-02 19:41:49 +02:00
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2022-06-01 23:12:16 +02:00
/users-permissions/permissions:
get:
tags:
- Users-Permissions - Users & Roles
2022-06-02 19:41:49 +02:00
summary: Get default generated permissions
responses:
2022-06-02 19:41:49 +02:00
200:
description: Returns the permissions tree
content:
application/json:
schema:
type: object
properties:
permissions:
$ref: '#/components/schemas/Users-Permissions-PermissionsTree'
example:
permissions:
api::content-type.content-type:
controllers:
controllerA:
find:
enabled: false
policy: ''
findOne:
enabled: false
policy: ''
create:
enabled: false
policy: ''
controllerB:
find:
enabled: false
policy: ''
findOne:
enabled: false
policy: ''
create:
enabled: false
policy: ''
default:
2022-06-02 19:41:49 +02:00
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
2022-06-01 23:12:16 +02:00
/users-permissions/roles:
get:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
post:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
/users-permissions/roles/{id}:
2022-06-01 23:12:16 +02:00
get:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
/users-permissions/roles/{role}:
2022-06-01 23:12:16 +02:00
put:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
delete:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
/users:
get:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
post:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
/users/{id}:
get:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
put:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
delete:
tags:
- Users-Permissions - Users & Roles
responses:
204:
description: Successfull deletion
2022-06-01 23:12:16 +02:00
/users/me:
get:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
/users/count:
get:
tags:
- Users-Permissions - Users & Roles
responses:
default:
description: 'Success'
2022-06-01 23:12:16 +02:00
components:
schemas:
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-02 19:41:49 +02:00
Users-Permissions-PermissionsTree:
type: object
additionalProperties:
type: object
description: every api
properties:
controllers:
description: every controller of the api
type: object
additionalProperties:
type: object
additionalProperties:
description: every action of every controller
type: object
properties:
enabled:
type: boolean
policy:
type: string
2022-06-01 23:12:16 +02:00
parameters:
responses: