Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Osmium
https://osmium.chat/docs
Admin
Osmium is an open protocol designed for building chat clients, bots, and integrations.
Tokens:
22,877
Snippets:
199
Trust Score:
5
Update:
1 month ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Downloading a 10 MiB file in chunks Source: https://osmium.chat/docs/api/files Example of splitting a 10 MiB file download into 1 MiB chunks using offset and length parameters. ```text offset=0 length=1 MiB offset=1 MiB length=1 MiB offset=2 MiB length=1 MiB ... offset=9 MiB length=1 MiB ``` -------------------------------- ### media.downloadFilePart Source: https://osmium.chat/docs/api/media.downloadfilepart Downloads a part of a file identified by file_ref, starting at the given offset and with the specified length. Returns a media.FilePart containing the requested data. ```APIDOC ## media.downloadFilePart ### Description Downloads a part of a file identified by file_ref, starting at the given offset and with the specified length. Returns a media.FilePart containing the requested data. ### Method media.downloadFilePart ### Parameters - **file_ref** (FileRef) - Required - The reference to the file to download. - **offset** (uint64) - Required - The byte offset from which to start downloading. - **length** (uint32) - Required - The number of bytes to download. ### Returns media.FilePart ``` -------------------------------- ### settings.setupTotp Source: https://osmium.chat/docs/api/settings.setuptotp Configures TOTP settings. Takes an enabled flag and optional code and step-up token, returns the updated TOTP settings. ```APIDOC ## settings.setupTotp ### Description Configures Time-based One-Time Password (TOTP) settings for the user. Returns the updated TOTP settings. ### Method settings.setupTotp ### Parameters - **enabled** (bool) - Required - Whether TOTP is enabled. - **code** (optional string) - Optional - The TOTP code for verification. - **step_up_token** (optional string) - Optional - A token for step-up authentication. ### Returns settings.Totp ``` -------------------------------- ### core.initialize Source: https://osmium.chat/docs/proto/core.initialize Initializes a client session with the provided device and application information. Returns a core.Initialized object. ```APIDOC ## core.initialize ### Description Initializes a client session with the provided device and application information. Returns a core.Initialized object. ### Method core.initialize ### Parameters - **client_id** (uint32) - Required - The client identifier. - **device_type** (string) - Required - The type of device. - **device_version** (string) - Required - The version of the device. - **app_version** (string) - Required - The version of the application. - **no_subscribe** (bool) - Required - Whether to skip subscription. ### Returns - **core.Initialized** - The initialization result. ``` -------------------------------- ### settings.beginMfaStepUp Source: https://osmium.chat/docs/api/settings.beginmfastepup Initiates a multi-factor authentication step-up. Requires the user's password and returns a settings.MfaStepUp object. ```APIDOC ## settings.beginMfaStepUp ### Description Initiates a multi-factor authentication step-up process. ### Method settings.beginMfaStepUp ### Parameters - **password** (string) - Required - The user's password. ### Returns settings.MfaStepUp ``` -------------------------------- ### core.initialize Source: https://osmium.chat/docs/api/core.initialize Initializes the Osmium client with the provided device and application information. Returns a core.Initialized object. ```APIDOC ## core.initialize ### Description Initializes the Osmium client with the provided device and application information. Returns a core.Initialized object. ### Method core.initialize ### Parameters - **client_id** (uint32) - Required - The client identifier. - **device_type** (string) - Required - The type of the device. - **device_version** (string) - Required - The version of the device. - **app_version** (string) - Required - The version of the application. - **no_subscribe** (bool) - Required - Indicates whether to skip subscription. ### Returns core.Initialized ``` -------------------------------- ### settings.setupWebauthn Source: https://osmium.chat/docs/api/settings.setupwebauthn Configures WebAuthn settings for an account. It accepts parameters to enable WebAuthn, provide credential JSON, credential ID, display name, step-up token, and challenge ID, and returns the updated WebAuthn settings. ```APIDOC ## settings.setupWebauthn ### Description Configures WebAuthn settings for an account. It accepts parameters to enable WebAuthn, provide credential JSON, credential ID, display name, step-up token, and challenge ID, and returns the updated WebAuthn settings. ### Method settings.setupWebauthn ### Parameters | Name | Type | |------|------| | `enabled` | `bool` | | `credential_json` | `optional string` | | `credential_id` | `optional Snowflake<AccountMfa>` | | `display_name` | `optional string` | | `step_up_token` | `optional string` | | `challenge_id` | `optional string` | ### Returns **settings.Webauthn** ``` -------------------------------- ### auth.signUp Source: https://osmium.chat/docs/api/auth.signup Creates a new user account with the provided details and returns an authorization object. ```APIDOC ## auth.signUp ### Description Creates a new user account with the provided details and returns an authorization object. ### Method auth.signUp ### Parameters - **email** (optional string) - Optional - The user's email address. - **password** (optional string) - Optional - The user's password. - **name** (string) - Required - The user's name. - **email_verification_token** (optional string) - Optional - Token for email verification. ### Returns auth.Authorization ``` -------------------------------- ### settings.completeMfaStepUp Source: https://osmium.chat/docs/api/settings.completemfastepup Completes a multi-factor authentication step-up challenge. Provide the challenge_id and one of the supported proof types to finish the step-up process. ```APIDOC ## settings.completeMfaStepUp ### Description Completes a multi-factor authentication step-up challenge. Provide the challenge_id and one of the supported proof types to finish the step-up process. ### Method method ### Parameters | Name | Type | Description | |------|------|-------------| | challenge_id | string | Required. The identifier of the MFA step-up challenge. | | totp | string | Optional. One of: proof. TOTP code. | | recovery_code | string | Optional. One of: proof. Recovery code. | | webauthn_credential_json | string | Optional. One of: proof. WebAuthn credential JSON. | ### Returns settings.MfaStepUp ``` -------------------------------- ### billing.getProducts Source: https://osmium.chat/docs/api/billing.getproducts The billing.getProducts method returns billing.Products. It has no parameters. ```APIDOC ## billing.getProducts ### Description Returns billing.Products. ### Method billing.getProducts ### Parameters This definition has no fields. ### Returns billing.Products ``` -------------------------------- ### auth.signIn Source: https://osmium.chat/docs/api/auth.signin Signs in a user with the provided email and password. Returns an auth.SignInResult. ```APIDOC ## auth.signIn ### Description Signs in a user with the provided email and password. Returns an auth.SignInResult. ### Method auth.signIn ### Parameters - `email` (string) - Required - The user's email address. - `password` (string) - Required - The user's password. ### Returns auth.SignInResult ``` -------------------------------- ### settings.registerPushSubscription method reference Source: https://osmium.chat/docs/api/settings.registerpushsubscription This snippet contains the structured API documentation for the registerPush method extracted from source:边区: api/settings.registerpushsubscription.md ```Parameters Name | Type ... (as provided in the original text, properly formatted as a table in Markdown) — formatted as structured API reference documentation, including sections for Description, Method/Operation, Parameters and Types Used tables, plus sections for each inner type and its attributes/value tables, exactly as provided in the same order and with exactly the same names EXCEPTIONAL: settings.registerPush is a method of the API Users can call it directly, structured as follows: ``` -------------------------------- ### oauth.authorize Source: https://osmium.chat/docs/api/oauth.authorize Initiates the OAuth authorization flow. Returns an oauth.Authorization object. Accepts required parameters response_type, client_id, and redirect_uri, along with optional parameters for PKCE and state management. ```APIDOC ## oauth.authorize ### Description Initiates the OAuth authorization flow. Returns an oauth.Authorization object. ### Method oauth.authorize ### Returns oauth.Authorization ### Parameters - **response_type** (string) - Required - The response type for the authorization request. - **client_id** (uint32) - Required - The client identifier. - **redirect_uri** (string) - Required - The URI to redirect to after authorization. - **scope** (optional string) - Optional - The requested scope. - **state** (optional string) - Optional - A state value for CSRF protection. - **code_challenge** (optional string) - Optional - PKCE code challenge. - **code_challenge_method** (optional string) - Optional - PKCE code challenge method. - **nonce** (optional string) - Optional - A nonce value for replay protection. ``` -------------------------------- ### auth.completeSignIn Source: https://osmium.chat/docs/api/auth.completesignin Completes a sign-in challenge by providing the required proof, such as a TOTP code, recovery code, or WebAuthn credential. Returns an auth.Authorization object. ```APIDOC ## auth.completeSignIn ### Description Completes a sign-in challenge by providing the required proof, such as a TOTP code, recovery code, or WebAuthn credential. Returns an auth.Authorization object. ### Method method ### Parameters | Name | Type | Description | |------|------|-------------| | `challenge_id` | `string` | The identifier of the challenge to complete. | | `proof` | One of: `totp`, `recovery_code`, `webauthn_credential_json` | The proof to satisfy the challenge. | | `totp` | `string` | The TOTP code. | | `recovery_code` | `string` | The recovery code. | | `webauthn_credential_json` | `string` | The WebAuthn credential JSON. | ### Returns - **auth.Authorization** - The authorization object resulting from successful completion. ``` -------------------------------- ### oauth.authorize Source: https://osmium.chat/docs/proto/oauth.authorize Initiates the OAuth authorization flow. Returns an oauth.Authorization object. ```APIDOC ## oauth.authorize ### Description Initiates the OAuth authorization flow. Returns an oauth.Authorization object. ### Method oauth.authorize ### Parameters - **response_type** (string) - Required - The response type for the authorization request. - **client_id** (uint32) - Required - The client identifier. - **redirect_uri** (string) - Required - The URI to redirect to after authorization. - **scope** (optional string) - Optional - The requested scope. - **state** (optional string) - Optional - A state parameter for CSRF protection. - **code_challenge** (optional string) - Optional - The PKCE code challenge. - **code_challenge_method** (optional string) - Optional - The PKCE code challenge method. - **nonce** (optional string) - Optional - A nonce value for replay protection. ### Returns - **oauth.Authorization** - The authorization result. ``` -------------------------------- ### media.FileMetadata Source: https://osmium.chat/docs/api/files Describes how a file should be presented to the recipient. Variants include image, video, audio, file, and customEmoji, each with specific fields. ```APIDOC ## media.FileMetadata ### Description Describes how a file should be presented to the recipient. If no media-specific metadata is provided, the file is presented as a generic downloadable object, similar to MetadataFile. ### Variants #### image - **width** (integer) - Image width - **height** (integer) - Image height - **preview** (optional) - Preview data - **animated** (boolean) - Animation state #### video - **width** (integer) - Video width - **height** (integer) - Video height - **duration** (number) - Video duration in seconds #### audio - **duration** (number) - Audio duration in seconds #### file - None - Generic file with no media-specific metadata #### customEmoji - **width** (integer) - Custom emoji width - **height** (integer) - Custom emoji height - **emoji** (string) - Emoji identifier - **pack** (string) - Pack identifier - **animated** (boolean) - Animation state ``` -------------------------------- ### auth.legacySignIn Source: https://osmium.chat/docs/api/auth.legacysignin Signs in a user using legacy credentials (email and password) with optional TOTP authentication. Returns an authorization object. ```APIDOC ## auth.legacySignIn ### Description Signs in a user using legacy credentials (email and password) with optional TOTP authentication. Returns an authorization object. ### Method auth.legacySignIn ### Parameters - `email` (string) - Required - The user's email address. - `password` (string) - Required - The user's password. - `totp` (optional string) - Optional - Time-based one-time password for two-factor authentication. ### Returns auth.Authorization ``` -------------------------------- ### DownloadFilePart and FilePart structure Source: https://osmium.chat/docs/api/files The structure of the download request and the corresponding response containing the file bytes. ```text DownloadFilePart { fileRef: FileRef { mediaFile: { fileId: ... } } offset: 0 length: 1048576 } FilePart { data: <bytes for offset through offset + length> } ``` -------------------------------- ### billing.getInventory Source: https://osmium.chat/docs/proto/billing.getinventory Retrieves the inventory list for billing. This method takes no parameters and returns a billing.InventoryList. ```APIDOC ## billing.getInventory ### Description Retrieves the inventory list for billing purposes. ### Method billing.getInventory ### Parameters This method has no fields. ### Response #### Success Response - **Returns** (billing.InventoryList) - The inventory list for billing. ``` -------------------------------- ### auth.useInvite Source: https://osmium.chat/docs/api/auth.useinvite Uses an invite code to authenticate or activate an account. The method takes a single 'code' parameter. ```APIDOC ## auth.useInvite ### Description Uses an invite code to authenticate or activate an account. ### Method auth.useInvite ### Parameters - **code** (string) - Required - The invite code to use. ``` -------------------------------- ### stickers.getStickerFiles Source: https://osmium.chat/docs/api/stickers.getstickerfiles Retrieves media files for the given sticker IDs. The method takes a list of sticker IDs and returns the associated media files. ```APIDOC ## stickers.getStickerFiles ### Description Retrieves media files for the specified sticker IDs. ### Method method ### Parameters #### Request Body - **sticker_ids** (repeated Snowflake<Sticker>) - Required - List of sticker IDs to retrieve files for. ### Response #### Success Response - **media.Files** - The media files associated with the requested stickers. ``` -------------------------------- ### communities.createChannelOverride Source: https://osmium.chat/docs/api/communities.createchanneloverride Creates a channel override for a community channel and role, returning the resulting ChannelOverride object. ```APIDOC ## communities.createChannelOverride ### Description Creates a channel override for a community channel and role, returning the resulting ChannelOverride object. ### Method communities.createChannelOverride ### Parameters - **community_id** (Snowflake<Community>) - Required - The ID of the community. - **channel_id** (Snowflake<Channel>) - Required - The ID of the channel. - **role_id** (Snowflake<Role>) - Required - The ID of the role. - **permissions** (types.PermissionOverrides) - Required - The permission overrides to apply. ### Returns **communities.ChannelOverride** - The created channel override. ``` -------------------------------- ### chats.listChatInvites Source: https://osmium.chat/docs/api/chats.listchatinvites Lists chat invites for a given chat reference. Returns an auth.InviteList. ```APIDOC ## chats.listChatInvites ### Description Lists chat invites for a given chat reference. Returns an auth.InviteList. ### Method chats.listChatInvites ### Parameters #### Path Parameters - **chat_ref** (refs.ChatRef) - Required - The chat reference. ### Returns auth.InviteList ``` -------------------------------- ### settings.getAccount Source: https://osmium.chat/docs/api/settings.getaccount Returns the account settings for the current user. This method takes no parameters and returns a settings.Account object. ```APIDOC ## settings.getAccount ### Description Returns the account settings for the current user. ### Method settings.getAccount ### Parameters This method has no fields. ### Returns settings.Account ``` -------------------------------- ### settings.changePassword Source: https://osmium.chat/docs/api/settings.changepassword Documentation for the settings.changePassword method. ```APIDOC ## settings.changePassword ### Description Changes the password for the authenticated user. Optionally revokes all other sessions. ### Method method ### Parameters - **current_password** (string) - Required - The current password. - **new_password** (string) - Required - The new password. - **revoke_sessions** (bool) - Optional - Revoke all other sessions after password change. ``` -------------------------------- ### oauth.getApp Source: https://osmium.chat/docs/api/oauth.getapp Retrieves an OAuth application by its client ID. The method accepts a client_id parameter and returns an oauth.App object. ```APIDOC ## oauth.getApp ### Description Retrieves an OAuth application by its client ID. ### Method getApp ### Parameters - **client_id** (uint32) - Required - The client ID of the OAuth application. ### Returns oauth.App ``` -------------------------------- ### auth.authorize Source: https://osmium.chat/docs/api/auth.authorize The auth.authorize method authorizes a user using a token and returns an auth.Authorization object. ```APIDOC ## auth.authorize ### Description Authorizes a user using the provided token and returns an authorization object. ### Method auth.authorize ### Parameters - **token** (string) - Required - The authentication token. ### Returns auth.Authorization ``` -------------------------------- ### settings.getMfaMethods Source: https://osmium.chat/docs/api/settings.getmfamethods Returns a settings.MfaMethods object. This method has no parameters. ```APIDOC ## settings.getMfaMethods ### Description Returns a settings.MfaMethods object. ### Method settings.getMfaMethods ### Parameters This definition has no fields. ### Returns settings.MfaMethods ``` -------------------------------- ### communities.syncChannelOverrides Source: https://osmium.chat/docs/api/communities.syncchanneloverrides The communities.syncChannelOverrides method synchronizes channel overrides for a given community and channel. It requires a community_id and a channel_id. ```APIDOC ## communities.syncChannelOverrides ### Description Synchronizes channel overrides for a specified community and channel. ### Method communities.syncChannelOverrides ### Parameters - **community_id** (Snowflake<Community>) - Required - The ID of the community. - **channel_id** (Snowflake<Channel>) - Required - The ID of the channel. ``` -------------------------------- ### billing.createGiftLink Source: https://osmium.chat/docs/api/billing.creategiftlink Creates a gift link for the specified inventory item. Returns a billing.GiftLink object. ```APIDOC ## billing.createGiftLink ### Description Creates a gift link for the specified inventory item. ### Method billing.createGiftLink ### Parameters - `item_id` (Snowflake<InventoryItem>) - Required - The ID of the inventory item to create a gift link for. ### Returns billing.GiftLink ``` -------------------------------- ### communities.createChannel Source: https://osmium.chat/docs/api/communities.createchannel Creates a new channel in a community. Requires a community ID, channel name, and channel type. Optionally accepts a parent channel ID and preferred region. ```APIDOC ## communities.createChannel ### Description Creates a new channel within a community. ### Method `communities.createChannel` ### Parameters | Name | Type | Required | Description | |------|------|----------|-------------| | `community_id` | `Snowflake<Community>` | Required | The ID of the community where the channel will be created. | | `name` | `string` | Required | The name of the new channel. | | `type` | `types.ChannelType` | Required | The type of the channel (e.g., text, voice). | | `parent_id` | `optional Snowflake<Channel>` | Optional | The ID of the parent channel, if any. | | `preferred_region` | `optional string` | Optional | The preferred region for the channel, if applicable. | ### Request Example ```json { "community_id": "123456789012345678", "name": "general", "type": "text", "parent_id": "987654321098765432", "preferred_region": "us-east" } ``` ### Response #### Success Response Returns the created channel object. #### Response Example ```json { "id": "123456789012345678", "community_id": "123456789012345678", "name": "general", "type": "text", "parent_id": "987654321098765432", "preferred_region": "us-east" } ``` ``` -------------------------------- ### voice.UpdateRoomState Source: https://osmium.chat/docs/api/voice.updateroomstate Class definition for updating the state of a voice room. Contains fields for chat reference, room state, users, and members. ```APIDOC ## voice.UpdateRoomState ### Description Updates the state of a voice room. ### Fields - **chat_ref** (refs.ChatRef) - The chat reference. - **state** (RoomState) - The room state. - **users** (repeated types.User) - List of users. - **members** (repeated types.CommunityMember) - List of community members. ``` -------------------------------- ### auth.lookupInvite Source: https://osmium.chat/docs/api/auth.lookupinvite The auth.lookupInvite method is used to look up an invite by its code and returns a preview of the invite. It accepts a single string parameter 'code' and returns an auth.InvitePreview. ```APIDOC ## auth.lookupInvite ### Description Returns an auth.InvitePreview for the given invite code. ### Method auth.lookupInvite ### Parameters - **code** (string) - Required - The invite code to look up. ### Returns auth.InvitePreview ``` -------------------------------- ### chats.createChatInvite Source: https://osmium.chat/docs/api/chats.createchatinvite Creates a chat invite with optional expiration and usage limits. Returns an auth.CreatedInvite object. ```APIDOC ## chats.createChatInvite ### Description Creates a chat invite with optional expiration and usage limits. Returns an auth.CreatedInvite object. ### Method chats.createChatInvite ### Parameters - **chat_ref** (refs.ChatRef) - Required - The reference to the chat for which the invite is created. - **expires_at** (optional fixed64) - Optional - The expiration timestamp for the invite. - **max_uses** (optional uint32) - Optional - The maximum number of times the invite can be used. ### Returns auth.CreatedInvite ``` -------------------------------- ### auth.createEmailVerificationChallenge Source: https://osmium.chat/docs/api/auth.createemailverificationchallenge Creates an email verification challenge. This method takes no parameters and returns an auth.EmailVerificationChallenge object. ```APIDOC ## auth.createEmailVerificationChallenge ### Description Creates an email verification challenge. This method takes no parameters and returns an auth.EmailVerificationChallenge object. ### Method createEmailVerificationChallenge ### Parameters This method has no fields. ### Returns auth.EmailVerificationChallenge ``` -------------------------------- ### communities.getChannelOverrides Source: https://osmium.chat/docs/api/communities.getchanneloverrides Retrieves the channel overrides for a specific community and channel. ```APIDOC ## communities.getChannelOverrides ### Description Retrieves the channel overrides for a specific community and channel. ### Method communities.getChannelOverrides ### Parameters | Name | Type | |------|------| | `community_id` | `Snowflake<Community>` | | `channel_id` | `Snowflake<Channel>` | ### Returns `communities.ChannelOverrides` ``` -------------------------------- ### communities.createRole Source: https://osmium.chat/docs/api/communities.createrole Creates a new role in a community. The method requires a community ID and role name, with optional parameters for permissions, priority, color, and visibility. ```APIDOC ## communities.createRole ### Description Creates a new role within a community. ### Method communities.createRole ### Parameters - **community_id** (Snowflake<Community>) - Required - The ID of the community where the role will be created. - **name** (string) - Required - The name of the role. - **permissions** (fixed64) - Optional - Bitmask of permissions for the role. - **priority** (uint32) - Optional - Priority of the role. - **color** (uint32) - Optional - Color of the role. - **separated** (bool) - Optional - Whether the role is separated. - **public** (bool) - Optional - Whether the role is public. ``` -------------------------------- ### messages.getEmbedPreview Source: https://osmium.chat/docs/api/messages.getembedpreview Retrieves an embed preview for a given message and its entities. Returns a media.MediaEmbed object. ```APIDOC ## messages.getEmbedPreview ### Description Retrieves an embed preview for a given message and its entities. Returns a media.MediaEmbed object. ### Method messages.getEmbedPreview ### Parameters - **message** (string) - Required - The message text. - **entities** (repeated types.MessageEntity) - Required - List of message entities. ### Returns media.MediaEmbed ``` -------------------------------- ### billing.requestPaymentLink Source: https://osmium.chat/docs/proto/billing.requestpaymentlink Creates a payment link for a specified plan and billing period. The method returns a billing.PaymentLink object. ```APIDOC ## billing.requestPaymentLink ### Description Creates a payment link for a specified plan and billing period. ### Method billing.requestPaymentLink ### Parameters - **redirect_url** (string) - Required - The URL to redirect to after payment. - **plan** (string) - Required - The plan identifier. - **billing_period** (string) - Required - The billing period: monthly or yearly. ### Returns - **billing.PaymentLink** - The payment link object. ``` -------------------------------- ### media.DownloadFilePart Source: https://osmium.chat/docs/api/files Downloads a range of bytes from a stored file. The request specifies the file reference, byte offset, and maximum length, and the response contains the requested bytes. ```APIDOC ## media.DownloadFilePart ### Description Downloads a range of bytes from a stored file. The request specifies the file reference, byte offset, and maximum length, and the response contains the requested bytes. ### Method media.DownloadFilePart ### Request #### Fields - **fileRef** (FileRef) - Required - Identifies the stored file to download - **offset** (integer) - Required - Starting byte, measured from the beginning of the file - **length** (integer) - Required - Maximum number of bytes to return ### Request Example ``` DownloadFilePart { fileRef: FileRef { mediaFile: { fileId: ... } } offset: 0 length: 1048576 } ``` ### Response #### Success Response - **data** (bytes) - The requested bytes for the range from offset through offset + length #### Response Example ``` FilePart { data: <bytes for offset through offset + length> } ``` ### Notes - Downloads are range-based: each request specifies the byte offset and number of bytes to retrieve. - The server always returns whatever bytes are available, even when length extends beyond the end of the file. - For files such as avatars, where no part count is provided, clients can default to a 1 MiB request size. ``` -------------------------------- ### communities.createCommunity Source: https://osmium.chat/docs/api/communities.createcommunity Creates a new community with the given name. The method takes a single parameter, name, which is a string. ```APIDOC ## communities.createCommunity ### Description Creates a new community with the specified name. ### Method createCommunity ### Parameters - **name** (string) - Required - The name of the community to create. ``` -------------------------------- ### settings.registerPushSubscription Source: https://osmium.chat/docs/proto/settings.registerpushsubscription Registers a push subscription for the current user. The subscription can be either a WebPush or a Push type, with the appropriate fields. ```APIDOC ## settings.registerPushSubscription ### Description Registers a push subscription for the current user. The subscription can be either a WebPush or a Push type. ### Method method ### Parameters #### Request Body - **subscription** (One of: `subscription`) - Required - The subscription object. Must be either a `WebPush` or `Push`. - **web** (WebPush) - Optional - Web push subscription details. - **push** (Push) - Optional - Native push subscription details. ### Inner Types #### Push - **type** (PushType) - Required - The type of push subscription. - **token** (string) - Required - The push token. - **encryption_public_key** (optional string) - Optional - Encryption public key. - **encryption_auth_secret** (optional string) - Optional - Encryption auth secret. - **encryption_key_id** (optional string) - Optional - Encryption key ID. - **encryption_scheme** (PushEncryptionScheme) - Required - The encryption scheme. #### PushEncryptionScheme - `PUSH_ENCRYPTION_UNKNOWN` = `0` - `P256_HKDF_SHA256_AES256GCM_V1` = `1` #### PushType - `UNKNOWN` = `0` - `WEB` = `1` - `IOS` = `2` - `ANDROID_FCM` = `3` #### WebPush - **endpoint** (string) - Required - The web push endpoint. - **p256dh** (string) - Required - The P-256 DH key. - **auth** (string) - Required - The auth secret. ### Response No response body is documented. ``` -------------------------------- ### types.NotifPrefs Source: https://osmium.chat/docs/api/types.notifprefs Enumeration of notification preference values. Use these values to configure notification behavior. ```APIDOC ## types.NotifPrefs ### Description Enumeration of notification preference values. ### Values | Name | Value | |------|-------| | `ALL` | `0` | | `MENTIONS` | `1` | | `NONE` | `2` | | `DEFAULT` | `3` | ``` -------------------------------- ### friends.syncFriends method Source: https://osmium.chat/docs/api/friends.syncfriends Syncs the friends and community memberships for a user, identified by platform user IDs and hashed identifiers. ```APIDOC ## friends.syncFriends ### Description Syncs the friend list and community memberships for a platform user, using hashed identifiers for privacy and consistency. ### Method friends.syncFriends ### Parameters | Name | Type | Required | Description | |------|------|----------|-------------| | `platform_user_id` | `string` | Required | The platform-specific identifier of the user. | | `hashed_platform_user_id` | `bytes` | Required | A hashed version of the platform user ID, used for secure linking. | | `platform_user_name` | `string` | Optional | The name of the user on the platform. | | `platform` | `string` | Required | The platform from which the user's data is being synced (e.g., Twitter, Facebook). | | `friend_ids_hashed` | `repeated bytes` | Required | A list of hashed identifiers for the user's friends. | | `community_ids_hashed` | `repeated bytes` | Required | A list of hashed identifiers for the communities the user belongs to. | ``` -------------------------------- ### friends.syncFriends Source: https://osmium.chat/docs/proto/friends.syncfriends The friends.syncFriends method allows clients to synchronize the user's friend list and community memberships with the Osmium platform. It accepts the user's platform identifier, hashed identifiers, and lists of hashed friend and community IDs. ```APIDOC ## friends.syncFriends ### Description Synchronizes the user's friends and community memberships with the Osmium platform. ### Method friends.syncFriends ### Parameters | Name | Type | |---|---| | `platform_user_id` | `string` | | `hashed_platform_user_id` | `bytes` | | `platform_user_name` | `optional string` | | `platform` | `string` | | `friend_ids_hashed` | `repeated bytes` | | `community_ids_hashed` | `repeated bytes` | ``` -------------------------------- ### chats.createChat Source: https://osmium.chat/docs/api/chats.createchat Creates a new chat. Returns a types.Group object. ```APIDOC ## chats.createChat ### Description Creates a new chat with the given users and name. ### Method createChat ### Parameters | Name | Type | |------|------| | `users` | `repeated refs.UserRef` | | `name` | `string` | ### Returns `types.Group` ``` -------------------------------- ### communities.addMember Source: https://osmium.chat/docs/api/communities.addmember Adds a user to a community. Requires the community ID and the user ID. ```APIDOC ## communities.addMember ### Description Adds a member to a community. ### Method communities.addMember ### Parameters - **community_id** (Snowflake<Community>) - Required - The ID of the community. - **user_id** (Snowflake<User>) - Required - The ID of the user to add. ``` -------------------------------- ### stickers.getStickerPack Source: https://osmium.chat/docs/api/stickers.getstickerpack Retrieves a sticker pack based on the provided pack reference. The method returns a stickers.StickerPack object. ```APIDOC ## stickers.getStickerPack ### Description Retrieves a sticker pack based on the provided pack reference. ### Method stickers.getStickerPack ### Parameters - **pack** (refs.StickerPackRef) - Required - The reference to the sticker pack to retrieve. ### Returns - **stickers.StickerPack** - The requested sticker pack. ``` -------------------------------- ### voice.getRoomStates Source: https://osmium.chat/docs/api/voice.getroomstates Retrieves the global room states for the Osmium protocol. This method takes no parameters and returns a voice.GlobalRoomStates object. ```APIDOC ## voice.getRoomStates ### Description Retrieves the global room states for the Osmium protocol. ### Method voice.getRoomStates ### Parameters This definition has no fields. ### Returns voice.GlobalRoomStates ``` -------------------------------- ### billing.redeemInventoryItem Source: https://osmium.chat/docs/api/billing.redeeminventoryitem Redeems one of your own inventory items, stacking the time after any benefits you already have. ```APIDOC ## billing.redeemInventoryItem ### Description Redeems one of your own inventory items, stacking the time after any benefits you already have. ### Method method ### Parameters #### Path Parameters - **item_id** (Snowflake<InventoryItem>) - Required - The ID of the inventory item to redeem. ``` -------------------------------- ### voice.requestRoom Source: https://osmium.chat/docs/api/voice.requestroom Requests a voice room for a chat. Takes a chat reference and returns room information. ```APIDOC ## voice.requestRoom ### Description Requests a voice room for a chat. Takes a chat reference and returns room information. ### Method voice.requestRoom ### Parameters - **chat_ref** (refs.ChatRef) - Required - The reference to the chat for which the room is requested. ### Returns RoomInfo ``` -------------------------------- ### auth.getSessions Source: https://osmium.chat/docs/api/auth.getsessions Returns an auth.Sessions object. This method takes no parameters. ```APIDOC ## auth.getSessions ### Description Returns an auth.Sessions object. ### Method auth.getSessions ### Parameters This definition has no fields. ### Returns auth.Sessions ``` -------------------------------- ### settings.editProfile Source: https://osmium.chat/docs/api/settings.editprofile Updates the user's profile settings. Accepts optional parameters for name, username, bio, icon, color, theme color, and voice banner visibility. ```APIDOC ## settings.editProfile ### Description Updates the user's profile settings. Accepts optional parameters for name, username, bio, icon, color, theme color, and voice banner visibility. ### Method settings.editProfile ### Parameters - **name** (optional string) - Optional - The user's display name. - **username** (optional string) - Optional - The user's username. - **bio** (optional string) - Optional - The user's biography. - **icon** (optional Snowflake<Emoji>) - Optional - The emoji icon for the profile. - **color** (optional uint32) - Optional - The profile color. - **theme_color** (optional uint64) - Optional - Packed RGB colors: first color in bits 0-23, second color in bits 24-47. - **show_banner_in_voice** (optional bool) - Optional - Whether to show the banner in voice channels. ``` -------------------------------- ### discovery.getDiscoverableCommunities Source: https://osmium.chat/docs/api/discovery.getdiscoverablecommunities Documentation for the discovery.getDiscoverableCommunities method, including its parameters and return type. ```APIDOC ## discovery.getDiscoverableCommunities ### Description Retrieves a list of discoverable communities, with optional pagination. ### Method `discovery.getDiscoverableCommunities` ### Parameters - **after** (`optional fixed64`) - Optional - Pagination cursor. - **limit** (`uint32`) - Required - Maximum number of communities to return. ### Returns `discovery.DiscoveryCommunities` ``` -------------------------------- ### stickers.addStickerToPack Source: https://osmium.chat/docs/api/stickers.addstickertopack Adds a sticker to an existing sticker pack. The method requires a sticker pack reference and an uploaded sticker media file. ```APIDOC ## stickers.addStickerToPack ### Description Adds a sticker to an existing sticker pack using a sticker pack reference and an uploaded sticker media file. ### Method stickers.addStickerToPack ### Parameters - `pack` (`refs.StickerPackRef`) - Required - The reference to the sticker pack where the sticker will be added. - `sticker` (`media.MediaRefUploadedFile`) - Required: The uploaded sticker media file to add to the pack. ``` -------------------------------- ### billing.getSubscription Source: https://osmium.chat/docs/api/billing.getsubscription Retrieves the billing subscription information. This method takes no parameters and returns a billing.Subscription object. ```APIDOC ## billing.getSubscription ### Description Retrieves the billing subscription information. ### Method billing.getSubscription ### Parameters This method has no fields. ### Returns billing.Subscription ``` -------------------------------- ### settings.regenerateRecoveryCodes Source: https://osmium.chat/docs/api/settings.regeneraterecoverycodes Regenerates recovery codes for the authenticated user. Requires a step-up token to proceed. ```APIDOC ## settings.regenerateRecoveryCodes ### Description Regenerates recovery codes for the user. Returns the new recovery codes. ### Method settings.regenerateRecoveryCodes ### Parameters - **step_up_token** (string) - Required - The step-up token required to authorize the regeneration. ### Returns settings.RecoveryCodes - The newly generated recovery codes. ``` -------------------------------- ### users.getProfile Source: https://osmium.chat/docs/api/users.getprofile Retrieves the profile of a user identified by the provided reference. Optionally includes mutual connections. ```APIDOC ## users.getProfile ### Description Retrieves the profile of a user identified by the provided reference. Optionally includes mutual connections. ### Method users.getProfile ### Parameters - **ref** (refs.UserRef) - Required - The reference to the user whose profile is to be retrieved. - **include_mutuals** (bool) - Optional - Whether to include mutual connections in the profile. ### Returns Profile ``` -------------------------------- ### communities.getRoles Source: https://osmium.chat/docs/api/communities.getroles Fetches roles in the community that the user is allowed to see. Meant to be admin only, currently not enforced until Member List v2. Returns communities.CommunityRoles. ```APIDOC ## communities.getRoles ### Description Fetches roles in the community that the user is allowed to see. Meant to be admin only, currently not enforced until Member List v2. ### Method method ### Parameters #### Path Parameters - **community_id** (Snowflake<Community>) - Required - The ID of the community whose roles are to be fetched. ### Returns - **communities.CommunityRoles** - The roles in the community that the user is allowed to see. ``` -------------------------------- ### settings.editProfileBanner Source: https://osmium.chat/docs/api/settings.editprofilebanner Documentation for the settings.editProfileBanner method, which updates the user's profile banner. ```APIDOC ## settings.editProfileBanner ### Description Updates the profile banner for the current user. ### Method method ### Parameters - **file** (optional media.UploadedFileRef) - Optional. The new profile banner image file. ``` -------------------------------- ### media.MediaRef (uploaded variant) Source: https://osmium.chat/docs/api/files References media attached to other objects, such as messages or community avatars. The uploaded variant is constructed using an UploadedFileRef, along with the file's MIME type, filename, and optional metadata. ```APIDOC ## media.MediaRef (uploaded variant) ### Description References media attached to other objects, such as messages or community avatars. The uploaded variant is constructed using an UploadedFileRef, along with the file's MIME type, filename, and optional metadata. ### Fields - **uploaded** (UploadedFileRef) - Required - The uploaded file reference. - **mimeType** (string) - Required - The MIME type of the file. - **filename** (string) - Required - The filename of the file. - **metadata** (media.FileMetadata) - Optional - Additional metadata for the file. ### Usage The operation that consumes this media returns or stores the resulting media.File and its permanent fileId. ``` -------------------------------- ### settings.unregisterPushSubscription Source: https://osmium.chat/docs/api/settings.unregisterpushsubscription The settings.unregisterPushSubscription method is used to unregister a push subscription. It accepts no parameters. ```APIDOC ## settings.unregisterPushSubscription ### Description Unregisters a push subscription. ### Method method ### Parameters This method has no fields. ``` -------------------------------- ### reactions.addReaction Source: https://osmium.chat/docs/api/reactions.addreaction Adds a reaction to a message. Requires a chat reference, message ID, and the emoji to react with. ```APIDOC ## reactions.addReaction ### Description Adds a reaction to a message in a chat. ### Method reactions.addReaction ### Parameters | Name | Type | Description | |------|------|-------------| | `chat_ref` | `refs.ChatRef` | Reference to the chat containing the message. | | `message_id` | `Snowflake<Message>` | ID of the message to react to. | | `emoji` | `ReactionEmoji` | The emoji to add as a reaction. | ``` -------------------------------- ### CommunityPermission Enum Values Source: https://osmium.chat/docs/api/types.communitypermission Lists all permission values defined in the CommunityPermission enum, each represented as a bit flag. ```APIDOC ## CommunityPermission Enum ### Description Enum bitflag defining community permission values. ### Values | Name | Value | |------|-------| | `NO_PERMISSION` | `0` | | `ADMINISTRATOR` | `1 << 0` (1) | | `VIEW_CHANNEL` | `1 << 1` (2) | | `SEND_MESSAGES` | `1 << 2` (4) | | `CONNECT_VOICE` | `1 << 3` (8) | | `MODIFY_CHANNEL` | `1 << 4` (16) | | `SEND_MEDIA` | `1 << 5` (32) | | `DELETE_MESSAGES` | `1 << 6` (64) | | `PIN_MESSAGES` | `1 << 7` (128) | | `SPEAK_VOICE` | `1 << 8` (256) | | `MODIFY_COMMUNITY` | `1 << 9` (512) | | `MODIFY_ROLES` | `1 << 10` (1024) | | `REMOVE_MEMBERS` | `1 << 11` (2048) | | `ADD_REACTIONS` | `1 << 12` (4096) | | `MODIFY_LINKED_STICKERS` | `1 << 13` (8192) | ``` -------------------------------- ### settings.changeEmail Source: https://osmium.chat/docs/api/settings.changeemail The settings.changeEmail method allows changing the user's email address. It requires a new_email parameter of type string. ```APIDOC ## settings.changeEmail ### Description Changes the user's email address. ### Method settings.changeEmail ### Parameters - **new_email** (string) - Required - The new email address to set. ``` -------------------------------- ### settings.editUserSettings Source: https://osmium.chat/docs/api/settings.editusersettings Edits user settings. Accepts an optional UserSettings object and returns the updated settings.UserSettings. ```APIDOC ## settings.editUserSettings ### Description Edits user settings and returns the updated settings. ### Method settings.editUserSettings ### Parameters - **settings** (optional UserSettings) - Optional - The user settings to apply. ### Returns settings.UserSettings ``` -------------------------------- ### Channel Class Fields Source: https://osmium.chat/docs/api/types.channel Defines the structure of a Channel object with its fields and types. ```APIDOC ## Channel Class ### Description Represents a channel in the Osmium protocol. ### Fields - **id** (Snowflake<Channel>) - The unique identifier of the channel. - **community_id** (Snowflake<Community>) - The identifier of the community this channel belongs to. - **name** (string) - The name of the channel. - **type** (ChannelType) - The type of the channel. - **position** (uint32) - The position of the channel in the channel list. - **parent_id** (optional Snowflake<Channel>) - The identifier of the parent channel, if any. - **flags** (uint64) - Bitfield flags for the channel. - **highlighted_msg_id** (optional Snowflake<Message>) - The identifier of a highlighted message, if any. - **description** (optional string) - A description of the channel. - **slowmode_seconds** (optional uint32) - The slowmode delay in seconds, if set. - **preferred_region** (optional string) - The preferred region for the channel. ``` -------------------------------- ### communities.getRoomStates Source: https://osmium.chat/docs/api/communities.getroomstates Retrieves the room states for a specified community. The method requires a community_id parameter and returns a communities.RoomStates object. ```APIDOC ## communities.getRoomStates ### Description Retrieves the room states for a specified community. ### Method communities.getRoomStates ### Parameters #### Path Parameters - **community_id** (Snowflake<Community>) - Required - The ID of the community. ### Returns communities.RoomStates ``` -------------------------------- ### communities.leaveCommunity Source: https://osmium.chat/docs/api/communities.leavecommunity Leaves the specified community. Requires the community_id of the community to leave. ```APIDOC ## communities.leaveCommunity ### Description Leaves the specified community. ### Method method ### Parameters #### Path Parameters - **community_id** (Snowflake<Community>) - Required - The ID of the community to leave. ``` -------------------------------- ### users.lookupUsername Source: https://osmium.chat/docs/api/users.lookupusername This method looks up a user by their username and returns the user's details. ```APIDOC ## users.lookupUsername ### Description Looks up a user by their username and returns the user's details. ### Method users.lookupUsername ### Parameters - **username** (string) - Required - The username of the user to look up. ### Returns UserDetails ``` -------------------------------- ### billing.cancelSubscription Source: https://osmium.chat/docs/api/billing.cancelsubscription The billing.cancelSubscription method is a protocol method that returns a billing.CancelSubscription object. It has no parameters. ```APIDOC ## billing.cancelSubscription ### Description This method cancels a subscription. It returns a billing.CancelSubscription object. ### Method cancelSubscription ### Returns billing.CancelSubscription ### Parameters This method has no fields. ``` -------------------------------- ### media.FileMetadata class Source: https://osmium.chat/docs/proto/media.filemetadata File metadata used to store information about the file, included with media. Contains fields for image, video, audio, file, and custom emoji metadata types. ```APIDOC ## media.FileMetadata ### Description File metadata, used to store information about the file, included with media. ### Fields One of: `metadata` - `image`| `MetadataImage` - `video`| `MetadataVideo` - `audio`| `MetadataAudio` - `file`| `MetadataFile` - `custom_emoji`| `MetadataCustomEmoji` ### Inner Types #### MetadataAudio - `duration` (uint32) - in seconds #### MetadataCustomEmoji - `width` (uint32) - `height` (uint32) - `emoji` (string) - `pack` (refs.StickerPackRef) - `animated` (bool) #### MetadataFile This definition has no fields. #### MetadataImage - `width` (uint32) - `height` (uint32) - `preview` (optional bytes) - `animated` (bool) #### MetadataVideo - `width` (uint32) - `height` (uint32) - `duration` (uint32) - in seconds ```