Skip to content

Notifications

TIP

The details field may be returned as either a JSON object or a string by the VRChat API.
The shared.NotificationDetails type handles both transparently.

Methods

GetNotifications(ctx, opts)

Retrieve your notification list.

go
notifications, err := client.GetNotifications(ctx, shared.GetNotificationsOptions{
    Type:  "all",
    Sent:  false,
    N:     100,
    After: "2024-01-01T00:00:00.000Z",
})

Returns: ([]shared.Notification, error)


MarkNotificationAsRead(ctx, notificationId)

Mark a notification as read.

go
notification, err := client.MarkNotificationAsRead(ctx, "not_...")

DeleteNotification(ctx, notificationId)

Delete a notification.

go
notification, err := client.DeleteNotification(ctx, "not_...")

ClearAllNotifications(ctx)

Clear all notifications.

go
err := client.ClearAllNotifications(ctx)

SendNotification(ctx, req)

Send a notification to a user.

go
err := client.SendNotification(ctx, shared.SendNotificationRequest{
    UserID:  "usr_...",
    Type:    "message",
    Message: "Hello!",
})

SendInvite(ctx, userId, req)

Send an instance invite to a user.

go
err := client.SendInvite(ctx, "usr_...", shared.SendInviteRequest{
    InstanceLocation: "wrld_...:12345~private(...)",
    MessageSlot:      0,
})

RespondToInvite(ctx, notificationId, req)

Respond to an invite notification.

go
err := client.RespondToInvite(ctx, "not_...", shared.RespondToInviteRequest{
    ResponseSlot: 0,
})

RequestInvite(ctx, userId, instanceLocation)

Request an invite from a user.

go
err := client.RequestInvite(ctx, "usr_...", "wrld_...:12345")

Type Reference

shared.Notification

FieldTypeDescription
IDstringNotification ID
TypestringNotification type (invite, friendRequest, etc.)
MessagestringMessage content
SenderUserIDstringSender's user ID
SenderUsernamestringSender's username
DetailsNotificationDetailsExtra data (varies by type)
CreatedstringCreation timestamp
SeenboolWhether it has been read

Released under the Apache-2.0 License.