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

# Messages

> Every .NET SDK send function, accepted payloads, and complete examples

All send functions live under `client.Messages`.

In the SDK, the instance `id` becomes `InstanceId`, and the `X-Instance-Token` header becomes `InstanceToken`.

```csharp theme={null}
var instanceId = "VZ...";
var instanceToken = "instance-token";
var phone = "5511999999999";
```

## Common fields

Most send operations accept these fields:

| Field              | Type       | Required | Description                                            |
| ------------------ | ---------- | -------- | ------------------------------------------------------ |
| `InstanceId`       | `string`   | Yes      | VZaps instance ID.                                     |
| `InstanceToken`    | `string`   | Yes      | Instance token.                                        |
| `Phone`            | `string`   | Yes      | Destination phone in international digits-only format. |
| `id`               | `string`   | No       | Optional message identifier for the request.           |
| `delay`            | `number`   | No       | Send delay, when supported by the API.                 |
| `mentionedIds`     | `string[]` | No       | WhatsApp IDs to mention.                               |
| `replyToMessageId` | `string`   | No       | WhatsApp message ID to reply to or quote.              |

<Note>
  The SDK is typed, but models inherit from `VZapsModel` and accept `AdditionalData` for additional public API fields. For fully dynamic payloads, use `client.RequestAsync<TResponse>()`.
</Note>

## Text

Function: `client.Messages.SendTextAsync<TResponse>()`

Payload:

| Field     | Type     | Required |
| --------- | -------- | -------- |
| `Phone`   | `string` | Yes      |
| `Message` | `string` | Yes      |

```csharp theme={null}
await client.Messages.SendTextAsync<object>(new SendTextMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Message = "Hello, your instance is connected.",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Image

Function: `client.Messages.SendImageAsync<TResponse>()`

Payload:

| Field     | Type     | Required |
| --------- | -------- | -------- |
| `Phone`   | `string` | Yes      |
| `Image`   | `string` | Yes      |
| `Caption` | `string` | No       |

`Image` accepts a public `https://...` URL or a base64 data URL (`data:image/<mime>;base64,<data>`).

