Slack.Web.Assistant.Search (SlackKit v1.0.0-alpha.0)

View Source

Summary

Functions

Searches messages, files, channels and users across your Slack organization.

Returns search capabilities on a given team.

Functions

context(query, optional_params \\ %{})

Searches messages, files, channels and users across your Slack organization.

API reference

Rate limit: Special rate limits apply.
Scopes:

View on docs.slack.dev ↗

Required Params

  • query - User prompt or search query ex: What is project gizmo?

Optional Params

  • action_token - Send action_token as received in a message event. ex: 12345.98765.abcd2358fdea
  • after - UNIX timestamp filter. If present, filters for results after this date. ex: 1754670081
  • before - UNIX timestamp filter. If present, filters for results before this date. ex: 1754670081
  • channel_types - Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im. ex: public_channel,private_channel
  • content_types - Content types to include, a comma-separated list of any combination of messages, files, channels, users. ex: messages,files
  • context_channel_id - Context channel ID to support scoping the search when applicable.
  • cursor - The cursor returned by the API. Leave this blank for the first request and use this to get the next page of results. ex: asf91j9jfd
  • disable_semantic_search - Whether to disable semantic search. When true, only keyword-based search is used. Defaults to false.
  • highlight - Whether to highlight the search query in the results. Defaults to false if unspecified.
  • include_archived_channels - Whether to include archived channels in the search results.
  • include_bots - Whether the results should include bots. ex: true
  • include_context_messages - Whether to include context messages surrounding the main message result. Defaults to false if unspecified. ex: true
  • include_deleted_users - Whether to include deleted users in the user search results. Defaults to false. ex: false
  • include_message_blocks - Whether to return the message blocks in the response.
  • limit - Number of results to return, up to a max of 20. Defaults to 20. ex: 20
  • modifiers - A string containing only modifiers in the format of modifier:value. Search results returned will match the modifier value. For now modifiers only affect term clauses. ex: has:pin before:yesterday
  • sort - The field to sort the results by. Defaults to score. Can be one of: score, timestamp.
  • sort_dir - The direction to sort the results by. Defaults to desc.
  • term_clauses - A list of term clauses. A term clause is a string with search terms. Search results returned will match every term clause specified (i.e., conjunctive normal form).

Errors the API can return:

  • assistant_search_context_disabled - We're having issues returning your search results. Please wait and try again.
  • context_channel_not_found - Specified context_channel_id is invalid or the user lacks permission to view it.
  • feature_not_enabled - The feature is not available on the current workspace.
  • invalid_action_token - The action_token provided is not valid.
  • invalid_cursor - The cursormark provided is not valid.
  • missing_query - Missing query.
  • query_too_long - Query too long.
  • rate_limited - Rate limited.

See the Common Errors guide for errors returned by every Web API method.

info(optional_params \\ %{})

Returns search capabilities on a given team.

API reference

Rate limit: Tier 2: 20+ per minute
Scopes:

View on docs.slack.dev ↗

See the Common Errors guide for errors returned by every Web API method.