Skip to main content
Version: FINAL-1.0.0

Authentication

postapi.bunnystudio.com/users/auth

This endpoint returns the authentication token that you will need to use on all endpoints that require authentication, as shown on the Authentication page.

Requirements​

Authentication
None
Scope

Request body​

email
string
Email of your account on Bunny Studio platform
password
string
Current password to access your Bunny Studio account

Request example​

 curl --request POST \ 
--url https://api.bunnystudio.com/users/auth \
--header "Content-Type: application/json" \
--data '{
"email": "myuser@myemail.com",
"password": "mypassword",
}'

Response format​

token
string
Encripted token of the authenticated user

Response example​

  {
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2Nzc2MzYGR5DG4cCI6MTY4NTQxMjk5MiwiZGF0YSI6eyJpZCI6IjUzEETFSSGiOjB9.bamysdSSeGfZA-MXedjOC9QcHRehfoOLCem57EBh5ahw4TM8SThgjldaBhDloZkkUCLANayqNRVyJiJVGoi_wQ"
}

Error responses​

401 User not found​

{
status: 401,
type: 'USER_NOT_FOUND',
message: 'Please use a correct email and password',
}

401 User not API enabled​

{
status: 401,
type: 'USER_NOT_API_ENABLED',
message: 'The user doesn't have API feature enabled',
}

422 Password required​

{
status: 422,
type: 'PASSWORD_REQUIRED',
message: 'The field "password" is required',
}

422 Email required​

{
status: 422,
type: 'EMAIL_REQUIRED',
message: 'The field "email" is required',
}

422 Not valid email​

{
status: 422,
type: 'EMAIL_REQUIRED_NOT_VALID',
message: 'The field "email" must be a valid email',
}