Appearance
Common
About 5811 wordsAbout 19 min
Typescript SDK - Chat API
Table of Contents
- getApp
- listBlockLists
- createBlockList
- updateBlockList
- deleteBlockList
- listDevices
- createDevice
- deleteDevice
- createGuest
- longPoll
- getOG
- createPoll
- updatePoll
- queryPolls
- getPoll
- updatePollPartial
- deletePoll
- createPollOption
- updatePollOption
- getPollOption
- deletePollOption
- queryPollVotes
- updatePushNotificationPreferences
- uploadFile
- deleteFile
- uploadImage
- deleteImage
- queryUsers
- updateUsers
- updateUsersPartial
- getBlockedUsers
- blockUsers
- getUserLiveLocations
- updateLiveLocation
- unblockUsers
- Types Reference
getApp
Get App Settings
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get App Settings
const response = await client.chat.getApp();
console.log(response);Response: GetApplicationResponse
listBlockLists
List block lists
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// List block lists
const response = await client.chat.listBlockLists({
team: 'value',
});
console.log(response);Response: ListBlockListResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| team | string | No | - |
createBlockList
Create block list
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Create block list
const response = await client.chat.createBlockList({
name: 'My Feed',
words: [],
type: 'like',
is_plural_check_enabled: false,
});
console.log(response);Response: CreateBlockListResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Block list name |
| words | []string | Yes | List of words to block |
| is_leet_check_enabled | boolean | No | - |
| is_plural_check_enabled | boolean | No | - |
| team | string | No | - |
| type | string | No | Block list type. |
updateBlockList
Update block list
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Update block list
const response = await client.chat.updateBlockList({
name: 'My Feed',
is_leet_check_enabled: false,
is_plural_check_enabled: false,
});
console.log(response);Response: UpdateBlockListResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
| is_leet_check_enabled | boolean | No | - |
| is_plural_check_enabled | boolean | No | - |
| team | string | No | - |
| words | []string | No | List of words to block |
deleteBlockList
Delete block list
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete block list
const response = await client.chat.deleteBlockList({
name: 'My Feed',
team: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | - |
| team | string | No | - |
listDevices
List devices
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// List devices
const response = await client.chat.listDevices();
console.log(response);Response: ListDevicesResponse
createDevice
Create device
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Create device
const response = await client.chat.createDevice({
id: 'activity-123',
push_provider: 'value',
push_provider_name: 'value',
voip_token: false,
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Device ID |
| push_provider | string | Yes | Push provider |
| push_provider_name | string | No | Push provider name |
| voip_token | boolean | No | When true the token is for Apple VoIP push notifications |
deleteDevice
Delete device
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete device
const response = await client.chat.deleteDevice({
id: 'activity-123',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | - |
createGuest
Create Guest
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Create Guest
const response = await client.chat.createGuest({
user: { id: "john" },
});
console.log(response);Response: CreateGuestResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user | UserRequest | Yes | User object which server acts upon |
longPoll
Long Poll (Transport)
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Long Poll (Transport)
const response = await client.chat.longPoll({
json: 'value',
connection_id: 'value',
});
console.log(response);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| json | No | - | |
| connection_id | string | No | - |
getOG
Get OG
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get OG
const response = await client.chat.getOG({
url: 'value',
});
console.log(response);Response: GetOGResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | - |
createPoll
Create poll
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Create poll
const response = await client.chat.createPoll({
name: 'My Feed',
id: 'activity-123',
allow_answers: false,
});
console.log(response);Response: PollResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | The name of the poll |
| Custom | Record<string, any> | No | - |
| allow_answers | boolean | No | Indicates whether users can suggest user defined answers |
| allow_user_suggested_options | boolean | No | - |
| description | string | No | A description of the poll |
| enforce_unique_vote | boolean | No | Indicates whether users can cast multiple votes |
| id | string | No | - |
| is_closed | boolean | No | Indicates whether the poll is open for voting |
| max_votes_allowed | number | No | Indicates the maximum amount of votes a user can cast |
| options | []PollOptionInput | No | - |
| voting_visibility | string | No | - |
updatePoll
Update poll
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Update poll
const response = await client.chat.updatePoll({
id: 'activity-123',
name: 'My Feed',
Custom: {},
allow_answers: false,
});
console.log(response);Response: PollResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Poll ID |
| name | string | Yes | Poll name |
| Custom | Record<string, any> | No | - |
| allow_answers | boolean | No | Allow answers |
| allow_user_suggested_options | boolean | No | Allow user suggested options |
| description | string | No | Poll description |
| enforce_unique_vote | boolean | No | Enforce unique vote |
| is_closed | boolean | No | Is closed |
| max_votes_allowed | number | No | Max votes allowed |
| options | []PollOptionRequest | No | Poll options |
| voting_visibility | string | No | Voting visibility |
queryPolls
Query polls
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query polls
const response = await client.chat.queryPolls({
user_id: 'john',
limit: 25,
filter: {},
});
console.log(response);Response: QueryPollsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | No | - |
| filter | Record<string, any> | No | Filter to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
getPoll
Get poll
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get poll
const response = await client.chat.getPoll({
poll_id: 'poll-123',
user_id: 'john',
});
console.log(response);Response: PollResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| user_id | string | No | - |
updatePollPartial
Partial update poll
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Partial update poll
const response = await client.chat.updatePollPartial({
poll_id: 'poll-123',
set: {},
unset: [],
});
console.log(response);Response: PollResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| set | Record<string, any> | No | Sets new field values |
| unset | []string | No | Array of field names to unset |
deletePoll
Delete poll
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete poll
const response = await client.chat.deletePoll({
poll_id: 'poll-123',
user_id: 'john',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| user_id | string | No | - |
createPollOption
Create poll option
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Create poll option
const response = await client.chat.createPollOption({
poll_id: 'poll-123',
text: 'Hello, world!',
Custom: {},
});
console.log(response);Response: PollOptionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| text | string | Yes | Option text |
| Custom | Record<string, any> | No | - |
updatePollOption
Update poll option
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Update poll option
const response = await client.chat.updatePollOption({
poll_id: 'poll-123',
id: 'activity-123',
text: 'Hello, world!',
Custom: {},
});
console.log(response);Response: PollOptionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| id | string | Yes | Option ID |
| text | string | Yes | Option text |
| Custom | Record<string, any> | No | - |
getPollOption
Get poll option
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get poll option
const response = await client.chat.getPollOption({
poll_id: 'poll-123',
option_id: 'value',
user_id: 'john',
});
console.log(response);Response: PollOptionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| option_id | string | Yes | - |
| user_id | string | No | - |
deletePollOption
Delete poll option
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete poll option
const response = await client.chat.deletePollOption({
poll_id: 'poll-123',
option_id: 'value',
user_id: 'john',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| option_id | string | Yes | - |
| user_id | string | No | - |
queryPollVotes
Query votes
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query votes
const response = await client.chat.queryPollVotes({
poll_id: 'poll-123',
user_id: 'john',
limit: 25,
});
console.log(response);Response: PollVotesResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| poll_id | string | Yes | - |
| user_id | string | No | - |
| filter | Record<string, any> | No | Filter to apply to the query |
| limit | number | No | - |
| next | string | No | - |
| prev | string | No | - |
| sort | []SortParamRequest | No | Array of sort parameters |
updatePushNotificationPreferences
Push notification preferences
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Push notification preferences
const response = await client.chat.updatePushNotificationPreferences({
preferences: [],
});
console.log(response);Response: UpsertPushPreferencesResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| preferences | []PushPreferenceInput | Yes | A list of push preferences for channels, calls, or the user. |
uploadFile
Upload file
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Upload file
const response = await client.chat.uploadFile({
file: 'value',
user: { id: "john" },
});
console.log(response);Response: FileUploadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | string | No | file field |
| user | OnlyUserID | No | user for the request server side only |
deleteFile
Delete file
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete file
const response = await client.chat.deleteFile({
url: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | No | - |
uploadImage
Upload image
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Upload image
const response = await client.chat.uploadImage({
file: 'value',
upload_sizes: [],
user: { id: "john" },
});
console.log(response);Response: ImageUploadResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | string | No | - |
| upload_sizes | []ImageSize | No | field with JSON-encoded array of image size configurations |
| user | OnlyUserID | No | - |
deleteImage
Delete image
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Delete image
const response = await client.chat.deleteImage({
url: 'value',
});
console.log(response);Response: Response
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | No | - |
queryUsers
Query users
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Query users
const response = await client.chat.queryUsers({
payload: 'value',
});
console.log(response);Response: QueryUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| payload | No | - |
updateUsers
Upsert users
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Upsert users
const response = await client.chat.updateUsers({
users: {},
});
console.log(response);Response: UpdateUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| users | Record<string, any> | Yes | Object containing users |
updateUsersPartial
Partially update user
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Partially update user
const response = await client.chat.updateUsersPartial({
users: [],
});
console.log(response);Response: UpdateUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| users | []UpdateUserPartialRequest | Yes | - |
getBlockedUsers
Get list of blocked Users
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get list of blocked Users
const response = await client.chat.getBlockedUsers();
console.log(response);Response: GetBlockedUsersResponse
blockUsers
Block user
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Block user
const response = await client.chat.blockUsers({
blocked_user_id: 'value',
});
console.log(response);Response: BlockUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| blocked_user_id | string | Yes | User id to block |
getUserLiveLocations
Get user live locations
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Get user live locations
const response = await client.chat.getUserLiveLocations();
console.log(response);Response: SharedLocationsResponse
updateLiveLocation
Update live location
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Update live location
const response = await client.chat.updateLiveLocation({
message_id: 'value',
end_at: 10,
latitude: 10,
});
console.log(response);Response: SharedLocationResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message_id | string | Yes | Live location ID |
| end_at | float | No | Time when the live location expires |
| latitude | float | No | Latitude coordinate |
| longitude | float | No | Longitude coordinate |
unblockUsers
Unblock user
Example
import { StreamChat } from 'stream-chat';
const client = StreamChat.getInstance(apiKey);
await client.connectUser({ id: 'john' }, userToken);
// Unblock user
const response = await client.chat.unblockUsers({
blocked_user_id: 'value',
});
console.log(response);Response: UnblockUsersResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| blocked_user_id | string | Yes | - |
Types Reference
This section documents the types/interfaces used in this API. These types are extracted from the OpenAPI specification.
Action
interface Action {
name: string;
style?: string;
text: string;
type: string;
value?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | |
| text | string | Yes | |
| type | string | Yes | |
| style | string | No | |
| value | string | No |
AppResponseFields
interface AppResponseFields {
async_url_enrich_enabled: boolean;
auto_translation_enabled: boolean;
file_upload_config: FileUploadConfig;
id: number;
image_upload_config: FileUploadConfig;
name: string;
placement: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async_url_enrich_enabled | boolean | Yes | |
| auto_translation_enabled | boolean | Yes | |
| file_upload_config | FileUploadConfig | Yes | |
| id | number | Yes | |
| image_upload_config | FileUploadConfig | Yes | |
| name | string | Yes | |
| placement | string | Yes |
BlockListResponse
Block list contains restricted words
interface BlockListResponse {
created_at?: number;
id?: string;
is_leet_check_enabled: boolean;
is_plural_check_enabled: boolean;
name: string;
team?: string;
type: string;
updated_at?: number;
words: string[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| is_leet_check_enabled | boolean | Yes | |
| is_plural_check_enabled | boolean | Yes | |
| name | string | Yes | Block list name |
| type | string | Yes | Block list type. |
| words | string[] | Yes | List of words to block |
| created_at | number | No | Date/time of creation |
| id | string | No | |
| team | string | No | |
| updated_at | number | No | Date/time of the last update |
BlockUsersResponse
interface BlockUsersResponse {
blocked_by_user_id: string;
blocked_user_id: string;
created_at: number;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocked_by_user_id | string | Yes | User id who blocked another user |
| blocked_user_id | string | Yes | User id who got blocked |
| created_at | number | Yes | Timestamp when the user was blocked |
| duration | string | Yes | Duration of the request in milliseconds |
BlockedUserResponse
interface BlockedUserResponse {
blocked_user: UserResponse;
blocked_user_id: string;
created_at: number;
user: UserResponse;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocked_user | UserResponse | Yes | User who got blocked |
| blocked_user_id | string | Yes | ID of the user who got blocked |
| created_at | number | Yes | |
| user | UserResponse | Yes | User who blocked another user |
| user_id | string | Yes | ID of the user who blocked another user |
ChannelResponse
Represents channel in chat
interface ChannelResponse {
auto_translation_enabled?: boolean;
auto_translation_language?: string;
blocked?: boolean;
cid: string;
config?: ChannelConfigWithInfo;
cooldown?: number;
created_at: number;
created_by?: UserResponse;
custom: Record<string, any>;
deleted_at?: number;
disabled: boolean;
filter_tags?: string[];
frozen: boolean;
hidden?: boolean;
hide_messages_before?: number;
id: string;
last_message_at?: number;
member_count?: number;
members?: ChannelMemberResponse[];
message_count?: number;
mute_expires_at?: number;
muted?: boolean;
own_capabilities?: ChannelOwnCapability[];
team?: string;
truncated_at?: number;
truncated_by?: UserResponse;
type: string;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| cid | string | Yes | Channel CID (<type>:<id>) |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | Custom data for this object |
| disabled | boolean | Yes | |
| frozen | boolean | Yes | Whether channel is frozen or not |
| id | string | Yes | Channel unique ID |
| type | string | Yes | Type of the channel |
| updated_at | number | Yes | Date/time of the last update |
| auto_translation_enabled | boolean | No | Whether auto translation is enabled or not |
| auto_translation_language | string | No | Language to translate to when auto translation is active |
| blocked | boolean | No | Whether this channel is blocked by current user or not |
| config | ChannelConfigWithInfo | No | Channel configuration |
| cooldown | number | No | Cooldown period after sending each message |
| created_by | UserResponse | No | Creator of the channel |
| deleted_at | number | No | Date/time of deletion |
| filter_tags | string[] | No | List of filter tags associated with the channel |
| hidden | boolean | No | Whether this channel is hidden by current user or not |
| hide_messages_before | number | No | Date since when the message history is accessible |
| last_message_at | number | No | Date of the last message sent |
| member_count | number | No | Number of members in the channel |
| members | ChannelMemberResponse[] | No | List of channel members (max 100) |
| message_count | number | No | Number of messages in the channel |
| mute_expires_at | number | No | Date of mute expiration |
| muted | boolean | No | Whether this channel is muted or not |
| own_capabilities | ChannelOwnCapability[] | No | List of channel capabilities of authenticated user |
| team | string | No | Team the channel belongs to (multi-tenant only) |
| truncated_at | number | No | Date of the latest truncation of the channel |
| truncated_by | UserResponse | No |
CreateBlockListResponse
Basic response information
interface CreateBlockListResponse {
blocklist?: BlockListResponse;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| blocklist | BlockListResponse | No |
CreateGuestResponse
interface CreateGuestResponse {
access_token: string;
duration: string;
user: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| access_token | string | Yes | the access token to authenticate the user |
| duration | string | Yes | Duration of the request in milliseconds |
| user | UserResponse | Yes | User object which server acts upon |
Device
interface Device {
created_at: number;
disabled?: boolean;
disabled_reason?: string;
id: string;
push_provider: 'firebase' | 'apn' | 'huawei' | 'xiaomi';
push_provider_name?: string;
user_id: string;
voip?: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| id | string | Yes | |
| push_provider | 'firebase' | 'apn' | 'huawei' |
| user_id | string | Yes | |
| disabled | boolean | No | |
| disabled_reason | string | No | |
| push_provider_name | string | No | |
| voip | boolean | No |
DeviceResponse
Response for Device
interface DeviceResponse {
created_at: number;
disabled?: boolean;
disabled_reason?: string;
id: string;
push_provider: string;
push_provider_name?: string;
user_id: string;
voip?: boolean;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | Date/time of creation |
| id | string | Yes | Device ID |
| push_provider | string | Yes | Push provider |
| user_id | string | Yes | User ID |
| disabled | boolean | No | Whether device is disabled or not |
| disabled_reason | string | No | Reason explaining why device had been disabled |
| push_provider_name | string | No | Push provider name |
| voip | boolean | No | When true the token is for Apple VoIP push notifications |
FeedsPreferences
interface FeedsPreferences {
comment?: 'all' | 'none';
comment_reaction?: 'all' | 'none';
comment_reply?: 'all' | 'none';
custom_activity_types?: Record<string, any>;
follow?: 'all' | 'none';
mention?: 'all' | 'none';
reaction?: 'all' | 'none';
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| comment | 'all' | 'none' | No |
| comment_reaction | 'all' | 'none' | No |
| comment_reply | 'all' | 'none' | No |
| custom_activity_types | Record<string, any> | No | Push notification preferences for custom activity types. Map of activity type... |
| follow | 'all' | 'none' | No |
| mention | 'all' | 'none' | No |
| reaction | 'all' | 'none' | No |
Field
interface Field {
short: boolean;
title: string;
value: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| short | boolean | Yes | |
| title | string | Yes | |
| value | string | Yes |
FileUploadResponse
interface FileUploadResponse {
duration: string;
file?: string;
thumb_url?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| file | string | No | URL to the uploaded asset. Should be used to put to asset_url attachment field |
| thumb_url | string | No | URL of the file thumbnail for supported file formats. Should be put to `thumb... |
FullUserResponse
interface FullUserResponse {
avg_response_time?: number;
ban_expires?: number;
banned: boolean;
blocked_user_ids: string[];
channel_mutes: ChannelMute[];
created_at: number;
custom: Record<string, any>;
deactivated_at?: number;
deleted_at?: number;
devices: DeviceResponse[];
id: string;
image?: string;
invisible: boolean;
language: string;
last_active?: number;
latest_hidden_channels?: string[];
mutes: UserMuteResponse[];
name?: string;
online: boolean;
privacy_settings?: PrivacySettingsResponse;
revoke_tokens_issued_before?: number;
role: string;
shadow_banned: boolean;
teams: string[];
teams_role?: Record<string, any>;
total_unread_count: number;
unread_channels: number;
unread_count: number;
unread_threads: number;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | boolean | Yes | |
| blocked_user_ids | string[] | Yes | |
| channel_mutes | ChannelMute[] | Yes | |
| created_at | number | Yes | |
| custom | Record<string, any> | Yes | |
| devices | DeviceResponse[] | Yes | |
| id | string | Yes | |
| invisible | boolean | Yes | |
| language | string | Yes | |
| mutes | UserMuteResponse[] | Yes | |
| online | boolean | Yes | |
| role | string | Yes | |
| shadow_banned | boolean | Yes | |
| teams | string[] | Yes | |
| total_unread_count | number | Yes | |
| unread_channels | number | Yes | |
| unread_count | number | Yes | |
| unread_threads | number | Yes | |
| updated_at | number | Yes | |
| avg_response_time | number | No | |
| ban_expires | number | No | |
| deactivated_at | number | No | |
| deleted_at | number | No | |
| image | string | No | |
| last_active | number | No | |
| latest_hidden_channels | string[] | No | |
| name | string | No | |
| privacy_settings | PrivacySettingsResponse | No | |
| revoke_tokens_issued_before | number | No | |
| teams_role | Record<string, any> | No |
GetApplicationResponse
Basic response information
interface GetApplicationResponse {
app: AppResponseFields;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app | AppResponseFields | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
GetBlockedUsersResponse
interface GetBlockedUsersResponse {
blocks: BlockedUserResponse[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocks | BlockedUserResponse[] | Yes | Array of blocked user object |
| duration | string | Yes | Duration of the request in milliseconds |
GetOGResponse
interface GetOGResponse {
actions?: Action[];
asset_url?: string;
author_icon?: string;
author_link?: string;
author_name?: string;
color?: string;
custom: Record<string, any>;
duration: string;
fallback?: string;
fields?: Field[];
footer?: string;
footer_icon?: string;
giphy?: Images;
image_url?: string;
og_scrape_url?: string;
original_height?: number;
original_width?: number;
pretext?: string;
text?: string;
thumb_url?: string;
title?: string;
title_link?: string;
type?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Record<string, any> | Yes | |
| duration | string | Yes | |
| actions | Action[] | No | |
| asset_url | string | No | URL of detected video or audio |
| author_icon | string | No | |
| author_link | string | No | og:site |
| author_name | string | No | og:site_name |
| color | string | No | |
| fallback | string | No | |
| fields | Field[] | No | |
| footer | string | No | |
| footer_icon | string | No | |
| giphy | Images | No | |
| image_url | string | No | URL of detected image |
| og_scrape_url | string | No | extracted url from the text |
| original_height | number | No | |
| original_width | number | No | |
| pretext | string | No | |
| text | string | No | og:description |
| thumb_url | string | No | URL of detected thumb image |
| title | string | No | og:title |
| title_link | string | No | og:url |
| type | string | No | Attachment type, could be empty, image, audio or video |
ImageSize
interface ImageSize {
crop?: 'top' | 'bottom' | 'left' | 'right' | 'center';
height?: number;
resize?: 'clip' | 'crop' | 'scale' | 'fill';
width?: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| crop | 'top' | 'bottom' | 'left' |
| height | number | No | Target image height |
| resize | 'clip' | 'crop' | 'scale' |
| width | number | No | Target image width |
ImageUploadResponse
interface ImageUploadResponse {
duration: string;
file?: string;
thumb_url?: string;
upload_sizes?: ImageSize[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| file | string | No | |
| thumb_url | string | No | |
| upload_sizes | ImageSize[] | No | Array of image size configurations |
Images
interface Images {
fixed_height: ImageData;
fixed_height_downsampled: ImageData;
fixed_height_still: ImageData;
fixed_width: ImageData;
fixed_width_downsampled: ImageData;
fixed_width_still: ImageData;
original: ImageData;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| fixed_height | ImageData | Yes | |
| fixed_height_downsampled | ImageData | Yes | |
| fixed_height_still | ImageData | Yes | |
| fixed_width | ImageData | Yes | |
| fixed_width_downsampled | ImageData | Yes | |
| fixed_width_still | ImageData | Yes | |
| original | ImageData | Yes |
ListBlockListResponse
Basic response information
interface ListBlockListResponse {
blocklists: BlockListResponse[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklists | BlockListResponse[] | Yes | |
| duration | string | Yes | Duration of the request in milliseconds |
ListDevicesResponse
List devices response
interface ListDevicesResponse {
devices: DeviceResponse[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| devices | DeviceResponse[] | Yes | List of devices |
| duration | string | Yes |
MessageResponse
Represents any chat message
interface MessageResponse {
attachments: Attachment[];
cid: string;
command?: string;
created_at: number;
custom: Record<string, any>;
deleted_at?: number;
deleted_for_me?: boolean;
deleted_reply_count: number;
draft?: DraftResponse;
html: string;
i18n?: Record<string, any>;
id: string;
image_labels?: Record<string, any>;
latest_reactions: ReactionResponse[];
member?: ChannelMemberResponse;
mentioned_users: UserResponse[];
message_text_updated_at?: number;
mml?: string;
moderation?: ModerationV2Response;
own_reactions: ReactionResponse[];
parent_id?: string;
pin_expires?: number;
pinned: boolean;
pinned_at?: number;
pinned_by?: UserResponse;
poll?: PollResponseData;
poll_id?: string;
quoted_message?: MessageResponse;
quoted_message_id?: string;
reaction_counts: Record<string, any>;
reaction_groups?: Record<string, any>;
reaction_scores: Record<string, any>;
reminder?: ReminderResponseData;
reply_count: number;
restricted_visibility: string[];
shadowed: boolean;
shared_location?: SharedLocationResponseData;
show_in_channel?: boolean;
silent: boolean;
text: string;
thread_participants?: UserResponse[];
type: 'regular' | 'ephemeral' | 'error' | 'reply' | 'system' | 'deleted';
updated_at: number;
user: UserResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| attachments | Attachment[] | Yes | Array of message attachments |
| cid | string | Yes | Channel unique identifier in <type>:<id> format |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | |
| deleted_reply_count | number | Yes | |
| html | string | Yes | Contains HTML markup of the message. Can only be set when using server-side API |
| id | string | Yes | Message ID is unique string identifier of the message |
| latest_reactions | ReactionResponse[] | Yes | List of 10 latest reactions to this message |
| mentioned_users | UserResponse[] | Yes | List of mentioned users |
| own_reactions | ReactionResponse[] | Yes | List of 10 latest reactions of authenticated user to this message |
| pinned | boolean | Yes | Whether message is pinned or not |
| reaction_counts | Record<string, any> | Yes | An object containing number of reactions of each type. Key: reaction type (st... |
| reaction_scores | Record<string, any> | Yes | An object containing scores of reactions of each type. Key: reaction type (st... |
| reply_count | number | Yes | Number of replies to this message |
| restricted_visibility | string[] | Yes | A list of user ids that have restricted visibility to the message, if the lis... |
| shadowed | boolean | Yes | Whether the message was shadowed or not |
| silent | boolean | Yes | Whether message is silent or not |
| text | string | Yes | Text of the message. Should be empty if mml is provided |
| type | 'regular' | 'ephemeral' | 'error' |
| updated_at | number | Yes | Date/time of the last update |
| user | UserResponse | Yes | Sender of the message. Required when using server-side API |
| command | string | No | Contains provided slash command |
| deleted_at | number | No | Date/time of deletion |
| deleted_for_me | boolean | No | |
| draft | DraftResponse | No | |
| i18n | Record<string, any> | No | Object with translations. Key language contains the original language key. ... |
| image_labels | Record<string, any> | No | Contains image moderation information |
| member | ChannelMemberResponse | No | Channel member data for the message sender including only the channel_role |
| message_text_updated_at | number | No | |
| mml | string | No | Should be empty if text is provided. Can only be set when using server-side... |
| moderation | ModerationV2Response | No | |
| parent_id | string | No | ID of parent message (thread) |
| pin_expires | number | No | Date when pinned message expires |
| pinned_at | number | No | Date when message got pinned |
| pinned_by | UserResponse | No | Contains user who pinned the message |
| poll | PollResponseData | No | |
| poll_id | string | No | Identifier of the poll to include in the message |
| quoted_message | MessageResponse | No | Contains quoted message |
| quoted_message_id | string | No | |
| reaction_groups | Record<string, any> | No | |
| reminder | ReminderResponseData | No | |
| shared_location | SharedLocationResponseData | No | Contains shared location data |
| show_in_channel | boolean | No | Whether thread reply should be shown in the channel as well |
| thread_participants | UserResponse[] | No | List of users who participate in thread |
OnlyUserID
interface OnlyUserID {
id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes |
Poll
interface Poll {
Custom: Record<string, any>;
allow_answers: boolean;
allow_user_suggested_options: boolean;
answers_count: number;
created_at: number;
created_by?: User;
created_by_id: string;
description: string;
enforce_unique_vote: boolean;
id: string;
is_closed?: boolean;
latest_answers: PollVote[];
latest_votes_by_option: Record<string, any>;
max_votes_allowed?: number;
name: string;
options: PollOption[];
own_votes: PollVote[];
updated_at: number;
vote_count: number;
vote_counts_by_option: Record<string, any>;
voting_visibility?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| Custom | Record<string, any> | Yes | |
| allow_answers | boolean | Yes | |
| allow_user_suggested_options | boolean | Yes | |
| answers_count | number | Yes | |
| created_at | number | Yes | |
| created_by_id | string | Yes | |
| description | string | Yes | |
| enforce_unique_vote | boolean | Yes | |
| id | string | Yes | |
| latest_answers | PollVote[] | Yes | |
| latest_votes_by_option | Record<string, any> | Yes | |
| name | string | Yes | |
| options | PollOption[] | Yes | |
| own_votes | PollVote[] | Yes | |
| updated_at | number | Yes | |
| vote_count | number | Yes | |
| vote_counts_by_option | Record<string, any> | Yes | |
| created_by | User | No | |
| is_closed | boolean | No | |
| max_votes_allowed | number | No | |
| voting_visibility | string | No |
PollOption
interface PollOption {
custom: Record<string, any>;
id: string;
text: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Record<string, any> | Yes | |
| id | string | Yes | |
| text | string | Yes |
PollOptionInput
interface PollOptionInput {
custom?: Record<string, any>;
text?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Record<string, any> | No | |
| text | string | No |
PollOptionRequest
interface PollOptionRequest {
custom?: Record<string, any>;
id: string;
text?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | |
| custom | Record<string, any> | No | |
| text | string | No |
PollOptionResponse
interface PollOptionResponse {
duration: string;
poll_option: PollOptionResponseData;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| poll_option | PollOptionResponseData | Yes | Poll option |
PollOptionResponseData
interface PollOptionResponseData {
custom: Record<string, any>;
id: string;
text: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Record<string, any> | Yes | |
| id | string | Yes | |
| text | string | Yes |
PollResponse
interface PollResponse {
duration: string;
poll: PollResponseData;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| poll | PollResponseData | Yes | Poll |
PollResponseData
interface PollResponseData {
allow_answers: boolean;
allow_user_suggested_options: boolean;
answers_count: number;
created_at: number;
created_by?: UserResponse;
created_by_id: string;
custom: Record<string, any>;
description: string;
enforce_unique_vote: boolean;
id: string;
is_closed?: boolean;
latest_answers: PollVoteResponseData[];
latest_votes_by_option: Record<string, any>;
max_votes_allowed?: number;
name: string;
options: PollOptionResponseData[];
own_votes: PollVoteResponseData[];
updated_at: number;
vote_count: number;
vote_counts_by_option: Record<string, any>;
voting_visibility: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| allow_answers | boolean | Yes | |
| allow_user_suggested_options | boolean | Yes | |
| answers_count | number | Yes | |
| created_at | number | Yes | |
| created_by_id | string | Yes | |
| custom | Record<string, any> | Yes | |
| description | string | Yes | |
| enforce_unique_vote | boolean | Yes | |
| id | string | Yes | |
| latest_answers | PollVoteResponseData[] | Yes | |
| latest_votes_by_option | Record<string, any> | Yes | |
| name | string | Yes | |
| options | PollOptionResponseData[] | Yes | |
| own_votes | PollVoteResponseData[] | Yes | |
| updated_at | number | Yes | |
| vote_count | number | Yes | |
| vote_counts_by_option | Record<string, any> | Yes | |
| voting_visibility | string | Yes | |
| created_by | UserResponse | No | |
| is_closed | boolean | No | |
| max_votes_allowed | number | No |
PollVote
interface PollVote {
answer_text?: string;
created_at: number;
id: string;
is_answer?: boolean;
option_id: string;
poll_id: string;
updated_at: number;
user?: User;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| id | string | Yes | |
| option_id | string | Yes | |
| poll_id | string | Yes | |
| updated_at | number | Yes | |
| answer_text | string | No | |
| is_answer | boolean | No | |
| user | User | No | |
| user_id | string | No |
PollVoteResponseData
interface PollVoteResponseData {
answer_text?: string;
created_at: number;
id: string;
is_answer?: boolean;
option_id: string;
poll_id: string;
updated_at: number;
user?: UserResponse;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | number | Yes | |
| id | string | Yes | |
| option_id | string | Yes | |
| poll_id | string | Yes | |
| updated_at | number | Yes | |
| answer_text | string | No | |
| is_answer | boolean | No | |
| user | UserResponse | No | |
| user_id | string | No |
PollVotesResponse
interface PollVotesResponse {
duration: string;
next?: string;
prev?: string;
votes: PollVoteResponseData[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| votes | PollVoteResponseData[] | Yes | Poll votes |
| next | string | No | |
| prev | string | No |
PrivacySettings
interface PrivacySettings {
delivery_receipts?: DeliveryReceipts;
read_receipts?: ReadReceipts;
typing_indicators?: TypingIndicators;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| delivery_receipts | DeliveryReceipts | No | |
| read_receipts | ReadReceipts | No | |
| typing_indicators | TypingIndicators | No |
PrivacySettingsResponse
interface PrivacySettingsResponse {
delivery_receipts?: DeliveryReceiptsResponse;
read_receipts?: ReadReceiptsResponse;
typing_indicators?: TypingIndicatorsResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| delivery_receipts | DeliveryReceiptsResponse | No | |
| read_receipts | ReadReceiptsResponse | No | |
| typing_indicators | TypingIndicatorsResponse | No |
PushPreferenceInput
interface PushPreferenceInput {
call_level?: 'all' | 'none' | 'default';
channel_cid?: string;
chat_level?: 'all' | 'mentions' | 'none' | 'default';
disabled_until?: number;
feeds_level?: 'all' | 'none' | 'default';
feeds_preferences?: FeedsPreferences;
remove_disable?: boolean;
user_id?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| call_level | 'all' | 'none' | 'default' |
| channel_cid | string | No | Set the push preferences for a specific channel. If empty it sets the default... |
| chat_level | 'all' | 'mentions' | 'none' |
| disabled_until | number | No | Disable push notifications till a certain time |
| feeds_level | 'all' | 'none' | 'default' |
| feeds_preferences | FeedsPreferences | No | Set granular feeds preferences for reactions, comments, new followers, mentio... |
| remove_disable | boolean | No | Remove the disabled until time. (IE stop snoozing notifications) |
| user_id | string | No | The user id for which to set the push preferences. Required when using server... |
QueryPollsResponse
interface QueryPollsResponse {
duration: string;
next?: string;
polls: PollResponseData[];
prev?: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| polls | PollResponseData[] | Yes | Polls data returned by the query |
| next | string | No | |
| prev | string | No |
QueryUsersResponse
interface QueryUsersResponse {
duration: string;
users: FullUserResponse[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| users | FullUserResponse[] | Yes | Array of users as result of filters applied. |
Response
Basic response information
interface Response {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
SharedLocationResponse
interface SharedLocationResponse {
channel?: ChannelResponse;
channel_cid: string;
created_at: number;
created_by_device_id: string;
duration: string;
end_at?: number;
latitude: number;
longitude: number;
message?: MessageResponse;
message_id: string;
updated_at: number;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | Channel CID |
| created_at | number | Yes | Date/time of creation |
| created_by_device_id | string | Yes | Device ID that created the live location |
| duration | string | Yes | |
| latitude | number | Yes | Latitude coordinate |
| longitude | number | Yes | Longitude coordinate |
| message_id | string | Yes | Message ID |
| updated_at | number | Yes | Date/time of the last update |
| user_id | string | Yes | User ID |
| channel | ChannelResponse | No | |
| end_at | number | No | Time when the live location expires |
| message | MessageResponse | No |
SharedLocationResponseData
interface SharedLocationResponseData {
channel?: ChannelResponse;
channel_cid: string;
created_at: number;
created_by_device_id: string;
end_at?: number;
latitude: number;
longitude: number;
message?: MessageResponse;
message_id: string;
updated_at: number;
user_id: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | string | Yes | |
| created_at | number | Yes | |
| created_by_device_id | string | Yes | |
| latitude | number | Yes | |
| longitude | number | Yes | |
| message_id | string | Yes | |
| updated_at | number | Yes | |
| user_id | string | Yes | |
| channel | ChannelResponse | No | |
| end_at | number | No | |
| message | MessageResponse | No |
SharedLocationsResponse
interface SharedLocationsResponse {
active_live_locations: SharedLocationResponseData[];
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| active_live_locations | SharedLocationResponseData[] | Yes | |
| duration | string | Yes |
SortParamRequest
interface SortParamRequest {
direction?: number;
field?: string;
type?: '' | 'number' | 'boolean';
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| direction | number | No | Direction of sorting, 1 for Ascending, -1 for Descending, default is 1 |
| field | string | No | Name of field to sort by |
| type | '' | 'number' | 'boolean' |
Time
interface Time {
}UnblockUsersResponse
interface UnblockUsersResponse {
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
UpdateBlockListResponse
Basic response information
interface UpdateBlockListResponse {
blocklist?: BlockListResponse;
duration: string;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| blocklist | BlockListResponse | No |
UpdateUserPartialRequest
interface UpdateUserPartialRequest {
id: string;
set?: Record<string, any>;
unset?: string[];
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | User ID to update |
| set | Record<string, any> | No | |
| unset | string[] | No |
UpdateUsersResponse
interface UpdateUsersResponse {
duration: string;
membership_deletion_task_id: string;
users: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| membership_deletion_task_id | string | Yes | |
| users | Record<string, any> | Yes | Object containing users |
UpsertPushPreferencesResponse
interface UpsertPushPreferencesResponse {
duration: string;
user_channel_preferences: Record<string, any>;
user_preferences: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | string | Yes | Duration of the request in milliseconds |
| user_channel_preferences | Record<string, any> | Yes | The channel specific push notification preferences, only returned for channel... |
| user_preferences | Record<string, any> | Yes | The user preferences, always returned regardless if you edited it |
User
interface User {
ban_expires?: number;
banned?: boolean;
custom?: Record<string, any>;
id: string;
invisible?: boolean;
language?: string;
privacy_settings?: PrivacySettings;
revoke_tokens_issued_before?: number;
role?: string;
teams?: string[];
teams_role?: Record<string, any>;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | |
| ban_expires | number | No | |
| banned | boolean | No | |
| custom | Record<string, any> | No | |
| invisible | boolean | No | |
| language | string | No | |
| privacy_settings | PrivacySettings | No | |
| revoke_tokens_issued_before | number | No | |
| role | string | No | |
| teams | string[] | No | |
| teams_role | Record<string, any> | No |
UserRequest
User request object
interface UserRequest {
custom?: Record<string, any>;
id: string;
image?: string;
invisible?: boolean;
language?: string;
name?: string;
privacy_settings?: PrivacySettingsResponse;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | User ID |
| custom | Record<string, any> | No | Custom user data |
| image | string | No | User's profile image URL |
| invisible | boolean | No | |
| language | string | No | |
| name | string | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No |
UserResponse
User response object
interface UserResponse {
avg_response_time?: number;
banned: boolean;
blocked_user_ids: string[];
created_at: number;
custom: Record<string, any>;
deactivated_at?: number;
deleted_at?: number;
id: string;
image?: string;
language: string;
last_active?: number;
name?: string;
online: boolean;
revoke_tokens_issued_before?: number;
role: string;
teams: string[];
teams_role?: Record<string, any>;
updated_at: number;
}Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | boolean | Yes | Whether a user is banned or not |
| blocked_user_ids | string[] | Yes | |
| created_at | number | Yes | Date/time of creation |
| custom | Record<string, any> | Yes | Custom data for this object |
| id | string | Yes | Unique user identifier |
| language | string | Yes | Preferred language of a user |
| online | boolean | Yes | Whether a user online or not |
| role | string | Yes | Determines the set of user permissions |
| teams | string[] | Yes | List of teams user is a part of |
| updated_at | number | Yes | Date/time of the last update |
| avg_response_time | number | No | |
| deactivated_at | number | No | Date of deactivation |
| deleted_at | number | No | Date/time of deletion |
| image | string | No | |
| last_active | number | No | Date of last activity |
| name | string | No | Optional name of user |
| revoke_tokens_issued_before | number | No | Revocation date for tokens |
| teams_role | Record<string, any> | No |