Skip to main content
Use these resources for account authentication, instance lifecycle, and billing. For WhatsApp session flows, see Session. For chats, see Chats. For message sending, see Messages.

Auth

client.Auth.GetAccessTokenAsync()

Gets a JWT using ClientToken and ClientSecret. The SDK caches and refreshes the token automatically.
var token = await client.Auth.GetAccessTokenAsync();
Return: string JWT access token (accessToken from POST /token).

Instances and billing

client.Instances.CreateAsync<TResponse>(request)

await client.Instances.CreateAsync<object>(new InstanceCreateRequest
{
    Name = "support",
    Webhook = "https://example.com/webhook",
    EventsSubscribe = new[] { "Message", "Connected" },
});
Return: InstancePublicCreateResponseId, Name, token, Url, Webhook, EventsSubscribe, Status, CreatedAt, UpdatedAt.

client.Instances.ListAsync<TResponse>(request?)

await client.Instances.ListAsync<object>(new InstanceListRequest
{
    Page = 1,
    PageSize = 20,
    Search = "support",
});
Return: page { Page, Size, Total, TotalPages, Content[], Summary }. Each content item uses the public instance summary shape.

client.Instances.GetAsync<TResponse>(instanceId)

await client.Instances.GetAsync<object>("VZ...");
Return: same summary shape as one Instances.List() item (Id, Name, token, Url, Webhook, Status, etc.).

client.Instances.UpdateAsync<TResponse>(instanceId, body, options?)

await client.Instances.UpdateAsync<object>(
    "VZ...",
    new { name = "support-updated" },
    new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: updated instance in the same summary shape as Instances.Get().

client.Instances.RestartAsync<TResponse>(instanceId, options?)

await client.Instances.RestartAsync<object>("VZ...", new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: InstanceActionResponseInstanceId, Status, Details.

client.Instances.DeleteAsync<TResponse>(instanceId, options?)

await client.Instances.DeleteAsync<object>("VZ...", new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: empty body on success (204) or the standard error envelope.

client.Instances.SubscribeAsync<TResponse>(instanceId, body?, options?)

await client.Instances.SubscribeAsync<object>(
    "VZ...",
    new { plan = "direct" },
    new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: BillingHostedSessionUrl, SessionId, mode (direct or checkout), SubscriptionId.

client.Instances.ResumeSubscriptionAsync<TResponse>(instanceId, options?)

await client.Instances.ResumeSubscriptionAsync<object>("VZ...", new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: { Status: "ok" }.

client.Instances.CancelAsync<TResponse>(instanceId, options?)

await client.Instances.CancelAsync<object>("VZ...", new InstanceRequestOptions { InstanceToken = "instance-token" });
Return: { Message } confirming cancellation or scheduled cancel.

Advanced calls

Use RequestAsync<TResponse>() when you need a newly released field or endpoint not yet wrapped by a typed method.
await client.RequestAsync<object>(
    HttpMethod.Post,
    "/instances/VZ.../chat/send/text",
    new VZaps.Http.VZapsRequestOptions
    {
        InstanceToken = "instance-token",
        Body = new { phone = "5511999999999", message = "Hello" },
    });