Using the API
Using our easy-to-use REST API you can administer projects and errors.
Getting started
First, you must create an API token in your account settings.
In all calls to our API endpoint you must include an api_token
URL parameter and should include
an Accepts: application/json
header. Here's an example:
curl "https://flareapp.io/api/projects?api_token=xyz123" \
-H 'Accept: application/json'
Pagination
All API endpoints contain pagination information in the response.links
and reponse.meta
keys.
Using an API client
Postman
Postman is a platform for API development that offers a free application to easily make API requests.
To easily use our API with Postman, import this JSON file which contains presets for all available endpoints.
Paw
Paw is a highly polished, paid API tool for Mac. You can download a free trial here.
To easily use our API with Paw, open this file which contains presets for all available endpoints.
GET /api/me
Returns the authenticated user.
Example response
{
"id": 1,
"name": "Freek",
"email": "[email protected]",
"photo_url": "https://www.gravatar.com/avatar/a1b4b398630bbd32b77a82cbc37fae9a.jpg?s=200&d=mm",
"teams": [
{
"id": 1,
"name": "Spatie"
}
]
}
GET /api/projects
Returns a list of the user's projects.
Example response
{
"data": [
{
"id": 11,
"name": "Flare",
"errors_last_7_days_count": 0,
"errors_previous_7_days_count": 30,
"unresolved_errors_count": 20,
"api_key": "K47o4Jl153J6UQbdZ3KXOuh5fces0B8W",
"api_public_key": "DHJGDNaBIqzDMTtr3D98LiAfyxx72Ssk",
"last_error_received_at": null,
"spike_protection_active_until": null,
"stage": null
},
{
"id": 12,
"name": "necessitatibus",
"errors_last_7_days_count": 0,
"errors_previous_7_days_count": 30,
"unresolved_errors_count": 20,
"api_key": "YSGJZQqtSLetT0f4AdBTCu23QbdTecwh",
"api_public_key": "EdXBvKjVeVFKRr8J5aJFM70j031nuyO5",
"last_error_received_at": "2021-04-28T15:22:42Z",
"spike_protection_active_until": null,
"stage": null
}
],
"links": {
"first": "https://flareapp.io/api/projects?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&page%5Bnumber%5D=1",
"last": "https://flareapp.io/api/projects?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&page%5Bnumber%5D=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "Previous",
"active": false
},
{
"url": "https://flareapp.io/api/projects?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&page%5Bnumber%5D=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next",
"active": false
}
],
"path": "https://flareapp.io/api/projects",
"per_page": 10,
"to": 2,
"total": 2
}
}
Available filters:
-
filter[id]
-
filter[team_id]
-
filter[name]
E.g. GET /api/projects?filter[name]=foo
Available includes:
-
team
E.g. GET /api/projects?include=team
GET /api/projects/{project_id}
Returns a list of errors for the project_id
.
Example response
{
"data": [
{
"id": 29,
"first_seen_at_url": "http://hermiston.biz/et-non-cum-animi-et-repudiandae-ut.html",
"exception_message": "Earum ut laborum error quod cumque dolorem et.",
"exception_class": "ErrorException",
"file": "database/faker/ExceptionProvider.php",
"line_number": 49,
"class": "ExceptionProvider",
"method": "createException",
"first_seen_at": "2021-03-22T10:32:00Z",
"last_seen_at": "2021-03-22T10:32:00Z",
"occurrence_count": 94,
"affected_user_count": 20,
"share_count": 0,
"notifier_client_name": "Flare",
"language_version": "8.0.1",
"framework_version": "8.39.0",
"stage": "local",
"type": "web",
"application_version": "beta",
"message_level": "ERROR",
"status": "open",
"resolved_by_user_name": null,
"resolved_at": null,
"language": "php",
"latest_occurrence_has_solutions": true,
"snooze_type": null,
"snoozed_at": null,
"snoozed_until": null,
"snoozed_up_to_occurrence_number": null,
"marked_for_deletion_by_user_name": null,
"marked_for_deletion_at": null
}
// other errors removed for brevity
],
"links": {
"first": "https://flareapp.io/api/projects/11?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&sort=-last_seen_at&page%5Bnumber%5D=1",
"last": "https://flareapp.io/api/projects/11?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&sort=-last_seen_at&page%5Bnumber%5D=3",
"prev": null,
"next": "https://flareapp.io/api/projects/11?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&sort=-last_seen_at&page%5Bnumber%5D=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 3,
"links": [
{
"url": null,
"label": "Previous",
"active": false
},
{
"url": "https://flareapp.io/api/projects/11?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&sort=-last_seen_at&page%5Bnumber%5D=1",
"label": "1",
"active": true
},
{
"url": "https://flareapp.io/api/projects/11?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&sort=-last_seen_at&page%5Bnumber%5D=2",
"label": "2",
"active": false
},
{
"url": "https://flareapp.io/api/projects/11?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&sort=-last_seen_at&page%5Bnumber%5D=3",
"label": "3",
"active": false
},
{
"url": "https://flareapp.io/api/projects/11?api_token=1Y0lORgKlpeYB5xXEWsJcCCiy7klD6WXqawDM1aF3O1uQCaLJUIReSsGSotO&sort=-last_seen_at&page%5Bnumber%5D=2",
"label": "Next",
"active": false
}
],
"path": "https://flareapp.io/api/projects/11",
"per_page": 10,
"to": 10,
"total": 30
}
}
Available filters:
-
filter[id]
-
filter[first_seen_at_url]
-
filter[exception_message]
-
filter[exception_class]
-
filter[file]
-
filter[status]
-
filter[stage]
-
filter[message_level]
-
filter[first_seen_at]
-
filter[last_seen_at]
-
filter[resolved_at]
-
filter[seen_between]
E.g. GET /api/projects/123?filter[seen_between]=2020-07-16T16:41:59Z,2020-08-16T16:41:59Z
Available sorts:
-
sort=first_seen_at
-
sort=-first_seen_at
-
sort=last_seen_at
-
sort=-last_seen_at
E.g. GET /api/projects/123?sort=-last_seen_at
POST /api/projects
Create a new project. The payload should have:
-
name
: the name of your new project -
stage
: the stage of the project (local
,development
,staging
,production
) -
technology
the technology of the project (Laravel
,PHP
,JS
,React
,Vue
) -
group
: optionally the group name of the project -
team_id
: the id of the team for which the project should be created. For now, you can find this number in the URL when visiting your team settings page on Flare.
Example response
{
"id": 1,
"name": "Test Project",
"api_key": "<an-api-key>",
"api_public_key": "<a-public-api-key>"
}
GET /api/projects/{project_id}/error-count
Returns the number of errors in the given period.
Example call: GET /api/projects/123/error-count?start_date=2021-01-01 00:00:00&end_date=2021-01-01 00:05:00
Example response
{
"count": 5
}
GET /api/projects/{project_id}/error-occurrence-count
Returns the number of errors in the given period.
Example call: GET /api/projects/123/error-occurrence-count?start_date=2021-01-01 00:00:00&end_date=2021-01-01 00:05:00
Example response
{
"count": 5
}
POST /api/errors/{error_id}/resolve
Resolves an error and returns the error details.
Example response
{
"id": 29,
"first_seen_at_url": "http://hermiston.biz/et-non-cum-animi-et-repudiandae-ut.html",
"exception_message": "Earum ut laborum error quod cumque dolorem et.",
"exception_class": "ErrorException",
"file": "database/faker/ExceptionProvider.php",
"line_number": 49,
"class": "ExceptionProvider",
"method": "createException",
"first_seen_at": "2021-03-22T10:32:00Z",
"last_seen_at": "2021-03-22T10:32:00Z",
"occurrence_count": 94,
"affected_user_count": 20,
"share_count": 0,
"notifier_client_name": "Flare",
"language_version": "8.0.1",
"framework_version": "8.39.0",
"stage": "local",
"type": "web",
"application_version": "beta",
"message_level": "ERROR",
"status": "resolved",
"resolved_by_user_name": "[email protected]",
"resolved_at": "2021-04-29T09:14:33Z",
"language": "php",
"latest_occurrence_has_solutions": true,
"snooze_type": null,
"snoozed_at": null,
"snoozed_until": null,
"snoozed_up_to_occurrence_number": null,
"marked_for_deletion_by_user_name": null,
"marked_for_deletion_at": null,
"id_slug": "29-earum-ut-laborum-error-quod-cumque-dolorem-et",
"framework": null,
"can": {
"delete": true
},
"links": {
"show": "https://flareapp.io/errors/29-earum-ut-laborum-error-quod-cumque-dolorem-et",
"latest": "https://flareapp.io/errors/29-earum-ut-laborum-error-quod-cumque-dolorem-et/latest",
"resolve": "https://flareapp.io/api/errors/29-earum-ut-laborum-error-quod-cumque-dolorem-et/resolve",
"open": "https://flareapp.io/api/errors/29-earum-ut-laborum-error-quod-cumque-dolorem-et/open",
"snooze": "https://flareapp.io/snooze-errors",
"delete": "https://flareapp.io/delete-errors"
}
}
POST /api/errors/{error_id}/open
Re-opens an error and returns the error details.
GET /api/teams/{team_id}
Get details of a users and its members.
{
"id": 1,
"name": "Spatie",
"teamUsers": [
{
"team_id": 1,
"user_id": 1,
"user_email": "[email protected]",
"role": "admin"
},
{
"team_id": 1,
"user_id": 2,
"user_email": "[email protected]",
"role": "member"
}
]
}
POST /api/teams/{team_id}/remove-user/{user_id}
Remove a user from a team. The user itself will not be deleted. This action can only be performed if you are the admin or owner of the team the user belongs to.
This endpoint returns an empty response with response code 200 when successful.