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

# Generate IPID

> 
### Overview

This API generates the **next IPD case number (IPID)** for your workspace, as `prefix` followed by a running number.

Each call **uses up a number**: the running number is increased by one and the new value is returned, so calling it twice returns two different IPIDs. The prefix and running number are set with [Update IPID Config](/api-reference/doc-tool/ipd-api/admissions/update-ipid-config). For a workspace that has never set it, the first IPID is `IPD1`.

`GET` on the same path behaves exactly the same, including using up a number.



## OpenAPI

````yaml post /ipd/v1/service/admissions/generate-ipid
openapi: 3.0.0
info:
  title: Ekacare API & Webhook Documentation
  contact: {}
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /ipd/v1/service/admissions/generate-ipid:
    post:
      tags:
        - IPD API
      summary: Generate IPID
      description: >-

        ### Overview


        This API generates the **next IPD case number (IPID)** for your
        workspace, as `prefix` followed by a running number.


        Each call **uses up a number**: the running number is increased by one
        and the new value is returned, so calling it twice returns two different
        IPIDs. The prefix and running number are set with [Update IPID
        Config](/api-reference/doc-tool/ipd-api/admissions/update-ipid-config).
        For a workspace that has never set it, the first IPID is `IPD1`.


        `GET` on the same path behaves exactly the same, including using up a
        number.
      operationId: GenerateIpdIpid
      parameters:
        - name: auth
          in: header
          required: true
          schema:
            type: string
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM
      responses:
        '200':
          description: OK — the generated IPID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IpdIpidResponse'
              example:
                success: true
                data:
                  ipid: IPD1043
        '400':
          description: Bad Request — the IPID could not be generated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IpdServiceFailure'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IpdServiceError'
      deprecated: false
components:
  schemas:
    IpdIpidResponse:
      title: IpdIpidResponse
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            ipid:
              type: string
              description: The generated IPD case number.
    IpdServiceFailure:
      title: IpdServiceFailure
      type: object
      properties:
        success:
          type: boolean
          description: Always `false`.
        error:
          type: string
          description: Human-readable error message.
    IpdServiceError:
      title: IpdServiceError
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.

````

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