> ## Documentation Index
> Fetch the complete documentation index at: https://docs-neevlegal.neeved.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Full court hierarchy

> Returns the complete nested hierarchy of all states, districts, and court complexes in a single response. Use this to bootstrap a local directory cache.



## OpenAPI

````yaml get /court-structure
openapi: 3.0.3
info:
  title: NeevLegal API
  description: >-
    The NeevLegal REST API provides structured, programmatic access to Indian
    court case data. Search cases, retrieve full case records by CNR number, and
    explore the court directory across district courts, high courts, and the
    Supreme Court of India.
  version: 1.0.0
servers:
  - url: https://api-neevlegal.neeved.com/api/v1
    description: Version 1
security: []
tags:
  - name: Case Detail
    description: Retrieve the complete case record for one or more CNR numbers.
  - name: Case Search
    description: >-
      Search across district courts, high courts, and the Supreme Court by party
      name, advocate, judge, FIR number, or other criteria.
  - name: Court Structure
    description: >-
      Browse the Indian court directory — states, districts, court complexes,
      and individual courts.
paths:
  /court-structure:
    get:
      tags:
        - Court Structure
      summary: Full court hierarchy
      description: >-
        Returns the complete nested hierarchy of all states, districts, and
        court complexes in a single response. Use this to bootstrap a local
        directory cache.
      responses:
        '200':
          description: Full hierarchy
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  response:
                    type: object
                    properties:
                      totalStates:
                        type: number
                        description: Total number of states in the hierarchy.
                        example: 28
                      generatedAt:
                        type: string
                        description: >-
                          ISO 8601 timestamp of when this hierarchy snapshot was
                          generated.
                        example: '2024-01-15T10:30:00.000Z'
                      data:
                        type: array
                        description: >-
                          One entry per state, each containing its districts and
                          complexes.
                        items:
                          type: object
                          properties:
                            stateName:
                              type: string
                              description: Full state name.
                              example: Maharashtra
                            stateCode:
                              type: string
                              description: Two-letter state code.
                              example: MH
                            totalDistricts:
                              type: number
                              description: Number of districts in this state.
                            districts:
                              type: array
                              items:
                                type: object
                                properties:
                                  districtName:
                                    type: string
                                    description: Full district name.
                                    example: Pune
                                  districtCode:
                                    type: string
                                    description: District identifier.
                                    example: PUNE
                                  totalComplexes:
                                    type: number
                                  complexes:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        complexName:
                                          type: string
                                        complexCode:
                                          type: string
                                        totalCourts:
                                          type: number
                                      required:
                                        - complexName
                                        - complexCode
                                        - totalCourts
                                required:
                                  - districtName
                                  - districtCode
                                  - totalComplexes
                                  - complexes
                          required:
                            - stateName
                            - stateCode
                            - totalDistricts
                            - districts
                    required:
                      - totalStates
                      - generatedAt
                      - data
                required:
                  - success
                  - response
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      description: Standard error envelope returned on all non-2xx responses.
      properties:
        success:
          type: boolean
          description: Always false for error responses.
          example: false
        message:
          type: string
          description: Human-readable description of what went wrong.
          example: API key not found or has been revoked.
        moreInfo:
          type: string
          description: Additional context when available.
          example: No additional info found.
      required:
        - success
        - message
        - moreInfo
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.