← Back

API Documentation

FrictaSolv REST API reference

Authentication

All authenticated endpoints require an Authorization header with a JWT token:

Authorization: Bearer <your_jwt_token>

For organization API calls, use the organization's API key:

Authorization: Bearer <org_api_key>

Authentication

POST/api/auth/register

Register new organization account

Parameters:
  • email: string
  • password: string
  • org_name: string
Response:
{ "access_token": "string", "user": "object" }
POST/api/auth/login

Login and get JWT token

Parameters:
  • email: string
  • password: string
Response:
{ "access_token": "string", "user": "object" }

Organizations

GET/api/organizations

Get organization details

Auth required:
Response:
{ "id": "int", "name": "string", "tier_id": "int", "enabled": "bool" }
GET/api/organizations/:org_id

Get org details by ID (super admin only)

Auth required:
Response:
{ "id": "int", "name": "string", "api_key": "string", "tier_id": "int" }

Frustration Events

POST/api/organizations/:org_id/events

Create frustration event

Auth required:
Parameters:
  • frustration_score: int
  • page_url: string
  • console_errors: int
  • failed_requests: int
Response:
{ "id": "int", "frustration_score": "int", "created_at": "timestamp" }
GET/api/organizations/:org_id/events

List frustration events

Auth required:
Parameters:
  • min_score: int (optional)
  • from_date: ISO8601 (optional)
  • to_date: ISO8601 (optional)
  • limit: int
  • offset: int
Response:
{ "events": "array", "total": "int" }
GET/api/organizations/:org_id/events/export

Export events as CSV

Auth required:
Feature required:csv_export
Parameters:
  • min_score: int
  • from_date: ISO8601
  • to_date: ISO8601
Response:
CSV file download

Alert Settings

GET/api/organizations/:org_id/alert-settings

Get alert settings

Auth required:
Response:
{ "email_recipients": "string", "slack_webhook_url": "string", "teams_webhook_url": "string", "min_score": "int", "digest_hour": "int" }
PUT/api/organizations/:org_id/alert-settings

Update alert settings

Auth required:
Parameters:
  • email_recipients: string
  • slack_webhook_url: string
  • teams_webhook_url: string
  • min_score: int
  • digest_hour: int
Response:
{ "success": "bool" }

Page Thresholds

GET/api/organizations/:org_id/page-thresholds

List page thresholds

Auth required:
Feature required:page_thresholds
Response:
array of { page_url_pattern, threshold_score }
POST/api/organizations/:org_id/page-thresholds

Create page threshold

Auth required:
Feature required:page_thresholds
Parameters:
  • page_url_pattern: string
  • threshold_score: int
Response:
{ "id": "int", "page_url_pattern": "string", "threshold_score": "int" }
DELETE/api/organizations/:org_id/page-thresholds/:id

Delete page threshold

Auth required:
Feature required:page_thresholds
Response:
{ "success": "bool" }

Admin - Users

GET/api/admin/users

List all platform users

Auth required:
Super admin only:
Response:
{ "users": "array of { id, email, is_super_admin, created_at }" }
POST/api/admin/users

Create new user

Auth required:
Super admin only:
Parameters:
  • email: string
  • password: string
Response:
{ "id": "int", "email": "string" }
DELETE/api/admin/users/:user_id

Delete user

Auth required:
Super admin only:
Response:
{ "success": "bool" }

Admin - Organizations

GET/api/admin/orgs

List all organizations

Auth required:
Super admin only:
Response:
{ "orgs": "array of { id, name, api_key, tier_id, enabled }" }
PUT/api/admin/orgs/:org_id/tier

Assign tier to organization

Auth required:
Super admin only:
Parameters:
  • tier_id: int
Response:
{ "success": "bool", "tier_id": "int" }
POST/api/admin/orgs/:org_id/disable

Disable organization

Auth required:
Super admin only:
Response:
{ "success": "bool" }
POST/api/admin/orgs/:org_id/enable

Enable organization

Auth required:
Super admin only:
Response:
{ "success": "bool" }
POST/api/admin/orgs/:org_id/rotate-key

Rotate organization API key

Auth required:
Super admin only:
Response:
{ "api_key": "string" }

Admin - Team Members

GET/api/admin/orgs/:org_id/members

List org team members

Auth required:
Super admin only:
Response:
array of { id, email, role }
POST/api/admin/orgs/:org_id/members

Add user to organization

Auth required:
Super admin only:
Parameters:
  • email: string
Response:
{ "success": "bool" }
DELETE/api/admin/orgs/:org_id/members/:user_id

Remove user from organization

Auth required:
Super admin only:
Response:
{ "success": "bool" }

Admin - Tiers

GET/api/admin/tiers

List all subscription tiers

Auth required:
Super admin only:
Response:
array of { id, name, display_name, price_monthly, features: array }
GET/api/admin/tiers/:tier_id

Get tier details

Auth required:
Super admin only:
Response:
{ id, name, display_name, price_monthly, max_events_per_minute, max_team_members, retention_days, features }
PUT/api/admin/tiers/:tier_id/features/:feature_key

Toggle feature for tier

Auth required:
Super admin only:
Parameters:
  • enabled: bool
Response:
{ "success": "bool", "enabled": "bool" }

Error Handling

4xx errors: Client error (invalid request, missing auth, etc)

5xx errors: Server error

• All errors return JSON with detail field explaining the issue