```csharp theme={null}
await client.Messages.SendImageAsync<object>(new SendImageMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Image = "https://cdn.example.com/photo.jpg",
    Caption = "Optional caption",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Audio

Function: `client.Messages.SendAudioAsync<TResponse>()`

Payload:

| Field   | Type     | Required |
| ------- | -------- | -------- |
| `Phone` | `string` | Yes      |
| `Audio` | `string` | Yes      |
| `Ptt`   | `bool`   | No       |

`Audio` accepts a public URL or base64 data URL (`data:audio/<mime>;base64,...`). Use `Ptt = true` when you want to send a voice note, if supported by the account flow.

```csharp theme={null}
await client.Messages.SendAudioAsync<object>(new SendAudioMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Audio = "https://cdn.example.com/audio.mp3",
    Ptt = false,
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Document

Function: `client.Messages.SendDocumentAsync<TResponse>()`

Payload:

| Field      | Type     | Required |
| ---------- | -------- | -------- |
| `Phone`    | `string` | Yes      |
| `Document` | `string` | Yes      |
| `FileName` | `string` | Yes      |
| `Caption`  | `string` | No       |

```csharp theme={null}
await client.Messages.SendDocumentAsync<object>(new SendDocumentMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Document = "https://cdn.example.com/contract.pdf",
    FileName = "contract.pdf",
    Caption = "Here is the contract",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Video

Function: `client.Messages.SendVideoAsync<TResponse>()`

Payload:

| Field           | Type     | Required |
| --------------- | -------- | -------- |
| `Phone`         | `string` | Yes      |
| `Video`         | `string` | Yes      |
| `Caption`       | `string` | No       |
| `jpegThumbnail` | `string` | No       |

```csharp theme={null}
await client.Messages.SendVideoAsync<object>(new SendVideoMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Video = "https://cdn.example.com/video.mp4",
    Caption = "Demo video",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Sticker

Function: `client.Messages.SendStickerAsync<TResponse>()`

Payload:

| Field          | Type     | Required |
| -------------- | -------- | -------- |
| `Phone`        | `string` | Yes      |
| `Sticker`      | `string` | Yes      |
| `pngThumbnail` | `string` | No       |

```csharp theme={null}
await client.Messages.SendStickerAsync<object>(new SendStickerMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Sticker = "https://cdn.example.com/sticker.webp",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## GIF

Function: `client.Messages.SendGifAsync<TResponse>()`

Payload:

| Field     | Type     | Required |
| --------- | -------- | -------- |
| `Phone`   | `string` | Yes      |
| `Gif`     | `string` | Yes      |
| `Caption` | `string` | No       |

```csharp theme={null}
await client.Messages.SendGifAsync<object>(new SendGifMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Gif = "https://media.giphy.com/media/example/giphy.gif",
    Caption = "Animated GIF",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Location

Function: `client.Messages.SendLocationAsync<TResponse>()`

Payload:

| Field       | Type     | Required |
| ----------- | -------- | -------- |
| `Phone`     | `string` | Yes      |
| `Latitude`  | `double` | Yes      |
| `Longitude` | `double` | Yes      |
| `Name`      | `string` | No       |
| `Address`   | `string` | No       |

```csharp theme={null}
await client.Messages.SendLocationAsync<object>(new SendLocationMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Latitude = -23.55052,
    Longitude = -46.633308,
    Name = "Sao Paulo",
    Address = "Sao Paulo, SP",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Contact

Function: `client.Messages.SendContactAsync<TResponse>()`

Payload:

| Field          | Type     | Required |
| -------------- | -------- | -------- |
| `Phone`        | `string` | Yes      |
| `ContactName`  | `string` | Yes      |
| `ContactPhone` | `string` | Yes      |

```csharp theme={null}
await client.Messages.SendContactAsync<object>(new SendContactMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    ContactName = "Maria Silva",
    ContactPhone = "5511888888888",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Buttons

Function: `client.Messages.SendButtonsAsync<TResponse>()`

Payload:

| Field     | Type                           | Required |
| --------- | ------------------------------ | -------- |
| `Phone`   | `string`                       | Yes      |
| `Message` | `string`                       | Yes      |
| `Buttons` | `IReadOnlyList<MessageButton>` | Yes      |
| `Footer`  | `string`                       | No       |

```csharp theme={null}
await client.Messages.SendButtonsAsync<object>(new SendButtonsMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Message = "Choose an option",
    Footer = "VZaps",
    Buttons = new[]
    {
        new MessageButton { Id = "sales", Text = "Sales" },
        new MessageButton { Id = "support", Text = "Support" },
    },
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## List

Function: `client.Messages.SendListAsync<TResponse>()`

Payload:

| Field         | Type                                | Required |
| ------------- | ----------------------------------- | -------- |
| `Phone`       | `string`                            | Yes      |
| `Title`       | `string`                            | Yes      |
| `Description` | `string`                            | Yes      |
| `ButtonText`  | `string`                            | Yes      |
| `Sections`    | `IReadOnlyList<MessageListSection>` | Yes      |
| `Footer`      | `string`                            | No       |

```csharp theme={null}
await client.Messages.SendListAsync<object>(new SendListMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Title = "Main menu",
    Description = "Choose an option",
    ButtonText = "Open menu",
    Sections = new[]
    {
        new MessageListSection
        {
            Title = "Departments",
            Rows = new[]
            {
                new MessageListRow { Id = "sales", Title = "Sales", Description = "Talk to sales" },
                new MessageListRow { Id = "support", Title = "Support", Description = "Talk to support" },
            },
        },
    },
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Link preview

Function: `client.Messages.SendLinkAsync<TResponse>()`

Payload:

| Field             | Type     | Required |
| ----------------- | -------- | -------- |
| `Phone`           | `string` | Yes      |
| `Message`         | `string` | Yes      |
| `LinkUrl`         | `string` | Yes      |
| `Title`           | `string` | Yes      |
| `LinkDescription` | `string` | Yes      |
| `JpegThumbnail`   | `string` | No       |

```csharp theme={null}
await client.Messages.SendLinkAsync<object>(new SendLinkMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Message = "Check this link",
    LinkUrl = "https://vzaps.com",
    Title = "VZaps",
    LinkDescription = "WhatsApp API for integrations",
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Poll

Function: `client.Messages.SendPollAsync<TResponse>()`

Payload:

| Field                    | Type                    | Required |
| ------------------------ | ----------------------- | -------- |
| `Phone`                  | `string`                | Yes      |
| `Name`                   | `string`                | Yes      |
| `Options`                | `IReadOnlyList<string>` | Yes      |
| `SelectableOptionsCount` | `int`                   | No       |
| `HideParticipantNames`   | `bool`                  | No       |
| `EndTime`                | `string`                | No       |
| `AllowAddOption`         | `bool`                  | No       |

```csharp theme={null}
await client.Messages.SendPollAsync<object>(new SendPollMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Name = "Which channel do you prefer?",
    Options = new[] { "WhatsApp", "Email", "Phone" },
    SelectableOptionsCount = 1,
});
```

**Return:** envelope `{ Code, Success, Data.MessageId }` — message accepted/queued.

## Vote in a poll

Function: `client.Messages.PollVoteAsync<TResponse>()`

```csharp theme={null}
await client.Messages.PollVoteAsync<object>(new MessagePollVoteRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    MessageId = "3EB020510113BAA6561C",
    SelectedOptions = new[] { "WhatsApp" },
});
```

## React and remove reaction

Functions:

* `client.Messages.ReactAsync<TResponse>()`
* `client.Messages.RemoveReactionAsync<TResponse>()`

```csharp theme={null}
await client.Messages.ReactAsync<object>(new MessageReactRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    MessageId = "3EB020510113BAA6561C",
    Reaction = "ok",
});

await client.Messages.RemoveReactionAsync<object>(new MessageReactRemoveRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    MessageId = "3EB020510113BAA6561C",
});
```

## Presence and read receipts

Functions:

* `client.Messages.PresenceAsync<TResponse>()`
* `client.Messages.MarkReadAsync<TResponse>()`

```csharp theme={null}
await client.Messages.PresenceAsync<object>(new MessagePresenceRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    State = "composing",
});

