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

# Generate Message ID for Grouping Contacts

> Generate unique message ID for grouping contacts when sending status

## Description

This endpoint generates a unique message ID that can be used to group contacts when sending status (stories) on WhatsApp. The generated ID allows you to send the same status to different groups of contacts in an organized way.

## URL Parameters

<ParamField path="session" type="string" required>
  Unique authenticated session ID
</ParamField>

## Response

<ResponseField name="messageId" type="string" required>
  Unique message ID generated for grouping contacts
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
      "messageId": "3EB0796F91D8B2A4E053AC100F0A4D1E"
  }
  ```
</ResponseExample>

## Status Codes

* `200` - Message ID generated successfully
* `400` - Invalid parameters
* `401` - Unauthorized

## Usage Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://api.wappfy.com.br/api/my-session/status/new-message-id
  ```

  ```javascript JavaScript theme={null}
  const session = 'my-session';
  const response = await fetch(`https://api.wappfy.com.br/api/${session}/status/new-message-id`);
  const data = await response.json();
  console.log(data.messageId);
  ```

  ```python Python theme={null}
  import requests

  session = 'my-session'
  response = requests.get(f'https://api.wappfy.com.br/api/{session}/status/new-message-id')
  data = response.json()
  print(data['messageId'])
  ```
</CodeGroup>

## Notes

* The generated message ID can be reused to send the same status to multiple groups of contacts
* Status are temporary content (Stories) on WhatsApp that disappear after 24 hours
* Use this ID in conjunction with the status send endpoints to organize your publications


## OpenAPI

````yaml viewer-en.json get /api/{session}/status/new-message-id
openapi: 3.1.0
info:
  title: Wappfy - WhatsApp HTTP API
  version: '2.0'
  contact: {}
servers:
  - url: https://{host}
    description: Customizable Server
    variables:
      host:
        default: api.wappfy.com.br
        description: Server URL (e.g., api.wappfy.com.br or your-server.com)
security:
  - api_key: []
tags:
  - name: 🖥️ Sessions
    description: Control WhatsApp sessions (accounts)
  - name: 🔑 Auth
    description: Authentication
  - name: 🆔 Profile
    description: Your profile information
  - name: 🖼️ Screenshot
    description: Get WhatsApp screenshot and display QR code
  - name: 📤 Chatting
    description: Conversation methods
  - name: 📢 Channels
    description: Channels (newsletters) methods
  - name: 🟢 Status
    description: Status (aka stories) methods
  - name: 💬 Chats
    description: Conversations methods
  - name: 👤 Contacts
    description: |-
      Contacts methods.<br>
                      Use phone number (without +) or phone number and `@c.us` at the end as `contactId`.<br>
                      E.g: `12312312310` OR `12312312310@c.us`<br>
  - name: 👥 Groups
    description: Groups methods.<br>
  - name: ✅ Presence
    description: Presence information
  - name: 📅 Events
    description: Event Message
  - name: 🏷️ Labels
    description: Labels - available only for WhatsApp Business accounts
  - name: 🔍 Observability
    description: Other methods
  - name: 🗄️ Storage
    description: Storage methods
externalDocs:
  description: Wappfy - WhatsApp API
  url: https://docs.wappfy.com.br/
paths:
  /api/{session}/status/new-message-id:
    get:
      tags:
        - 🟢 Status
      summary: Generate message ID that you can use for batch contacts
      description: The {session} parameter must be the session's instanceName.
      operationId: StatusController_getNewMessageId
      parameters:
        - name: session
          required: true
          in: path
          description: Session name (instanceName)
          example: my-session
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewMessageIDResponse'
      security:
        - api_key: []
components:
  schemas:
    NewMessageIDResponse:
      type: object
      properties:
        id:
          type: string
          description: Pre-generated message id
          example: BBBBBBBBBBBBBBBBB
      required:
        - id
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Your Wappfy API key (get it at dash.wappfy.com.br)

````