Documentation for the INCIDENsly 𝒘ebApp API.
This API provides endpoints for managing incidents, comments, tags, and user administration. Authentication is handled via OAuth2 (Bearer token). Use the /login endpoint to obtain your token. All responses are returned in JSON format.
Authorization: Bearer {YOUR_TOKEN}) for all subsequent requests to protected endpoints.user — Can manage their own incidents, comments, and tags.admin — has additional access to user management.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 for user registration, login, logout and profile view.
Create a new user account and returns an OAuth token.
curl --request POST \
"http://127.0.0.1:8000/api/v1/register" \
--header "Content-Type: application/json" \
--data "{
\"name\": \"New User\",
\"email\": \"newuser@example.com\",
\"password\": \"password123\",
\"password_confirmation\": \"password123\"
}"
{
"data": {
"id": 1,
"name": "New User",
"email": "newuser@example.com"
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
}
Authenticate user with email and password, returns an OAuth token on success.
curl --request POST \
"http://127.0.0.1:8000/api/v1/login" \
--header "Content-Type: application/json" \
--data "{
\"email\": \"gbailey@example.net\",
\"password\": \"|]|{+-\"
}"
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
}
Invalidate the user's current access token, effectively logging them out.
curl --request POST \
"http://127.0.0.1:8000/api/v1/logout" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"message": "Logged out successfully"
}
Returns the authenticated user's profile information.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/me" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"data": {
"id": 1,
"name": "New User",
"email": "newuser@example.com"
}
}
Endpoints for managing comments on incidences, including listing, creating, viewing, updating, and deleting comments. Returns only root comments (parent_id = null) with their nested children.
Retrieve all root comments for a specific incidence, including their nested children.
The ID of the incidence.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/incidences/1/comments" Add a new comment to a specific incidence. The authenticated user will be set as the creator of the comment (user_id).
The ID of the incidence to comment on.
curl --request POST \
"http://127.0.0.1:8000/api/v1/incidences/1/comments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"body\": \"\\\"This is a comment.\\\"\",
\"parent_id\": 1
}"
{
"data": {
"id": 1,
"body": "This is a comment",
"user_id": 1,
"incidence_id": 1,
"parent_id": null,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"user": {...}
}
}
Get detailed information about a specific comment by its ID, including parent and children.
The ID of the comment.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/comments/1" {
"data": {
"id": 1,
"body": "This is a comment",
"user_id": 1,
"incidence_id": 1,
"parent_id": null,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"user": {...},
"children": [
{
"id": 2,
"body": "This is a reply",
"user_id": 2,
"incidence_id": 1,
"parent_id": 1,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"user": {...},
"children": [...]
}
]
Update an existing comment by its ID. Only the creator of the comment can update it.
The ID of the comment to update.
curl --request PUT \
"http://127.0.0.1:8000/api/v1/comments/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"body\": \"\\\"This is an updated comment.\\\"\"
}"
{
"data": {
"id": 1,
"body": "This is an updated comment",
"user_id": 1,
"incidence_id": 1,
"parent_id": null,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"user": {...}
}
}
Delete an existing comment by its ID. Only the creator of the comment or an admin can delete it.
The ID of the comment to delete.
curl --request DELETE \
"http://127.0.0.1:8000/api/v1/comments/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"message": "Comment deleted successfully"
}
Endpoints for managing incidences, including listing, creating, viewing, updating, and deleting incidences.
Create a new incidence with the provided details. The authenticated user will be set as the creator of the incidence (user_id).
curl --request POST \
"http://127.0.0.1:8000/api/v1/incidences" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"title\": \"\\\"Server Down\\\"\",
\"description\": \"\\\"The main server is not responding since 3 PM.\\\"\",
\"status\": \"architecto\",
\"priority\": \"architecto\",
\"assigned_to\": 2,
\"tags\": \"\\\"server, urgent, backend\\\"\"
}"
{
"data": [
{
"id": 1,
"title": "Server Down",
"description": "Main server not responding",
"status": "open",
"priority": "critical",
"user_id": 1,
"assigned_to": 2,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"user": {...},
"assigned_user": {...},
"tags": [...]
}
]
}
Update an existing incidence by its ID. Only the creator of the incidence or an admin can update it.
The ID of the incidence to update.
curl --request PUT \
"http://127.0.0.1:8000/api/v1/incidences/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"title\": \"\\\"Server Down - Updated\\\"\",
\"description\": \"\\\"Main server not responding - Updated\\\"\",
\"status\": \"\\\"in_progress\\\"\",
\"priority\": \"\\\"high\\\"\",
\"assigned_to\": 2,
\"tags\": \"\\\"server, urgent, backend\\\"\"
}"
{
"data": [
{
"id": 1,
"title": "Server Down - Updated",
"description": "Main server not responding - Updated",
"status": "in_progress",
"priority": "high",
"user_id": 1,
"assigned_to": 2,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T01:00:00Z"
}
]
}
Delete an existing incidence by its ID. Only the creator of the incidence or an admin can delete it.
The ID of the incidence to delete.
curl --request DELETE \
"http://127.0.0.1:8000/api/v1/incidences/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"message": "Incidence deleted successfully"
}
Retrieve incidences created by the authenticated user.
Filter by status (open, in_progress, closed).
Filter by priority (low, medium, high).
Search by title or description.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/my-incidences?status=architecto&priority=architecto&search=architecto" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"data": [...],
"meta": {...}
}
Retrieve all incidences with optional filters.
Filter by status (open, in_progress, closed).
Filter by priority (low, medium, high).
Filter by comma-separated list of tag IDs.
Search by title or description. Examplo: server
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/incidences?status=architecto&priority=architecto&tags=1%2C+2%2C+3&search=architecto" {
"data": [
{
"id": 1,
"title": "Server Down",
"description": "Main server not responding",
"status": "open",
"priority": "critical",
"user_id": 1,
"assigned_to": 2,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"user": {...},
"assigned_user": {...},
"tags": [...]
}
]
}
Get detailed information about a specific incidence by its ID.
The ID of the incidence.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/incidences/1" {
"data": [
{
"id": 1,
"title": "Server Down",
"description": "Main server not responding",
"status": "open",
"priority": "critical",
"user_id": 1,
"assigned_to": 2,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}
]
}
Endpoints for retrieving aggregated metrics and statistics about incidences, such as counts by status and priority.
Retrieve aggregated metrics and statistics about incidences.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/metrics" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"data": {
"by_status": {
"open": [
{"id": 1, "title": "Server Down", "status": "open", "priority": "critical", ...}
],
"in_progress": [],
"closed": []
},
"by_priority": {
"low": [],
"medium": [],
"high": [...],
"critical": [...]
}
}
}
Endpoints for managing tags, including listing, creating, viewing, updating, and deleting tags.
Retrieve all tags with their associated users and incidences.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/tags" Create a new tag or reuse an existing one with the same name (case-insensitive). Uses firstOrCreate to ensure atomicity and prevent duplicates. Tag names are stored in lowercase to enforce case-insensitivity.
curl --request POST \
"http://127.0.0.1:8000/api/v1/tags" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"name\": \"Server\"
}"
Get detailed information about a specific tag by its ID, including the user who created it and the incidences associated with it.
The ID of the tag.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/tags/1" Update the details of an existing tag. Only the creator of the tag or an admin can update it.
The ID of the tag.
curl --request PUT \
"http://127.0.0.1:8000/api/v1/tags/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"name\": \"Server\"
}"
Delete an existing tag. Only the creator of the tag or an admin can delete it. Note: This removes the tag from all associated incidences (pivot table).
The ID of the tag.
curl --request DELETE \
"http://127.0.0.1:8000/api/v1/tags/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" Endpoints for managing users, including listing all users, viewing a single user, retrieving a user's incidences, and deleting a user.
Retrieve a list of all users.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/users" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"data": [
{
"id": 1,
"name": "User Admin",
"email": "admin@telsur.cl",
"is_admin": true,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
},
{
"id": 2,
"name": "User no Admin",
"email": "noadmin@telsur.cl",
"is_admin": false,
...
}
]
}
Get detailed information about a specific user by their ID.
The ID of the user.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/users/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"data": {
"id": 1,
"name": "User Admin",
"email": "admin@telsur.cl",
"is_admin": true,
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z"
}
}
Retrieve all incidences created by or assigned to a specific user by their ID.
user_id field.assigned_to field.The ID of the user.
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/users/2/incidences" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"data": [
{
"id": 1,
"title": "Server Down",
"user_id": 2,
"assigned_to": 2,
...
},
{
"id": 3,
"title": "Database issue",
"user_id": 1,
"assigned_to": 2,
...
}
]
}
Remove a specific user from the system. Only an admin can delete a user, and users cannot delete themselves.
The ID of the user.
curl --request DELETE \
"http://127.0.0.1:8000/api/v1/users/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" {
"message": "User deleted successfully."
}