← Back to packages

Package org.signal.chat.profile

Service Profile

Service ProfileAnonymous

Message AccountInfo

Message DeleteAvatarRequest

Message DeleteAvatarResponse

Message ExpectedVersionConflict

Message ExtendAvatarTTLRequest

Message ExtendAvatarTTLResponse

Message GetAvatarCredentialRequest

Message GetAvatarCredentialResponse

Message GetAvatarUploadFormRequest

Message GetAvatarUploadFormResponse

Message GetProfileAnonymousRequest

Message GetProfileAnonymousResponse

Message GetProfileKeyCredentialRequest

Message GetProfileKeyCredentialResponse

Message GetProfileKeyCredentialResult

Message GetProfileRequest

Message GetProfileResponse

Message LegacyProfileResult

Message PaymentsForbiddenInRegion

Message ProfileResult

Message ProfilesV2CapabilityRequired

Message SetProfileRequest

Message SetProfileResponse

Message SetProfileResult

Message SetProfileV1Request

Message SetV1AvatarRequest

Message SetV1AvatarResponse

Enum AvatarChange

Enum CredentialType

Services

service Profile

Provides methods for working with profiles and profile-related data.

Sets profile data and, if needed, returns a credential used by clients to upload a v1 avatar.

Retrieves profile data. Callers with an unidentified access key for the account should use the version of this method in ProfileAnonymous instead.

Returns an anonymous credential that may be presented with avatar operations in ProfilesAnonymous

Note: Accounts.SetZkCredentialKey is a pre-requisite for this RPC

Returns a credential used by clients to upload a v1 avatar, deleting any current avatar.

This RPC streamlines avatar changes during the v1 -> v2 transition by minimizing uploads: 1. SetV1Avatar 2. Upload to CDN 3. SetProfile with v1 AVATAR_CHANGE_UNCHANGED and the v1 avatar in the v2 profile body

Clients that do this will be required to upload current avatars using ProfilesAnonymous.GetAvatarUploadFormRequest once v1 Profile APIs are no longer supported.

service ProfileAnonymous

Provides methods for working with profiles and profile-related data using "unidentified access" credentials. Callers must not submit any self-identifying credentials when calling methods in this service and must instead present the targeted account's unidentified access key as an anonymous authentication mechanism. Callers without an unidentified access key should use the equivalent, authenticated methods in Profile instead.

Returns a credential to upload a v2 avatar. After uploading the avatar, the client must call SetProfile with the new avatar URL in the encrypted data.

Because avatars are uploaded anonymously, they have an expiration equal to the idle account expiration. Clients must periodically (recommended: every 90 days) call ExtendAvatarTTL to extend the TTl.

Note: any existing avatar associated with this credential will be deleted immediately

Extends the TTL of the avatar currently associated with the request’s avatar auth credential

Deletes the avatar currently associated with the request’s avatar auth credential.

Clients must also call SetProfile to remove the avatar from the encrypted data.

Messages

message AccountInfo

Field Type Description
1 identity_key bytes

The account identity key of the targeted account.

2 unidentified_access_key_fingerprint bytes

A checksum of the unidentified access key for the targeted account.

3 unrestricted_unidentified_access bool

Whether the account has enabled sealed sender from anyone.

4 badge_ids repeated string

A list of the badges ids associated with the account. Metadata to display badges may be obtained by cross-referencing badge ids with RemoteConfiguration.GetBadges.

message DeleteAvatarRequest

Field Type Description
1 avatar_credential_presentation bytes

message DeleteAvatarResponse

Field Type Description
oneof response
1 success google.protobuf.Empty
2 invalid_credential_presentation org.signal.chat.errors.FailedZkAuthentication

message ExpectedVersionConflict

Field Type Description
2 current_profile_version bytes

In certain, highly unlikely, cases, a new profile version might not be distributed among all devices. These devices wouldn't be able to decrypt the profile, but the value can be used to set a new version.

message ExtendAvatarTTLRequest

Field Type Description
1 avatar_credential_presentation bytes

message ExtendAvatarTTLResponse

Field Type Description
oneof response
1 url string

The avatar that was extended. May be used as a check against state de-synchronization.

2 invalid_credential_presentation org.signal.chat.errors.FailedZkAuthentication
3 not_found org.signal.chat.errors.NotFound

the identity does not have an active avatar

message GetAvatarCredentialRequest

Field Type Description
1 avatar_credential_request bytes

message GetAvatarCredentialResponse

