Machete Auth MicroService API documentation
https://auth-api.machete.com/
Sign In User
Init user session in the system
post /sign-in
Init user session in the system
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Sign in user",
"description": "Authenticate user on the system",
"type": "object",
"additionalProperties": false,
"properties": {
"email": {
"description": "The email of the user",
"type": "string",
"format": "email"
},
"password": {
"description": "The password of the user",
"type": "string",
"pattern": "(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,50}"
}
},
"required": ["email","password"]
}
Example:
{
"email": "prueba@machete.com",
"password": "S3creta!"
}
HTTP status code 200
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Sign in user response",
"description": "Retrive the user information and session",
"type": "object",
"additionalProperties": false,
"properties": {
"payload": {
"type": "object",
"additionalProperties": false,
"properties": {
"email": {
"description": "The user email",
"type": "string",
"format": "email"
},
"token": {
"description": "Session token",
"type": "string"
},
"fullName": {
"description": "Person full name",
"type": "string"
},
"firstName": {
"description": "Person first name",
"type": "string"
},
"lastName": {
"description": "Person last name",
"type": "string"
},
"emailVerified": {
"description": "If the user already verified the email",
"type": "boolean"
}
},
"required": [
"user",
"token",
"fullName",
"firstName",
"lastName",
"emailVerified"
]
}
},
"required": [
"payload"
]
}
Example:
{
"payload": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY2hhZWxAYXZhbnR0aWEuY29tIiwiaWF0IjoxNTQwNzYzMzU3LCJleHAiOjE1NDA4NDk3NTd9.PE2TRKcdRHGK01cSjOrGvUjYxxdFtlSWaYexBAUJZlo",
"fullName": "Michael Villalba",
"firstName": "Michael",
"lastName": "Villalba",
"email": "michael@machete.com",
"emailVerified": true
}
}
Sign Up Users
Create new user
post /sign-up
Create new user
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Make user",
"description": "Insert a new user in the database",
"type": "object",
"additionalProperties": false,
"properties": {
"firstName": {
"description": "The first name of the person's",
"type": "string",
"minLength": 5,
"maxLength": 50
},
"lastName": {
"description": "The last name of the person's",
"type": "string",
"minLength": 5,
"maxLength": 50
},
"email": {
"description": "The email of the user",
"type": "string",
"format": "email"
},
"password": {
"description": "The password of the user",
"type": "string",
"pattern": "(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,50}"
}
},
"required": [
"firstName",
"lastName",
"email",
"password"
]
}
Example:
{
"firstName": "Fulanito",
"lastName": "De Tal",
"email": "prueba@machete.com",
"password": "S3creta!"
}
HTTP status code 201
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Sign up user response",
"description": "Retrive the user information and session if the user is inserted",
"type": "object",
"additionalProperties": false,
"properties": {
"payload": {
"type": "object",
"additionalProperties": false,
"properties": {
"email": {
"description": "The user email",
"type": "string",
"format": "email"
},
"token": {
"description": "Session token",
"type": "string"
},
"fullName": {
"description": "Person full name",
"type": "string"
},
"firstName": {
"description": "Person first name",
"type": "string"
},
"lastName": {
"description": "Person last name",
"type": "string"
},
"emailVerified": {
"description": "If the user already verified the email",
"type": "boolean"
}
},
"required": [
"user",
"token",
"fullName",
"firstName",
"lastName",
"emailVerified"
]
}
},
"required": [
"payload"
]
}
Example:
{
"payload": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY2hhZWxAYXZhbnR0aWEuY29tIiwiaWF0IjoxNTQwNzYzMzU3LCJleHAiOjE1NDA4NDk3NTd9.PE2TRKcdRHGK01cSjOrGvUjYxxdFtlSWaYexBAUJZlo",
"fullName": "Michael Villalba",
"firstName": "Michael",
"lastName": "Villalba",
"email": "michael@machete.com",
"emailVerified": true
}
}
Reset user password
Create new user password
post /password-recovery
Create new user password
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Password Recovery",
"description": "Replace old password",
"type": "object",
"additionalProperties": false,
"properties": {
"token": {
"description": "Password recovery token",
"type": "string"
},
"password": {
"description": "The password of the user",
"type": "string",
"pattern": "(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,50}"
}
},
"required": [
"password",
"token"
]
}
Example:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNTQ1NTM5NjQ4LCJleHAiOjE1NDU2MjYwNDh9.mWhNeDwz449AbL2eJ41i12pFHx39d2ri30aq8ep-34I",
"password": "S3creta!"
}
HTTP status code 201
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Recovery Password Response",
"description": "Replace password and retrive session",
"type": "object",
"additionalProperties": false,
"properties": {
"payload": {
"type": "object",
"additionalProperties": false,
"properties": {
"email": {
"description": "The user email",
"type": "string",
"format": "email"
},
"token": {
"description": "Session token",
"type": "string"
},
"fullName": {
"description": "Person full name",
"type": "string"
},
"firstName": {
"description": "Person first name",
"type": "string"
},
"lastName": {
"description": "Person last name",
"type": "string"
},
"emailVerified": {
"description": "If the user already verified the email",
"type": "boolean"
}
},
"required": [
"user",
"token",
"fullName",
"firstName",
"lastName",
"emailVerified"
]
}
},
"required": [
"payload"
]
}
Example:
{
"payload": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY2hhZWxAYXZhbnR0aWEuY29tIiwiaWF0IjoxNTQwNzYzMzU3LCJleHAiOjE1NDA4NDk3NTd9.PE2TRKcdRHGK01cSjOrGvUjYxxdFtlSWaYexBAUJZlo",
"fullName": "Michael Villalba",
"firstName": "Michael",
"lastName": "Villalba",
"email": "michael@machete.com",
"emailVerified": true
}
}
Init recovery password flow
Send email with revoery password token
post /forgotten-password
Send email with revoery password token
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Forgotten Password",
"description": "Send password recovery token",
"type": "object",
"additionalProperties": false,
"properties": {
"email": {
"description": "The email of the user",
"type": "string",
"format": "email"
}
},
"required": ["email"]
}
Example:
{
"email": "prueba@machete.com"
}
HTTP status code 201
Body
Media type: application/json
Type: Can not resolve forgotten-password/post-response-201-schema.json
Example:
Can not resolve forgotten-password/post-response-201-example.jsonValidate Session
Validate if the current session of the user it's ok and get user info
Some requests require authentication.
get /validate/session
Some requests require authentication.
Headers
- authorization: required (string)
Access Token
Example:
5757gh76
HTTP status code 200
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Sign in user response",
"description": "Retrive the user information and session",
"type": "object",
"additionalProperties": false,
"properties": {
"payload": {
"type": "object",
"additionalProperties": false,
"properties": {
"email": {
"description": "The user email",
"type": "string",
"format": "email"
},
"token": {
"description": "Session token",
"type": "string"
},
"fullName": {
"description": "Person full name",
"type": "string"
},
"firstName": {
"description": "Person first name",
"type": "string"
},
"lastName": {
"description": "Person last name",
"type": "string"
},
"emailVerified": {
"description": "If the user already verified the email",
"type": "boolean"
}
},
"required": [
"user",
"token",
"fullName",
"firstName",
"lastName",
"emailVerified"
]
}
},
"required": [
"payload"
]
}
Example:
{
"payload": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY2hhZWxAYXZhbnR0aWEuY29tIiwiaWF0IjoxNTQwNzYzMzU3LCJleHAiOjE1NDA4NDk3NTd9.PE2TRKcdRHGK01cSjOrGvUjYxxdFtlSWaYexBAUJZlo",
"fullName": "Michael Villalba",
"firstName": "Michael",
"lastName": "Villalba",
"email": "michael@machete.com",
"emailVerified": true
}
}
Verify the email of the user
Verify the email of the user
Resend email verify token