Skip to main content

Get Law Firm

API Endpoint: GET /admin/law-firms/{lawFirmId}

Priority: P1

User Story: As an admin, I want to fetch a firm by id.

Overview

Retrieve detailed information about a specific law firm by its unique identifier.

Scenarios

Scenario 1: Get existing law firm

Given:

  • Admin is authenticated with scope firms:read
  • Law firm with ID firm_abc123 exists

When:

  • Admin GETs /admin/law-firms/firm_abc123

Then:

  • Response status is 200 OK
  • Response body contains:
    {
    "id": "firm_abc123",
    "name": "Acme Legal Services",
    "slug": "acme-legal",
    "logtoOrgId": "org_xyz789",
    "createdAt": "2025-10-18T12:00:00Z",
    "updatedAt": "2025-10-18T12:00:00Z"
    }

Scenario 2: Law firm not found

Given:

  • Admin is authenticated with scope firms:read
  • No law firm with ID firm_nonexistent

When:

  • Admin GETs /admin/law-firms/firm_nonexistent

Then:

  • Response status is 404 Not Found
  • Response body contains:
    {
    "error": "NOT_FOUND",
    "message": "Law firm with ID 'firm_nonexistent' not found"
    }

Scenario 3: Unauthorized access

Given:

  • Request has no authentication token

When:

  • Client GETs /admin/law-firms/firm_abc123

Then:

  • Response status is 401 Unauthorized

Request Specification

Path Parameters

ParameterTypeRequiredDescription
lawFirmIdstringYesUnique law firm identifier

Response Specification

Success Response (200 OK)

{
"id": "firm_abc123",
"name": "Acme Legal Services",
"slug": "acme-legal",
"logtoOrgId": "org_xyz789",
"createdAt": "2025-10-18T12:00:00Z",
"updatedAt": "2025-10-18T12:00:00Z"
}

Response Fields

FieldTypeDescription
idstringUnique law firm identifier
namestringDisplay name of the law firm
slugstringURL-safe identifier
logtoOrgIdstring | nullAssociated Logto organization ID
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp

Error Responses

StatusError CodeDescription
401UNAUTHORIZEDMissing or invalid auth token
403FORBIDDENMissing firms:read scope
404NOT_FOUNDLaw firm does not exist

Requirements Mapping

  • FR-014: Accept GET with lawFirmId path parameter
  • FR-015: Return law firm details when found
  • FR-016: Return 404 when law firm not found
  • FR-017: Include all law firm fields in response
  • FR-018: Require firms:read scope