Authentication

Operations related to user authentication with PromptEasy.eu API.

Login

POST
https://api.prompteasy.eu/v1/login

Body

application/json
emailstringrequired
Example
foo@bar.invalid
passwordstringrequired
Example
V3rys3cr3tP@ssw0rd
rememberboolean
Example
true

Response

200OKAuth

Login successful

Response fields application/json
namestring
Example
John Doe
tokenstring

access token

aup_missingboolean

Indicates whether the user still needs to agree to the latest Acceptable Use Policy

Example
true
recovery_codesArray<RecoveryCode>

If user has finalised 2FA setup, auth object contains recovery codes too

Show child attributes
codestring
Example
1234-5678
used_atstring<date-time> | null
Example
null
202AcceptedTwoFactorSetup

Login credentials correct, 2FA setup started

Response fields application/json
messagestring
Example
Two-factor authentication setup required
qr_codestring

2FA setup QR code as SVG string

uristring

2FA uri

Example
otpauth://totp/PromptEasy.eu...
stringstring

2FA shared secret

Example
J64LMYRKWG43ZW2MP...
204No Content

Login credentials correct, waiting 2FA code next. Make same request but with 2fa_code

400Bad Request

Login credentials were correct but 2fa_code was wrong

401Unauthorized

Login credentials were incorrect

Authorization

ApiKeyAuthapiKey in header

Request password reset link

POST
https://api.prompteasy.eu/v1/forgot-password

Body

application/json
emailstringrequired
Example
foo@bar.invalid

Response

Password reset link sent

Response fields application/json
statusstring
Example
We have emailed your password reset link.
422Unprocessable EntityValidationError

Unprocessable Entity

Response fields application/json
messagestring
Example
Validation failed
Show child attributes
nameArray<string>

Authorization

ApiKeyAuthapiKey in header

Reset password with token

POST
https://api.prompteasy.eu/v1/reset-password/{token}

Body

application/json
emailstring<email>required
Example
foo@bar.invalid
passwordstringrequired
Example
V3rys3cr3tP@ssw0rdNew
password_confirmationstringrequired
Example
V3rys3cr3tP@ssw0rdNew

Parameters

tokenstringrequiredpath

The password reset token.

Response

200OKobject

Password reset successful

Response fields application/json
statusstring
Example
Password reset done
400Bad Requestobject

Error while resetting password

Response fields application/json
emailstring
Example
Error while resetting password
422Unprocessable EntityValidationError

Unprocessable Entity

Response fields application/json
messagestring
Example
Validation failed
Show child attributes
nameArray<string>

Authorization

ApiKeyAuthapiKey in header

Logout

POST
https://api.prompteasy.eu/v1/logout

Response

204No Content

No Content

Authorization

ApiKeyAuthapiKey in header
BearerAuthhttp (bearer)