Edit on GitHub

Expand call metadata

Calls can be configured to expand additional metadata into the context field of the request payload. The call’s expand (godoc) field contains a list of the available metadata and how much of that data should be expanded. Metadata is not expanded by default.

The expand value contains the following fields:

Name Type Description
app ExpandLevel Expands the app information.
acting_user ExpandLevel Expands the acting user information.
acting_user_access_token ExpandLevel Include the user-level access token.
locale ExpandLevel Expands the user locale, to be used in localizations.
channel ExpandLevel Expands the channel information.
channel_member ExpandLevel Expands channel member information.
team ExpandLevel Expands the team information.
team_member ExpandLevel Expands team member information.
post ExpandLevel Expands the post information.
root_post ExpandLevel Expands the root post information.
user ExpandLevel Expands the subject user information.
oauth2_app ExpandLevel Expands the remote OAuth2 configuration data.
oauth2_user ExpandLevel Expands the remote OAuth2 user data.

Expand levels 

Each ExpandLevel (string) value can be one of the following:

Name Description
none Include no data for the field.
all Include all data available for the field.
summary Include key metadata for the field.
id Include only relevant identifiers (IDs).

Available information 

The following table details what sub-fields are included for each metadata field for the summary and id ExpandLevels:

Metadata Field Data Type summary level
sub-fields
id level
sub-fields
app App app_id
version
bot_user_id
bot_username
no sub-fields
acting_user User bot_description
delete_at
email
first_name
id
is_bot
last_name
locale
nickname
roles
timezone
username
id
acting_user_access_token
(all level only)
string no sub-fields no sub-fields
locale string same as all level n/a
channel Channel id
deleted_at
team_id
type
display_name
name
id
channel_member ChannelMember same as all level no sub-fields
team Team id
display_name
name
description
email
type
id
team_member TeamMember same as all level no sub-fields
post/root_post Post id
type
user_id
channel_id
root_id
message
id
user User bot_description
delete_at
email
first_name
id
is_bot
last_name
locale
nickname
roles
timezone
username
id
oauth2_app OAuth2Context no sub-fields no sub-fields
oauth2_user any no sub-fields no data

Did you find what you were looking for?

Thank you! We appreciate your feedback.
ร—

Tell us more

Your feedback helps us improve the Mattermost developer documentation.

Have a feature request? Share it here.

Having issues? Join our Community server.