Field Type Description
oneof response
1 avatar_credential bytes
2 missing_zk_credential_key org.signal.chat.errors.FailedPrecondition

the client must call Accounts.SetZkCredentialKey to call this method

message GetAvatarUploadFormRequest

Field Type Description
1 avatar_credential_presentation bytes
2 upload_length uint32

The length of the attachment for the requested upload form. Uploads performed with this form will be limited to the provided length.

message GetAvatarUploadFormResponse

Field Type Description
oneof response
1 avatar_upload_form org.signal.chat.common.S3UploadForm

the policy and credential used by clients to upload an avatar to the CDN

2 invalid_credential_presentation org.signal.chat.errors.FailedZkAuthentication

message GetProfileAnonymousRequest

Field Type Description
1 request org.signal.chat.profile.GetProfileRequest

Contains the data necessary to request a profile.

oneof authentication
2 unidentified_access_key bytes

The unidentified access key for the targeted account.

3 group_send_token bytes

A group send endorsement token for the targeted account.

message GetProfileAnonymousResponse

Field Type Description
oneof response
1 profile org.signal.chat.profile.ProfileResult

The full profile data. The current profile did not match the provided etag (or no etag was provided).

2 etag_matched bool

The current profile matched the provided etag. If present, this will always be true.

3 not_found org.signal.chat.errors.NotFound
4 failed_unidentified_authorization org.signal.chat.errors.FailedUnidentifiedAuthorization
15 profile_v1 org.signal.chat.profile.LegacyProfileResult

Will be present if there is no v2 Profile data for this version.

Because this is a temporary field during the migration, it has the highest field number without serialization overhead. This is purely aesthetic.

message GetProfileKeyCredentialRequest

Field Type Description
1 account_identifier org.signal.chat.common.ServiceIdentifier

The ACI of the account for which to get a profile key credential.

2 credential_request bytes

A zkgroup request for a profile key credential for the target’s current profile.

3 credential_type org.signal.chat.profile.CredentialType

The type of credential being requested.

4 unidentified_access_key bytes

The unidentified access key for the targeted account.

message GetProfileKeyCredentialResponse

Field Type Description
oneof response
1 result org.signal.chat.profile.GetProfileKeyCredentialResult
2 not_found org.signal.chat.errors.NotFound

Indicates the account was not found or the account's current profile was not found. Use AccountsAnonymous.CheckAccountExistence for a canonical account existence check.

3 failed_unidentified_authorization org.signal.chat.errors.FailedUnidentifiedAuthorization

The provided unidentified access key was incorrect

message GetProfileKeyCredentialResult

Field Type Description
1 profile_key_credential bytes

A zkgroup credential used by a client to prove that it has the profile key of a targeted account.

message GetProfileRequest

Field Type Description
1 account_identifier org.signal.chat.common.ServiceIdentifier

The ACI of the account for which to get profile data.

2 version bytes

The profile version to retrieve.

3 etag bytes

The etag from the previous request for this Profile version. If unchanged, the response will omit profile and etag_matched will be true.

message GetProfileResponse

Field Type Description
oneof response
1 profile org.signal.chat.profile.ProfileResult

The full profile data. The current profile did not match the provided etag (or no etag was provided).

2 etag_matched bool

The current profile matched the provided etag. If present, this will always be true.

3 not_found org.signal.chat.errors.NotFound
15 legacy_profile org.signal.chat.profile.LegacyProfileResult

Will be present if there is no v2 Profile data for this version.

Because this is a temporary field during the migration, it has the highest field number without serialization overhead. This is purely aesthetic.

message LegacyProfileResult

Field Type Description
1 name bytes

The ciphertext of the name on the profile.

2 about bytes

The ciphertext of the description on the profile.

3 about_emoji bytes

The ciphertext of the emoji on the profile.

4 avatar_url string

The URL of the avatar on the profile.

5 phone_number_sharing bytes

The ciphertext of the phone-number sharing setting on the profile.

6 payment_address bytes

The ciphertext of the MobileCoin wallet ID on the profile.

7 account_info org.signal.chat.profile.AccountInfo

Information about the targeted account

message PaymentsForbiddenInRegion

Indicates that the account is not permitted to set a payment address, due to a disallowed country prefix on the account's phone number.

Field Type Description

message ProfileResult

Field Type Description
1 data bytes

The ciphertext of the requested version of the profile

2 payment_address bytes

The ciphertext of the MobileCoin wallet ID on the profile.

3 account_info org.signal.chat.profile.AccountInfo

Information about the targeted account

4 etag bytes

