### List Players with Date Range Source: https://www.devstats.com/docs/tools/devstats-api/player Use this cURL command to retrieve a paginated list of players, filtering by a required start and end date. Ensure you include your Bearer token for authorization. ```shell GET /api/v1/players?start_date=&end_date= HTTP/1.1 Host: service.devstats.com Authorization: Bearer Accept: application/json ``` -------------------------------- ### Create Incident Source: https://www.devstats.com/docs/tools/incidents/guide-create-and-update-incidents-using-the-devstats-api Send a POST request to create a new incident. Include details such as name, description, detection method, and start time. The response will contain a UUID necessary for updates. ```APIDOC ## POST /api/v1/incidents ### Description Creates a new incident with provided details. ### Method POST ### Endpoint https://service.devstats.com/api/v1/incidents ### Headers - Accept: application/json - Authorization: Bearer YOUR_API_TOKEN ### Request Body - **name** (string) - Required - Incident name. - **description** (string) - Required - Detailed explanation of the incident. - **detected_by** (string) - Required - How the incident was detected (`automated_monitoring`, `customers`, or `internally`). - **started_at** (string) - Required - Incident start date in ISO 8601 format (e.g., `2024-07-20T15:30:00+00:00`). - **resolved_at** (string) - Optional - Resolution date in ISO 8601 format. ### Request Example ```json { "repository": "michielmulders/coding", "name": "Problem with login", "description": "It's impossible to log in to the system", "detected_by": "automated_monitoring", "started_at": "2024-12-09T15:30:00+00:00" } ``` ### Response #### Success Response (200) - **UUID** (string) - The unique identifier for the created incident. - **resolved_at** (string) - The resolution date, null if not resolved. ``` -------------------------------- ### GET /players Source: https://www.devstats.com/docs/tools/devstats-api/player Retrieves a list of players with optional filtering and pagination. ```APIDOC ## GET /players ### Description Retrieves a list of players. Supports filtering by date range and searching by name, with pagination options. ### Method GET ### Endpoint /api/v1/players ### Parameters #### Query Parameters - **per_page** (number) - No - Max: 50, Min: 1 - **page** (number) - No - Min: 1 - **search** (string) - No - Max length: 255 - **start_date** (string (date)) - Yes - - **end_date** (string (date)) - Yes - ### Request Example ``` GET /api/v1/players?start_date=&end_date= HTTP/1.1 Host: service.devstats.com Authorization: Bearer Accept: application/json ``` ### Response #### Success Response (200) Paginated set of `PlayerResource` #### Error Responses - **401**: Unauthenticated - **422**: Validation error ``` -------------------------------- ### POST /users Source: https://www.devstats.com/docs/tools/devstats-api/user Creates a new user for the workspace. Requires name, email, password, and role. Squads are optional. ```APIDOC ## POST /users ### Description Creates a new user for the workspace. Requires name, email, password, and role. Squads are optional. ### Method POST ### Endpoint /api/v1/users ### Parameters #### Request Body - **name** (string) - Yes - The name of the user. Minimum length: 2, Maximum length: 255. - **email** (string (email)) - Yes - The email address of the user. Maximum length: 255. - **password** (string) - Yes - The password of the user. Should be at least 12 characters long, contain at least one uppercase letter, one lowercase letter, one number, and one special character. - **role** (string) - Yes - The role of the user in the workspace. Enum: Admin, Member, Viewer. - **squads** (array) - No - The squads the user belongs to. Should be an array of squad names. Can be empty if the user is an admin. ### Request Example ```json { "name": "John Doe", "email": "john@doe.com", "password": "P@ssw0rd123!", "role": "", "squads": ["My Squad 1", "My Squad 2"] } ``` ### Responses #### Success Response (200) `UserResource` #### Error Responses - **401**: Unauthenticated - **403**: Authorization error - **422**: Validation error ``` -------------------------------- ### Create Deploy cURL Request Source: https://www.devstats.com/docs/tools/devstats-api/deploy This cURL command demonstrates how to create a new deployment. It requires the repository name and deployment date in the request body. An optional commit SHA can also be provided. ```shell POST /api/v1/deploys HTTP/1.1 Host: service.devstats.com Authorization: Bearer Accept: application/json Content-Type: application/json { "repository": "organization/repository", "deployed_at": "2024-07-20T15:30:00-03:00", "commit_sha": "1234567890abcdef1234567890abcdef12345678" } ``` -------------------------------- ### GET /users Source: https://www.devstats.com/docs/tools/devstats-api/user Retrieves a list of users. Supports filtering by per_page, page, squad, name, and email. ```APIDOC ## GET /users ### Description Retrieves a list of users. Supports filtering by per_page, page, squad, name, and email. ### Method GET ### Endpoint /api/v1/users ### Parameters #### Query Parameters - **per_page** (number) - No - Minimum value of 1. - **page** (number) - No - Minimum value of 1. - **squad** (string) - No - Minimum length: 1, Maximum length: 255. - **name** (string) - No - Minimum length: 1, Maximum length: 255. - **email** (string) - No - Minimum length: 1, Maximum length: 255. ### Responses #### Success Response (200) Paginated set of `UserResource` #### Error Responses - **401**: Unauthenticated - **422**: Validation error ``` -------------------------------- ### Create Deploy Source: https://www.devstats.com/docs/tools/devstats-api/deploy Creates a new deployment record for a specified repository, including deployment date and an optional commit SHA. ```APIDOC ## POST /deploys ### Description Creates a new deployment for the repository. ### Method POST ### Endpoint /api/v1/deploys ### Parameters #### Request Body - **repository** (string) - Yes - The full name of the repository. - **deployed_at** (string) - Yes - The deployment date in the ISO 8601 format. - **commit_sha** (string) - No - The commit SHA of the deployment. ### Request Example ```json { "repository": "organization/repository", "deployed_at": "2024-07-20T15:30:00-03:00", "commit_sha": "1234567890abcdef1234567890abcdef12345678" } ``` ### Responses #### Success Response (200) `DeployResource` #### Error Responses - **401** Unauthenticated - **403** Authorization error - **422** Validation error ``` -------------------------------- ### Create Incident Source: https://www.devstats.com/docs/tools/devstats-api/incident Creates a new incident. Requires a name, detected_by, started_at, and repositories. Other fields like severity, status, description, root_cause, and resolved_at are optional. ```HTTP POST /api/v1/incidents HTTP/1.1 Host: service.devstats.com Authorization: Bearer Accept: application/json Content-Type: application/json { "name": "Problem with login", "severity": "high", "status": "detected", "description": "It's impossible to log in to the system.", "detected_by": "", "root_cause": "Database connection timeout", "started_at": "2024-07-20T15:30:00+00:00", "resolved_at": "2024-07-20T15:30:00+00:00", "repositories": [ "organization/repository-one", "organization/repository-two" ] } ``` -------------------------------- ### Create Incident Request Body Source: https://www.devstats.com/docs/tools/incidents/guide-create-and-update-incidents-using-the-devstats-api Use this JSON payload to create a new incident via a POST request to the DevStats API. Ensure all required fields like name, description, detection method, and start time are included. ```json { "repository": "michielmulders/coding", "name": "Problem with login", "description": "It's impossible to log in to the system", "detected_by": "automated_monitoring", "started_at": "2024-12-09T15:30:00+00:00" } ``` -------------------------------- ### Create a New Deploy Source: https://www.devstats.com/docs/metrics-and-definitions/guide-submit-deployment-data-using-the-devstats-api Send a POST request to the DevStats API to record a new deployment. This includes specifying the repository and the exact time of deployment. ```APIDOC ## POST https://service.devstats.com/api/v1/deploys ### Description Submits data about a new deployment to the DevStats API. ### Method POST ### Endpoint https://service.devstats.com/api/v1/deploys ### Headers - Accept: application/json - Authorization: Bearer YOUR_API_TOKEN ### Request Body - **repository** (string) - Required - The full name of the repository using the format `organization/repository`. - **deployed_at** (string) - Required - The deployment date in ISO 8601 format (e.g., `2024-07-20T15:30:00+00:00`). ### Request Example ```json { "repository": "michielmulders/coding", "deployed_at": "2024-12-09T15:30:00-03:00" } ``` ### Response #### Success Response (200) Confirms the deployment creation. ``` -------------------------------- ### Create User cURL Request Source: https://www.devstats.com/docs/tools/devstats-api/user This cURL command demonstrates how to create a new user. Ensure the request body includes all required fields: name, email, password, and role. The squads field is optional. ```shell POST /api/v1/users HTTP/1.1 Host: service.devstats.com Authorization: Bearer Accept: application/json Content-Type: application/json { "name": "John Doe", "email": "john@doe.com", "password": "P@ssw0rd123!", "role": "", "squads": "['My Squad 1', 'My Squad 2']" } ``` -------------------------------- ### Set Accept Header Source: https://www.devstats.com/docs/tools/devstats-api Include the `Accept` header with the value `application/json` to specify the desired response format. ```http Accept: application/json ``` -------------------------------- ### Create Incident Source: https://www.devstats.com/docs/tools/devstats-api/incident Creates a new incident for a repository. Requires details such as name, detected_by, started_at, and repositories. ```APIDOC ## POST /incidents ### Description Creates a new incident for the repository. ### Method POST ### Endpoint `/incidents` ### Request Body - **name** (string) - Required - The incident name. - **severity** (string) - Optional - The incident severity. - **status** (string) - Optional - The incident status. - **description** (string) - Optional - The incident description. - **detected_by** (string) - Required - Enum: automated_monitoring, customers, internally. - **root_cause** (string | null) - Optional - The root cause of the incident. - **started_at** (string) - Required - The incident start date in the ISO 8601 format. - **resolved_at** (string) - Optional - The resolved date in the ISO 8601 format. - **repositories** (array) - Required - The full names of the repositories to associate with the incident. ### Request Example ```json { "name": "Problem with login", "severity": "high", "status": "detected", "description": "It's impossible to log in to the system.", "detected_by": "", "root_cause": "Database connection timeout", "started_at": "2024-07-20T15:30:00+00:00", "resolved_at": "2024-07-20T15:30:00+00:00", "repositories": [ "organization/repository-one", "organization/repository-two" ] } ``` ### Responses #### Success Response (200) `IncidentResource` #### Error Responses - **401** Unauthenticated - **403** Authorization error - **422** Validation error ```