# StanzaJS API Reference
acceptSubscription
```
(jid: string) => void
```
addBookmark
```
(bookmark: MUCBookmark) => Promise
```
ban
```
(jid: string, occupant: string, reason: string) => Promise
```
block
```
(jid: string) => Promise
```
changeNick
```
(room: string, nick: string) => void
```
```
(jid: string, node: string, config: DataForm) => Promise
```
```
(room: string, form: Partial) => Promise
```
connect
```
(opts: AgentConfig) => void
```
createNode
```
(jid: string, node: string, config: DataForm) => Promise
```
declineInvite
```
(room: string, sender: string, reason: string) => void
```
deleteAccount
```
(jid: string) => Promise
```
deleteNode
```
(jid: string, node: string) => Promise
```
denySubscription
```
(jid: string) => void
```
destroyRoom
```
(room: string, opts: MUCDestroy) => Promise
```
directInvite
```
(room: string, to: string, opts: Partial) => void
```
disableCarbons
```
() => Promise
```
disableKeepAlive
```
() => void
```
disableNotifications
```
(jid: string, node: string) => Promise
```
disconnect
```
() => void
```
discoverBindings
```
(server: string) => Promise
```
discoverICEServers
```
(opts: { version: 2 | 1 }) => Promise
```
enableCarbons
```
() => Promise
```
enableKeepAlive
```
(opts: KeepAliveOptions) => void
```
enableNotifications
```
(jid: string, node: string, fieldList: DataFormField[]) => Promise
```
getAccountInfo
```
(jid: string) => Promise
```
getAffiliations
```
(jid: string, node: string) => Promise
```
getAttention
```
(jid: string, opts: Partial) => void
```
getAvatar
```
(jid: string, id: string) => Promise
```
getBits
```
(jid: string, cid: string) => Promise
```
getBlocked
```
() => Promise
```
getBookmarks
```
() => Promise
```
getCommands
```
(jid: string) => Promise
```
getCredentials
```
() => Promise
```
getCurrentCaps
```
() => { info: DiscoNodeInfo; legacyCapabilities: LegacyEntityCaps[] }
```
getDefaultNodeConfig
```
(jid: string) => Promise
```
getDefaultSubscriptionOptions
```
(jid: string) => Promise
```
getDiscoInfo
```
(jid: string, node: string) => Promise
```
getDiscoItems
```
(jid: string, node: string) => Promise
```
getHistoryPreferences
```
() => Promise
```
getHistorySearchForm
```
(jid: string) => Promise
```
getItem
```
(jid: string, node: string, id: string) => Promise
```
getItems
```
(jid: string, node: string, opts: Paging) => Promise
```
getLastActivity
```
(jid: string) => Promise
```
getNodeAffiliations
```
(jid: string, node: string) => Promise
```
getNodeConfig
```
(jid: string, node: string) => Promise
```
getNodeSubscribers
```
(jid: string, node: string | PubsubSubscriptions, opts: PubsubSubscriptions) => Promise
```
getPrivateData
```
(key: ) => Promise
```
getReservedNick
```
(room: string) => Promise
```
getRoomConfig
```
(room: string) => Promise
```
getRoomMembers
```
(room: string, opts: MUCUserItem) => Promise
```
getRoster
```
() => Promise
```
getServiceCredentials
```
(jid: string, host: string, type: string, port: number, version: 2 | 1) => Promise
```
getServices
```
(jid: string, type: string, version: 2 | 1) => Promise
```
getSoftwareVersion
```
(jid: string) => Promise
```
getSubscriptions
```
(jid: string, opts: PubsubSubscriptions) => Promise
```
getTime
```
(jid: string) => Promise
```
getUniqueRoomName
```
(mucHost: string) => Promise
```
getUploadService
```
(domain: string) => Promise
```
getUploadSlot
```
(jid: string, request: HTTPUploadRequest) => Promise
```
getVCard
```
(jid: string) => Promise
```
goInvisible
```
(probe: false | true) => Promise
```
goVisible
```
() => Promise
```
invite
```
(room: string, invites: MUCInvite | MUCInvite[]) => void
```
joinRoom
```
(jid: string, nick: string, opts: Presence) => void
```
kick
```
(jid: string, nick: string, reason: string) => Promise
```
leaveRoom
```
(jid: string, nick: string, opts: Presence) => void
```
markAcknowledged
```
(msg: Message) => void
```
markActive
```
() => void
```
markDisplayed
```
(msg: Message) => void
```
markInactive
```
() => void
```
markReceived
```
(msg: Message) => void
```
nextId
```
() => string
```
ping
```
(jid: string) => Promise
```
publish
```
(jid: string, node: string, item: , id: string) => Promise
```
publishActivity
```
(data: UserActivity) => Promise
```
publishAvatar
```
(id: string, data: Buffer) => Promise
```
publishGeoLoc
```
(data: Geolocation) => Promise
```
publishMood
```
(mood: UserMood) => Promise
```
publishNick
```
(nick: string) => Promise
```
publishTune
```
(tune: UserTune) => Promise
```
publishVCard
```
(vcard: VCardTemp) => Promise
```
purgeNode
```
(jid: string, node: string) => Promise
```
registerFeature
```
(name: string, priority: number, handler: FeatureHandler) => void
```
removeBookmark
```
(jid: string) => Promise
```
removeRosterItem
```
(jid: string) => Promise
```
requestRoomVoice
```
(room: string) => void
```
retract
```
(jid: string, node: string, id: string, notify: boolean) => Promise
```
searchHistory
```
(opts: Partial) => Promise
(jid: string, opts: MAMQuery) => Promise
```
send
```
(path: , data: TopLevelElements[T]) => Promise
```
sendIQ
```
(iq: & IQ) => Promise
```
sendIQError
```
(orig: IQ, err: Partial) => void
```
sendIQResult
```
(orig: IQ, result: Partial) => void
```
sendMessage
```
(msg: Message) => string
```
sendPresence
```
(pres: Presence) => string
```
sendStreamError
```
(err: StreamError) => void
```
setBookmarks
```
(bookmarks: MUCBookmark[]) => Promise
```
setHistoryPreferences
```
(opts: Partial) => Promise
```
setPrivateData
```
(key: , data: PrivateStorage[T]) => Promise
```
setRoomAffiliation
```
(room: string, jid: string, affiliation: MUCAffiliation, reason: string) => Promise
```
setRoomRole
```
(room: string, nick: string, role: MUCRole, reason: string) => Promise
```
setSubject
```
(room: string, subject: string) => void
```
subscribe
```
(jid: string) => void
```
subscribeToNode
```
(jid: string, opts: string | PubsubSubscribeWithOptions) => Promise
```
unblock
```
(jid: string) => Promise
```
unsubscribe
```
(jid: string) => void
```
unsubscribeFromNode
```
(jid: string, opts: string | PubsubUnsubscribeOptions) => Promise
```
updateAccount
```
(jid: string, data: AccountManagement) => Promise
```
updateCaps
```
() => LegacyEntityCaps[]
```
updateConfig
```
(opts: AgentConfig) => void
```
updateNodeAffiliations
```
(jid: string, node: string, items: PubsubAffiliation[]) => Promise
```
updateNodeSubscriptions
```
(jid: string, node: string, delta: PubsubSubscription[]) => Promise
```
updateRosterItem
```
(item: RosterItem) => Promise
```
use
```
(plugin: (agent: Agent, registry: Registry, config: AgentConfig) => void) => void
```
useAvatars
```
(versions: AvatarVersion[], pointers: AvatarPointer[]) => Promise
```