Skip to main content

Admin API Specifications

Detailed API specifications for the Law Firm Admin Provisioning API system.

Overview

These specifications are organized by API domain and feature area. Each specification corresponds to a specific API endpoint and includes:

  • User Stories: Clear description of the feature's purpose
  • Scenarios: Concrete examples with acceptance criteria
  • Request/Response Specs: API contract details in tables
  • Requirements Mapping: Traceability to functional requirements

Directory Structure

📁 firms/

Law firm tenant management

📁 users/

User and lawyer provisioning

📁 logto-bridge/

Logto organization member management

Note: Logto organizations are automatically created when law firms are created, and automatically deleted when law firms are deleted. No manual binding or sync is required.

📁 access-grants/

Resource access control

📁 capabilities/

User capabilities and policies

📁 support-access/

Support impersonation (act-as)

📁 shared/

Common test fixtures and steps

Specification Format

All specifications follow this structure:

# Feature Name

**API Endpoint**: `METHOD /path`
**Priority**: P1/P2/P3
**User Story**: As an admin, I want to...

## Overview
Brief description of the feature

## Scenarios

### Scenario 1: Success case

**Given**:
- Preconditions (state, auth, data)

**When**:
- Action (API request with payload)

**Then**:
- Expected outcome (status, response, side effects)
- Tables for structured data validation

### Scenario 2: Error case
...

## Request Specification
Tables showing all parameters

## Response Specification
Example responses with explanations

## Requirements Mapping
FR-001, FR-002, etc.

Key Benefits

Testable: Each scenario can be automated ✅ Clear: Structured format with concrete examples ✅ Complete: Tables provide comprehensive API details ✅ Traceable: Requirements mapped to scenarios ✅ Maintainable: One file per endpoint, easy to update

API Coverage

DomainEndpointsFeaturesStatus
Firms33✅ Complete
Users66✅ Complete
Logto Bridge66✅ Complete
Access Grants99✅ Complete
Capabilities22✅ Complete
Support Access66✅ Complete
Total3232100% Complete

How to Use

For Developers

  1. Read the user story to understand the goal
  2. Review scenarios for behavior examples
  3. Check request/response specs for API contract
  4. Implement to satisfy all scenarios

For QA Engineers

  1. Convert scenarios to automated tests
  2. Use scenario steps as test cases
  3. Reference data fixtures in shared/
  4. Generate test reports mapped to requirements

For Product Managers

  1. Review user stories for feature clarity
  2. Validate scenarios cover all cases
  3. Check priorities align with roadmap
  4. Use as communication tool with stakeholders

Contributing

When adding new features:

  1. Create new .md file in appropriate directory
  2. Follow the specification format template
  3. Include comprehensive scenarios (success + errors)
  4. Use tables for complex data
  5. Map to requirements (FR-XXX)
  6. Add to this index under correct domain