Introduction
API de gestión de usuarios, roles y permisos del sistema.
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
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Endpoints
POST api/v1/auth/keycloak/logout
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/v1/auth/keycloak/logout" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost:8000/api/v1/auth/keycloak/logout"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"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.
POST api/v1/roles
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/v1/roles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"b\",
\"description\": \"Et animi quos velit et fugiat.\",
\"role_type\": \"user\",
\"permissions\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost:8000/api/v1/roles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "b",
"description": "Et animi quos velit et fugiat.",
"role_type": "user",
"permissions": [
"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.
PUT api/v1/roles/{id}
requires authentication
Example request:
curl --request PUT \
"http://localhost:8000/api/v1/roles/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"b\",
\"description\": \"Et animi quos velit et fugiat.\",
\"role_type\": \"administrator\",
\"permissions\": [
\"architecto\"
]
}"
const url = new URL(
"http://localhost:8000/api/v1/roles/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "b",
"description": "Et animi quos velit et fugiat.",
"role_type": "administrator",
"permissions": [
"architecto"
]
};
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.
POST api/v1/roles/assign
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/v1/roles/assign" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",
\"role_name\": \"architecto\"
}"
const url = new URL(
"http://localhost:8000/api/v1/roles/assign"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user_id": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
"role_name": "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.
POST api/v1/roles/unassign
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/v1/roles/unassign" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"user_id\": \"6ff8f7f6-1eb3-3525-be4a-3932c805afed\",
\"role_name\": \"architecto\"
}"
const url = new URL(
"http://localhost:8000/api/v1/roles/unassign"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"user_id": "6ff8f7f6-1eb3-3525-be4a-3932c805afed",
"role_name": "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.
POST api/v1/users
requires authentication
Example request:
curl --request POST \
"http://localhost:8000/api/v1/users" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"gbailey@example.net\",
\"first_name\": \"m\",
\"last_name\": \"i\",
\"username\": \"y\",
\"password\": \"pBNvYg\",
\"enabled\": false,
\"email_verified\": false,
\"role_name\": \"architecto\",
\"cellphone\": \"ngzmiyvdljnikhwa\"
}"
const url = new URL(
"http://localhost:8000/api/v1/users"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "gbailey@example.net",
"first_name": "m",
"last_name": "i",
"username": "y",
"password": "pBNvYg",
"enabled": false,
"email_verified": false,
"role_name": "architecto",
"cellphone": "ngzmiyvdljnikhwa"
};
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.
PUT api/v1/users/{id}
requires authentication
Example request:
curl --request PUT \
"http://localhost:8000/api/v1/users/architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"gbailey@example.net\",
\"first_name\": \"m\",
\"last_name\": \"i\",
\"enabled\": true,
\"email_verified\": false,
\"role_name\": \"architecto\",
\"cellphone\": \"ngzmiyvdljnikhwa\"
}"
const url = new URL(
"http://localhost:8000/api/v1/users/architecto"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "gbailey@example.net",
"first_name": "m",
"last_name": "i",
"enabled": true,
"email_verified": false,
"role_name": "architecto",
"cellphone": "ngzmiyvdljnikhwa"
};
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.