An entity tag for the profile. This may be used in subsequent requests for this profile version to optimize bandwidth.

Note that this hash will not match the expected_data_hash used on SetProfile for concurrency control.

Clients may validate that the value has been correctly calculated by calculating a 10-byte truncated TupleHash256 as follows:

TupleHash256(S = "ProfileETag/v1", L = 80 bits, tuple = [ data, payment_address, account_info.identity_key, account_info.unidentified_access_key_fingerprint, account_info.unrestricted_unidentified_access ? 0x01 : 0x00, uint32BE(count(account_info.badge_ids)), utf8(id) for each id in sortLexAscendingByUtf8Bytes(account_info.badge_ids), ])

Absent/empty fields contribute an empty element (not zero bytes omitted): a missing payment_address is still a present, zero-length tuple element.

This etag will always exclusively cover the documented fields. If fields are added in the future, a new etag field must be introduced.

message ProfilesV2CapabilityRequired

Indicates that the account does not have the Profiles v2 capability, which is required to call Profiles.SetProfile

Field Type Description

message SetProfileRequest

Field Type Description
1 version bytes

The profile version. Required.

2 data bytes

The ciphertext of a serialized Profile protobuf. Required. 1486 max length = 1202 plaintext serialization + 256-byte external padding PKCS#7 + 28 bytes encryption overhead

3 expected_current_data_hash bytes

The SHA-256 hash of the Profile ciphertext being replaced. This is used an optimistic lock against concurrent changes.

Optional, if this is the initial request to create a version.

4 expected_current_version bytes

The current profile version being updated. This is used as an optimistic lock against concurrent changes.

Optional, if there is no current profile version for the account.

5 payment_address bytes

The ciphertext of the MobileCoin wallet ID on the profile.

6 badge_ids repeated string

A list of badge IDs associated with the profile.

7 commitment bytes

The profile key commitment. Used to issue a profile key credential response.

Required during the v1 -> v2 migration period. Afterwards will be optional, if this is an update to an existing version.

15 v1Request org.signal.chat.profile.SetProfileV1Request

An embedded v1 request. Required during the v1 -> v2 migration period.

Because this is a temporary field during the migration, it has the highest field number without serialization overhead. This is purely aesthetic.

message SetProfileResponse

Field Type Description
oneof response
1 result org.signal.chat.profile.SetProfileResult
2 expected_data_write_conflict org.signal.chat.errors.FailedPrecondition

The current data hash did not match the request's expectation, indicating another device on the account may have written an update the caller does not know about.

3 payments_forbidden_in_region org.signal.chat.profile.PaymentsForbiddenInRegion

Payments are not permitted in the account's region, based on its phone number or the caller's IP address if the account does not have a phone number. The request should be retried without `payment_address.

4 expected_version_write_conflict org.signal.chat.profile.ExpectedVersionConflict

The current version did not match the request's expectation, indicating another device on the account may have created a new version the caller does not know about.

message SetProfileResult

Field Type Description
15 v1_avatar_upload_form optional org.signal.chat.common.S3UploadForm

If the request included a v1 avatar change, this field contains the policy and credential used by clients to upload an avatar to the CDN.

Because this is a temporary field during the migration, it has the highest field number without serialization overhead. This is purely aesthetic.

message SetProfileV1Request

Field Type Description
1 name bytes

The ciphertext of a name that users must set on the profile.

2 avatar_change org.signal.chat.profile.SetProfileV1Request.AvatarChange

An enum to indicate what change, if any, is made to the avatar with this request.

3 about_emoji bytes

The ciphertext of an emoji that users can set on their profile.

4 about bytes

The ciphertext of a description that users can set on their profile.

6 phone_number_sharing bytes

The ciphertext of the phone-number sharing setting on the profile. 29-byte encrypted boolean.

message SetV1AvatarRequest

Field Type Description
1 version string

The profile version. Required.

2 commitment bytes

The profile key commitment. Required if this is a new profile version.

message SetV1AvatarResponse

Field Type Description
1 form org.signal.chat.common.S3UploadForm

the policy and credential used by clients to upload an avatar to the CDN

Enums

enum AvatarChange

Name Number Description
AVATAR_CHANGE_UNCHANGED 0
AVATAR_CHANGE_CLEAR 1
AVATAR_CHANGE_UPDATE 2

enum CredentialType

Name Number Description
CREDENTIAL_TYPE_UNSPECIFIED 0
CREDENTIAL_TYPE_EXPIRING_PROFILE_KEY 1