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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.