> ## Documentation Index
> Fetch the complete documentation index at: https://cpgrams.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get User

> Get a user by ID from the Xata database

Returns a user by ID from the system. This endpoint requires authentication via a bearer token. The response includes all user details such as Name, Email, State, Gender, District, Mobile, and status.


## OpenAPI

````yaml GET /users/{user_id}
openapi: 3.1.0
info:
  title: CPGRAMS Simulation API
  description: >-
    An API that simulates the Centralized Public Grievance Redress and
    Monitoring System (CPGRAMS) in India
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://grm-api.vercel.app
security:
  - bearerAuth: []
externalDocs:
  description: API Documentation
  url: https://grm-api.vercel.app/docs
paths:
  /users/{user_id}:
    get:
      description: Get a user by ID from the Xata database
      parameters:
        - name: user_id
          in: path
          description: ID of user to fetch
          required: true
          schema:
            type: string
      responses:
        '200':
          description: User response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    User:
      allOf:
        - $ref: '#/components/schemas/UserBase'
        - required:
            - id
            - status
          type: object
          properties:
            id:
              description: Unique identifier for the user
              type: string
            status:
              description: Status of the user creation or operation
              type: string
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    UserBase:
      required:
        - Name
        - Email
        - State
        - Gender
        - District
        - Mobile
      type: object
      properties:
        Name:
          description: The full name of the user
          type: string
        Email:
          description: Email address of the user
          type: string
          format: email
        State:
          description: State of residence of the user
          type: string
        Gender:
          description: Gender of the user
          type: string
        District:
          description: District of residence of the user
          type: string
        Mobile:
          description: Mobile number of the user
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````