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
Endpoints for JWT authentication and session lifecycle.
Login and get tokens
Authenticate with email and password to receive an access token and refresh token.
Example request:
curl --request POST \
"http://localhost/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"user@example.com\",
\"password\": \"secret123\"
}"
const url = new URL(
"http://localhost/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "user@example.com",
"password": "secret123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Alice Johnson",
"email": "user@example.com",
"role": "manager",
"active": true,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
},
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"refresh_token": "abc123def456",
"token_type": "bearer",
"expires_in": 3600
}
Example response (401):
{
"message": "Invalid credentials"
}
Example response (403):
{
"message": "Account is inactive"
}
Example response (422):
{
"errors": {
"email": [
"The email field is required."
],
"password": [
"The password field is required."
]
}
}
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.
Refresh access token
requires authentication
Exchange a valid refresh token for a new access token and refresh token pair.
Example request:
curl --request POST \
"http://localhost/api/auth/refresh" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"refresh_token\": \"abc123def456\"
}"
const url = new URL(
"http://localhost/api/auth/refresh"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"refresh_token": "abc123def456"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Alice Johnson",
"email": "user@example.com",
"role": "manager",
"active": true,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
},
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"refresh_token": "newtoken123",
"token_type": "bearer",
"expires_in": 3600
}
Example response (401):
{
"message": "Invalid or expired refresh token"
}
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 current session
requires authentication
Invalidate a refresh token and end the active authenticated session.
Example request:
curl --request POST \
"http://localhost/api/auth/logout" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"refresh_token\": \"abc123def456\"
}"
const url = new URL(
"http://localhost/api/auth/logout"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"refresh_token": "abc123def456"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"message": "Logged out successfully"
}
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.
Capacity Planning
Get Individual Capacity
Calculate capacity for a specific team member in a given month.
Example request:
curl --request GET \
--get "http://localhost/api/capacity" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"month\": \"2026-02\",
\"team_member_id\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/capacity"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"month": "2026-02",
"team_member_id": "architecto"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"team_member_id": "550e8400-e29b-41d4-a716-446655440000",
"month": "2026-02",
"working_days": 20,
"person_days": 18.5,
"hours": 148,
"details": [
{
"date": "2026-02-02",
"availability": 1,
"is_pto": false
}
]
}
}
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.
Get Team Capacity
Summarize the combined capacity for all active team members in a month.
Example request:
curl --request GET \
--get "http://localhost/api/capacity/team" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"month\": \"2026-02\"
}"
const url = new URL(
"http://localhost/api/capacity/team"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"month": "2026-02"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"month": "2026-02",
"total_person_days": 180.5,
"total_hours": 1444,
"members": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Ada Lovelace",
"person_days": 18.5,
"hours": 148
}
]
}
}
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.
Get Possible Revenue
Estimate monthly revenue based on capacity hours and hourly rates.
Example request:
curl --request GET \
--get "http://localhost/api/capacity/revenue" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"month\": \"2026-02\"
}"
const url = new URL(
"http://localhost/api/capacity/revenue"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"month": "2026-02"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"month": "2026-02",
"possible_revenue": 21500.25,
"member_revenues": [
{
"team_member_id": "550e8400-e29b-41d4-a716-446655440000",
"team_member_name": "Ada Lovelace",
"hours": 148,
"hourly_rate": 150,
"revenue": 22200
}
]
}
}
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.
List Holidays
Retrieve holidays for a specific month or all holidays when no month is provided.
Example request:
curl --request GET \
--get "http://localhost/api/holidays" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"month\": \"2026-02\"
}"
const url = new URL(
"http://localhost/api/holidays"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"month": "2026-02"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"date": "2026-02-14",
"name": "Company Holiday",
"description": "Office closed"
}
]
}
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.
Create Holiday
Add a holiday and clear cached capacity data for the related month.
Example request:
curl --request POST \
"http://localhost/api/holidays" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"date\": \"2026-02-14\",
\"name\": \"Presidents\' Day\",
\"description\": \"Eius et animi quos velit et.\"
}"
const url = new URL(
"http://localhost/api/holidays"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"date": "2026-02-14",
"name": "Presidents' Day",
"description": "Eius et animi quos velit et."
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"date": "2026-02-14",
"name": "Presidents' Day",
"description": "Office closed"
}
}
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 Holiday
Remove a holiday and clear affected capacity caches.
Example request:
curl --request DELETE \
"http://localhost/api/holidays/550e8400-e29b-41d4-a716-446655440000" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/holidays/550e8400-e29b-41d4-a716-446655440000"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Holiday deleted"
}
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.
List PTO Requests
Fetch PTO requests for a team member, optionally constrained to a month.
Example request:
curl --request GET \
--get "http://localhost/api/ptos" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"team_member_id\": \"architecto\",
\"month\": \"2026-02\"
}"
const url = new URL(
"http://localhost/api/ptos"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"team_member_id": "architecto",
"month": "2026-02"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"team_member_id": "550e8400-e29b-41d4-a716-446655440000",
"start_date": "2026-02-10",
"end_date": "2026-02-12",
"status": "pending",
"reason": "Family travel"
}
]
}
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.
Request PTO
Create a PTO request for a team member and keep it in pending status.
Example request:
curl --request POST \
"http://localhost/api/ptos" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"team_member_id\": \"550e8400-e29b-41d4-a716-446655440000\",
\"start_date\": \"2026-02-10\",
\"end_date\": \"2026-02-12\",
\"reason\": \"architecto\"
}"
const url = new URL(
"http://localhost/api/ptos"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"team_member_id": "550e8400-e29b-41d4-a716-446655440000",
"start_date": "2026-02-10",
"end_date": "2026-02-12",
"reason": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"team_member_id": "550e8400-e29b-41d4-a716-446655440000",
"start_date": "2026-02-10",
"end_date": "2026-02-12",
"status": "pending",
"reason": "Family travel"
}
}
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.
Approve PTO
Approve a pending PTO request and refresh the affected capacity caches.
Example request:
curl --request PUT \
"http://localhost/api/ptos/550e8400-e29b-41d4-a716-446655440001/approve" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/ptos/550e8400-e29b-41d4-a716-446655440001/approve"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"status": "approved"
}
}
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.
Projects
Endpoints for managing projects.
Get all project types
requires authentication
Example request:
curl --request GET \
--get "http://localhost/api/projects/types" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/projects/types"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"name": "Project"
},
{
"id": 2,
"name": "Support"
},
{
"id": 3,
"name": "Engagement"
}
]
}
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.
Get all project statuses
requires authentication
Example request:
curl --request GET \
--get "http://localhost/api/projects/statuses" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/projects/statuses"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": 1,
"name": "Pre-sales",
"order": 1
},
{
"id": 2,
"name": "SOW Approval",
"order": 2
},
{
"id": 3,
"name": "Gathering Estimates",
"order": 3
}
]
}
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.
List all projects
requires authentication
Get a list of all projects with optional filtering by status and type.
Example request:
curl --request GET \
--get "http://localhost/api/projects?status_id=1&type_id=2" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/projects"
);
const params = {
"status_id": "1",
"type_id": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "PROJ-001",
"title": "Client Dashboard Redesign",
"status": {
"id": 1,
"name": "Pre-sales"
},
"type": {
"id": 2,
"name": "Support"
},
"approved_estimate": "120.00",
"forecasted_effort": {
"2024-02": 40,
"2024-03": 60,
"2024-04": 20
},
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
}
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.
Create a new project
requires authentication
Create a new project with code, title, and type.
Example request:
curl --request POST \
"http://localhost/api/projects" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"PROJ-001\",
\"title\": \"Client Dashboard Redesign\",
\"type_id\": 1
}"
const url = new URL(
"http://localhost/api/projects"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"code": "PROJ-001",
"title": "Client Dashboard Redesign",
"type_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "PROJ-001",
"title": "Client Dashboard Redesign",
"status": {
"id": 1,
"name": "Pre-sales"
},
"type": {
"id": 1,
"name": "Project"
}
}
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"code": [
"Project code must be unique"
],
"title": [
"The title field is required."
]
}
}
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.
Get a single project
requires authentication
Get details of a specific project by ID.
Example request:
curl --request GET \
--get "http://localhost/api/projects/550e8400-e29b-41d4-a716-446655440000" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/projects/550e8400-e29b-41d4-a716-446655440000"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "PROJ-001",
"title": "Client Dashboard Redesign",
"status": {
"id": 1,
"name": "Pre-sales"
},
"type": {
"id": 1,
"name": "Project"
},
"approved_estimate": "120.00",
"forecasted_effort": {
"2024-02": 40,
"2024-03": 60
}
}
}
Example response (404):
{
"message": "Project not found"
}
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 a project
requires authentication
Update details of an existing project.
Example request:
curl --request PUT \
"http://localhost/api/projects/550e8400-e29b-41d4-a716-446655440000" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"PROJ-002\",
\"title\": \"Updated Title\",
\"type_id\": 2
}"
const url = new URL(
"http://localhost/api/projects/550e8400-e29b-41d4-a716-446655440000"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"code": "PROJ-002",
"title": "Updated Title",
"type_id": 2
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "PROJ-002",
"title": "Updated Title",
"type": {
"id": 2,
"name": "Support"
}
}
}
Example response (404):
{
"message": "Project not found"
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"type_id": [
"The selected type id is invalid."
]
}
}
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 a project
requires authentication
Delete a project. Cannot delete if project has allocations or actuals.
Example request:
curl --request DELETE \
"http://localhost/api/projects/550e8400-e29b-41d4-a716-446655440000" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/projects/550e8400-e29b-41d4-a716-446655440000"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Project deleted successfully"
}
Example response (404):
{
"message": "Project not found"
}
Example response (422):
{
"message": "Cannot delete project with allocations"
}
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.
Transition project status
requires authentication
Transition project to a new status following the state machine rules.
Example request:
curl --request PUT \
"http://localhost/api/projects/architecto/status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"status_id\": 2
}"
const url = new URL(
"http://localhost/api/projects/architecto/status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"status_id": 2
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": {
"id": 2,
"name": "SOW Approval"
}
}
}
Example response (404):
{
"message": "Project not found"
}
Example response (422):
{
"message": "Cannot transition from Pre-sales to Done"
}
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.
Set approved estimate
requires authentication
Set the approved billable hours estimate for a project.
Example request:
curl --request PUT \
"http://localhost/api/projects/architecto/estimate" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"approved_estimate\": 120
}"
const url = new URL(
"http://localhost/api/projects/architecto/estimate"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"approved_estimate": 120
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"approved_estimate": "120.00"
}
}
Example response (404):
{
"message": "Project not found"
}
Example response (422):
{
"message": "Approved estimate must be greater than 0"
}
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.
Set forecasted effort
requires authentication
Set the month-by-month forecasted effort breakdown.
Example request:
curl --request PUT \
"http://localhost/api/projects/architecto/forecast" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"forecasted_effort\": {
\"2024-02\": 40,
\"2024-03\": 60
}
}"
const url = new URL(
"http://localhost/api/projects/architecto/forecast"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"forecasted_effort": {
"2024-02": 40,
"2024-03": 60
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"forecasted_effort": {
"2024-02": 40,
"2024-03": 60
}
}
}
Example response (404):
{
"message": "Project not found"
}
Example response (422):
{
"message": "Forecasted effort exceeds approved estimate by more than 5%"
}
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.
Team Members
Endpoints for managing team members.
List all team members
requires authentication
Get a list of all team members with optional filtering by active status.
Example request:
curl --request GET \
--get "http://localhost/api/team-members?active=1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/team-members"
);
const params = {
"active": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "John Doe",
"role": {
"id": 1,
"name": "Backend Developer"
},
"hourly_rate": "150.00",
"active": true,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
]
}
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.
Create a new team member
requires authentication
Create a new team member with name, role, and hourly rate.
Example request:
curl --request POST \
"http://localhost/api/team-members" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"John Doe\",
\"role_id\": 1,
\"hourly_rate\": \"150.00\",
\"active\": true
}"
const url = new URL(
"http://localhost/api/team-members"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "John Doe",
"role_id": 1,
"hourly_rate": "150.00",
"active": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "John Doe",
"role": {
"id": 1,
"name": "Backend Developer"
},
"hourly_rate": "150.00",
"active": true,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"name": [
"The name field is required."
],
"hourly_rate": [
"Hourly rate must be greater than 0"
]
}
}
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.
Get a single team member
requires authentication
Get details of a specific team member by ID.
Example request:
curl --request GET \
--get "http://localhost/api/team-members/550e8400-e29b-41d4-a716-446655440000" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/team-members/550e8400-e29b-41d4-a716-446655440000"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "John Doe",
"role": {
"id": 1,
"name": "Backend Developer"
},
"hourly_rate": "150.00",
"active": true,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
}
Example response (404):
{
"message": "Team member not found"
}
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 a team member
requires authentication
Update details of an existing team member.
Example request:
curl --request PUT \
"http://localhost/api/team-members/550e8400-e29b-41d4-a716-446655440000" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"John Doe\",
\"role_id\": 1,
\"hourly_rate\": \"175.00\",
\"active\": false
}"
const url = new URL(
"http://localhost/api/team-members/550e8400-e29b-41d4-a716-446655440000"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "John Doe",
"role_id": 1,
"hourly_rate": "175.00",
"active": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "John Doe",
"role": {
"id": 1,
"name": "Backend Developer"
},
"hourly_rate": "175.00",
"active": false,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T11:00:00.000000Z"
}
}
Example response (404):
{
"message": "Team member not found"
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"hourly_rate": [
"Hourly rate must be greater than 0"
]
}
}
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 a team member
requires authentication
Delete a team member. Cannot delete if member has allocations or actuals.
Example request:
curl --request DELETE \
"http://localhost/api/team-members/550e8400-e29b-41d4-a716-446655440000" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://localhost/api/team-members/550e8400-e29b-41d4-a716-446655440000"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Team member deleted successfully"
}
Example response (404):
{
"message": "Team member not found"
}
Example response (422):
{
"message": "Cannot delete team member with active allocations",
"suggestion": "Consider deactivating the team member instead"
}
Example response (422):
{
"message": "Cannot delete team member with historical data",
"suggestion": "Consider deactivating the team member instead"
}
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.