MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Authentication

APIs for managing authentication

Login

Authenticate a user and return a Sanctum token.

Example request:
curl --request POST \
    "http://localhost/api/v1/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/v1/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "gbailey@example.net",
    "password": "architecto"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/auth/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Example: gbailey@example.net

password   string     

Example: architecto

Logout

Revoke the current user's token.

Example request:
curl --request POST \
    "http://localhost/api/v1/auth/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/auth/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/auth/logout

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

User Management

APIs for managing users

Create User

Create a new user with roles.

Example request:
curl --request POST \
    "http://localhost/api/v1/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"firstName\": \"b\",
    \"lastName\": \"n\",
    \"email\": \"ashly64@example.com\",
    \"password\": \"pBNvYg\",
    \"status\": \"inactive\"
}"
const url = new URL(
    "http://localhost/api/v1/users"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "firstName": "b",
    "lastName": "n",
    "email": "ashly64@example.com",
    "password": "pBNvYg",
    "status": "inactive"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/users

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

firstName   string     

Must not be greater than 100 characters. Example: b

lastName   string     

Must not be greater than 100 characters. Example: n

email   string     

Must be a valid email address. Example: ashly64@example.com

password   string     

Must be at least 8 characters. Example: pBNvYg

status   string  optional    

Example: inactive

Must be one of:
  • active
  • inactive
  • suspended
roles   object  optional    

Update User

Update a user's details.

Example request:
curl --request PUT \
    "http://localhost/api/v1/users/16" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"firstName\": \"b\",
    \"lastName\": \"n\",
    \"status\": \"inactive\"
}"
const url = new URL(
    "http://localhost/api/v1/users/16"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "firstName": "b",
    "lastName": "n",
    "status": "inactive"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/v1/users/{id}

PATCH api/v1/users/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the user. Example: 16

Body Parameters

firstName   string  optional    

Must not be greater than 100 characters. Example: b

lastName   string  optional    

Must not be greater than 100 characters. Example: n

email   string  optional    
status   string  optional    

Example: inactive

Must be one of:
  • active
  • inactive
  • suspended

Delete User

Soft delete a user.

Example request:
curl --request DELETE \
    "http://localhost/api/v1/users/16" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/users/16"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/users/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the user. Example: 16