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

# Send Event Message

> Send event message to a contact or group with date, time, and location information

## Description

This endpoint allows you to send event messages to individual contacts or groups on WhatsApp. Events can include information about name, description, time, location, and permission for extra guests.

## URL Parameters

<ParamField path="session" type="string" required>
  Authenticated session ID that will send the event
</ParamField>

## Body

```json theme={null}
{
  "jid": "5511999999999@s.whatsapp.net",
  "event": {
    "name": "Team Meeting",
    "description": "Description",
    "startTime": 0,
    "endTime": 0,
    "location": {
      "name": "Team Meeting",
      "latitude": -23.5505,
      "longitude": -46.6333
    },
    "extraGuestsAllowed": true
  }
}
```

### Body Parameters

| Property                   | Type      | Required | Description                                                                                                               |
| -------------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| `jid`                      | `string`  | ✅ Yes    | Recipient identifier (WhatsApp JID). Format: `5511999999999@s.whatsapp.net` for contacts or `120363XXXXX@g.us` for groups |
| `event`                    | `object`  | ✅ Yes    | Object containing event information                                                                                       |
| `event.name`               | `string`  | ✅ Yes    | Name of the event                                                                                                         |
| `event.description`        | `string`  | ❌ No     | Event description                                                                                                         |
| `event.startTime`          | `number`  | ✅ Yes    | Unix timestamp (in milliseconds) indicating the event start time                                                          |
| `event.endTime`            | `number`  | ❌ No     | Unix timestamp (in milliseconds) indicating the event end time                                                            |
| `event.location`           | `object`  | ✅ Yes    | Event location information                                                                                                |
| `event.location.name`      | `string`  | ✅ Yes    | Location name or address                                                                                                  |
| `event.location.latitude`  | `number`  | ❌ No     | Location latitude                                                                                                         |
| `event.location.longitude` | `number`  | ❌ No     | Location longitude                                                                                                        |
| `event.extraGuestsAllowed` | `boolean` | ✅ Yes    | Defines whether extra guests are allowed at the event                                                                     |

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "messageId": "3EB0XXXXXX"
  }
  ```
</ResponseExample>

## Status Codes

* `200` - Event sent successfully
* `400` - Invalid parameters
* `401` - Unauthorized session
* `404` - Session not found

## Usage Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.com.br/api/my-session/events \
    -H "Content-Type: application/json" \
    -d '{
      "jid": "5511999999999@s.whatsapp.net",
      "event": {
        "name": "Reunião de Equipe",
        "description": "Discussion about Q1 project",
        "startTime": 1704034800000,
        "endTime": 1704038400000,
        "location": {
          "name": "Conference Room A, 1000 Main Street",
          "latitude": -23.561684,
          "longitude": -46.655981
        },
        "extraGuestsAllowed": true
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.wappfy.com.br/api/my-session/events', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      jid: '5511999999999@s.whatsapp.net',
      event: {
        name: 'Team Meeting',
        description: 'Discussion about Q1 project',
        startTime: 1704034800000,
        endTime: 1704038400000,
        location: {
          name: 'Conference Room A, 1000 Main Street',
          latitude: -23.561684,
          longitude: -46.655981
        },
        extraGuestsAllowed: true
      }
    })
  });
  const data = await response.json();
  console.log(data);
  ```

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

  response = requests.post(
      'https://api.wappfy.com.br/api/my-session/events',
      json={
          'jid': '5511999999999@s.whatsapp.net',
          'event': {
              'name': 'Team Meeting',
              'description': 'Discussion about Q1 project',
              'startTime': 1704034800000,
              'endTime': 1704038400000,
              'location': {
                  'name': 'Conference Room A, 1000 Main Street',
                  'latitude': -23.561684,
                  'longitude': -46.655981
              },
              'extraGuestsAllowed': True
          }
      }
  )
  data = response.json()
  print(data)
  ```
</CodeGroup>

## Important Notes

* Timestamps must be in Unix format (milliseconds)
* Location is required, but latitude and longitude are optional
* If `extraGuestsAllowed` is `true`, guests will be able to bring additional people
* The event will be displayed on WhatsApp with a special card containing all provided information


## OpenAPI

````yaml viewer-en.json post /api/{session}/events
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}/events:
    post:
      tags:
        - 📅 Events
      summary: Send an event message
      description: The {session} parameter must be the session's instanceName.
      operationId: EventsController_sendEvent
      parameters:
        - name: session
          required: true
          in: path
          description: Session name (instanceName)
          example: my-session
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventMessageRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WAMessage'
      security:
        - api_key: []
components:
  schemas:
    EventMessageRequest:
      type: object
      properties:
        chatId:
          type: string
          example: 5511999999999@c.us
        reply_to:
          type: string
          description: Message ID you want to reply to
          example: null
        event:
          $ref: '#/components/schemas/EventMessage'
      required:
        - chatId
        - event
    WAMessage:
      type: object
      properties:
        id:
          type: string
          description: Message ID
          example: false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA
        timestamp:
          type: number
          description: Unix timestamp of when the message was created
          example: 1666943582
        from:
          type: string
          description: Chat ID to which this message was sent
          example: 5511999999999@c.us
        fromMe:
          type: boolean
          description: Indicates if the message was sent by the current user
        source:
          enum:
            - api
            - app
          type: string
          description: >-
            The device that sent the message - either API or APP. Available in
            events (webhooks/websockets) only and only "fromMe: true" messages.
          example: api
        to:
          type: string
          description: >-
            * ID for who this message is for.

            * If the message is sent by the current user, it will be the Chat to
            which the message is being sent.

            * If the message is sent by another user, it will be the ID for the
            current user.
          example: 5511999999999@c.us
        participant:
          type: string
          description: For groups - participant who sent the message
        body:
          type: string
          description: Message content
        hasMedia:
          type: boolean
          description: Indicates if the message has media available for download
        media:
          description: Message media object, if any and downloaded
          allOf:
            - $ref: '#/components/schemas/WAMedia'
        ack:
          enum:
            - -1
            - 0
            - 1
            - 2
            - 3
            - 4
          type: number
          description: Message acknowledgement (ACK) status
        ackName:
          type: string
          description: Message acknowledgement status name
        author:
          type: string
          description: >-
            If the message was sent to a group, this field will contain the user
            who sent the message
        location:
          description: Location information contained in the message
          allOf:
            - $ref: '#/components/schemas/WALocation'
        vCards:
          description: List of vCards contained in the message
          type: array
          items:
            type: string
        _data:
          type: object
          description: >-
            Message in raw WhatsApp format. May change at any time, use with
            caution!
        replyTo:
          $ref: '#/components/schemas/ReplyToMessage'
      required:
        - id
        - timestamp
        - from
        - fromMe
        - source
        - to
        - participant
        - body
        - hasMedia
        - mediaUrl
        - ack
        - ackName
    EventMessage:
      type: object
      properties:
        name:
          type: string
          description: Name of the event
          example: John's Nail Appointment 💅
        description:
          type: string
          description: Description of the event
          example: >-
            It's time for your nail care session! 🌟\n\nYou'll be getting a
            *classic gel manicure* – clean, polished, and long-lasting. 💖\n\n📍
            *Location:* Luxe Nail Studio\nWe're on the *2nd floor of the Plaza
            Mall*, next to the flower shop. Look for the *pink neon
            sign*!\n\nFeel free to arrive *5–10 mins early* so we can get
            started on time 😊
        startTime:
          type: number
          description: Start time of the event
          example: 2063137000
        endTime:
          type: number
          description: End time of the event
          example: null
        location:
          description: Location of the event
          allOf:
            - $ref: '#/components/schemas/EventLocation'
        extraGuestsAllowed:
          type: boolean
          description: Whether extra guests are allowed
          example: false
      required:
        - name
        - startTime
    WAMedia:
      type: object
      properties:
        url:
          type: string
          description: Media URL in the message, if any
          example: >-
            http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga
        mimetype:
          type: string
          description: Media MIME type in the message
          example: audio/jpeg
        filename:
          type: string
          description: Original media file name
          example: example.pdf
        s3:
          description: Media S3 attributes if you are using S3 storage
          allOf:
            - $ref: '#/components/schemas/S3MediaData'
        error:
          type: object
          description: Error message when downloading media
          example: null
    WALocation:
      type: object
      properties:
        description:
          type: string
        latitude:
          type: string
        longitude:
          type: string
      required:
        - latitude
        - longitude
    ReplyToMessage:
      type: object
      properties:
        id:
          type: string
          description: Message ID
          example: AAAAAAAAAAAAAAAAAAAA
        participant:
          type: string
          example: 5511999999999@c.us
        body:
          type: string
          example: Hello!
        _data:
          type: object
          description: Raw data from reply's message
      required:
        - id
    EventLocation:
      type: object
      properties:
        name:
          type: string
          description: Name of the location
          example: Luxe Nail Studio 💅
      required:
        - name
    S3MediaData:
      type: object
      properties:
        Bucket:
          type: string
          description: Nome do bucket S3
          example: my-bucket
        Key:
          type: string
          description: S3 bucket object key
          example: default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga
      required:
        - Bucket
        - Key
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apikey
      description: Your Wappfy API key (get it at dash.wappfy.com.br)

````