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.

Endpoints

POST api/v1/auth/login

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\": \"+-0pBNvYgxwmi\\/#iw\"
}"
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": "+-0pBNvYgxwmi\/#iw"
};

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     

Must be at least 4 characters. Example: +-0pBNvYgxwmi/#iw

POST api/v1/auth/logout

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

GET api/v1/lookup/permissions

Example request:
curl --request GET \
    --get "http://localhost/api/v1/lookup/permissions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"search_words\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/v1/lookup/permissions"
);

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

let body = {
    "search_words": [
        "architecto"
    ]
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status": "error",
    "message": "Access denied",
    "data": null
}
 

Request      

GET api/v1/lookup/permissions

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

search_words   string[]  optional    

GET api/v1/lookup/users

Example request:
curl --request GET \
    --get "http://localhost/api/v1/lookup/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"search_words\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/v1/lookup/users"
);

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

let body = {
    "search_words": [
        "architecto"
    ]
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status": "error",
    "message": "Access denied",
    "data": null
}
 

Request      

GET api/v1/lookup/users

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

search_words   string[]  optional    

GET api/v1/roles

Example request:
curl --request GET \
    --get "http://localhost/api/v1/roles" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"architecto\",
    \"is_active\": 12,
    \"search_words\": [
        \"architecto\"
    ],
    \"page\": 22,
    \"size\": 67,
    \"sortBy\": \"bng-zmi_y\",
    \"orderBy\": \"asc\"
}"
const url = new URL(
    "http://localhost/api/v1/roles"
);

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

let body = {
    "name": "architecto",
    "is_active": 12,
    "search_words": [
        "architecto"
    ],
    "page": 22,
    "size": 67,
    "sortBy": "bng-zmi_y",
    "orderBy": "asc"
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status": "error",
    "message": "Access denied",
    "data": null
}
 

Request      

GET api/v1/roles

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string  optional    

Example: architecto

is_active   integer  optional    

Must be between -1 and 1. Example: 12

search_words   string[]  optional    
page   integer  optional    

Must be at least 1. Example: 22

size   integer  optional    

Must be at least 1. Example: 67

sortBy   string  optional    

Must contain only letters, numbers, dashes and underscores. Example: bng-zmi_y

orderBy   string  optional    

Example: asc

Must be one of:
  • asc
  • desc

POST api/v1/roles

Example request:
curl --request POST \
    "http://localhost/api/v1/roles" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"architecto\",
    \"permissions\": [
        {
            \"uuid\": \"a4855dc5-0acb-33c3-b921-f4291f719ca0\"
        }
    ]
}"
const url = new URL(
    "http://localhost/api/v1/roles"
);

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

let body = {
    "name": "architecto",
    "permissions": [
        {
            "uuid": "a4855dc5-0acb-33c3-b921-f4291f719ca0"
        }
    ]
};

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

Request      

POST api/v1/roles

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Example: architecto

permissions   object[]  optional    
uuid   string     

Must be a valid UUID. Example: a4855dc5-0acb-33c3-b921-f4291f719ca0

GET api/v1/roles/{uuid}

Example request:
curl --request GET \
    --get "http://localhost/api/v1/roles/6ff8f7f6-1eb3-3525-be4a-3932c805afed" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\"
}"
const url = new URL(
    "http://localhost/api/v1/roles/6ff8f7f6-1eb3-3525-be4a-3932c805afed"
);

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

let body = {
    "uuid": "6ff8f7f6-1eb3-3525-be4a-3932c805afed"
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status": "error",
    "message": "Access denied",
    "data": null
}
 

Request      

GET api/v1/roles/{uuid}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

Example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed

Body Parameters

uuid   string     

Must be a valid UUID. Example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed

PUT api/v1/roles/{uuid}

Example request:
curl --request PUT \
    "http://localhost/api/v1/roles/6ff8f7f6-1eb3-3525-be4a-3932c805afed" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",
    \"name\": \"architecto\",
    \"permissions\": [
        {
            \"uuid\": \"a4855dc5-0acb-33c3-b921-f4291f719ca0\"
        }
    ]
}"
const url = new URL(
    "http://localhost/api/v1/roles/6ff8f7f6-1eb3-3525-be4a-3932c805afed"
);

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

let body = {
    "uuid": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
    "name": "architecto",
    "permissions": [
        {
            "uuid": "a4855dc5-0acb-33c3-b921-f4291f719ca0"
        }
    ]
};

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

Request      

PUT api/v1/roles/{uuid}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

Example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed

Body Parameters

uuid   string     

Must be a valid UUID. Example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed

name   string     

Example: architecto

permissions   object[]  optional    
uuid   string     

Must be a valid UUID. The uuid of an existing record in the permissions table. Example: a4855dc5-0acb-33c3-b921-f4291f719ca0

PATCH api/v1/roles/{uuid}

Example request:
curl --request PATCH \
    "http://localhost/api/v1/roles/6ff8f7f6-1eb3-3525-be4a-3932c805afed" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"uuid\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",
    \"is_active\": false
}"
const url = new URL(
    "http://localhost/api/v1/roles/6ff8f7f6-1eb3-3525-be4a-3932c805afed"
);

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

let body = {
    "uuid": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
    "is_active": false
};

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

Request      

PATCH api/v1/roles/{uuid}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

uuid   string     

Example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed

Body Parameters

uuid   string     

Must be a valid UUID. Example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed

is_active   boolean     

Example: false

GET api/v1/test-permission

Example request:
curl --request GET \
    --get "http://localhost/api/v1/test-permission" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/test-permission"
);

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


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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "status": "error",
    "message": "Access denied",
    "data": null
}
 

Request      

GET api/v1/test-permission

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json