> ## 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.

# Create User

> Creates a new user with validation

Creates a new user with validation. This endpoint requires authentication via a bearer token. Required fields include `Name`, `Email`, `State`, `Gender`, `District`, and `Mobile`. The Email field must be in a valid email format, and the Mobile field must be exactly 10 digits.


## OpenAPI

````yaml POST /users
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:
    post:
      description: Creates a new user with validation
      requestBody:
        description: User to add to the system
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreate'
        required: true
      responses:
        '201':
          description: User created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '400':
          description: Validation error
          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:
    UserCreate:
      allOf:
        - $ref: '#/components/schemas/UserBase'
        - type: object
          properties:
            Email:
              description: Email address of the user
              type: string
              format: email
              pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
            Mobile:
              description: Mobile number of the user
              type: string
              pattern: ^\d{10}$
    UserResponse:
      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

````