await client.Messages.MarkReadAsync<object>(new MessageMarkReadRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Id = new[] { "3EB020510113BAA6561C" },
    Chat = "5511999999999@s.whatsapp.net",
});
```

**Return:** envelope `{ Code, Success, Data.Details }`.

## Edit and delete message

Functions:

* `client.Messages.EditAsync<TResponse>()`
* `client.Messages.DeleteAsync<TResponse>()`

```csharp theme={null}
await client.Messages.EditAsync<object>(new MessageEditRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    MessageId = "3EB020510113BAA6561C",
    Message = "Edited text",
});

await client.Messages.DeleteAsync<object>(new MessageDeleteRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    MessageId = "3EB020510113BAA6561C",
});
```

## Download media

Functions:

* `DownloadImageAsync<TResponse>()`
* `DownloadVideoAsync<TResponse>()`
* `DownloadAudioAsync<TResponse>()`
* `DownloadDocumentAsync<TResponse>()`

```csharp theme={null}
var media = await client.Messages.DownloadImageAsync<object>(new MessageDownloadRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
});

Console.WriteLine(media);
```

**Return:** envelope `{ Code, Success, Data }` with `Data.Mimetype` and `Data.Data` (base64 or data URL).

## Standard response

Send methods return an API envelope indicating that the message was accepted/queued.

```csharp theme={null}
var result = await client.Messages.SendTextAsync<object>(new SendTextMessageRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    Phone = "5511999999999",
    Message = "Hello",
});

Console.WriteLine(result);
```

See the [API reference](/en/api-reference/introduction) for the latest response schemas.
