Search + K

Command Palette

Search for a command to run...

Sign In

conversations_history

GET /conversations.history
Copy endpoint
https://slack.com/api

Fetches a conversation's history of messages and events.

Parameters

query Query Parameters

Name Type
token

Authentication token. Requires scope: conversations:history

string
channel

Conversation ID to fetch history for.

string
latest

End of time range of messages to include in results.

number
oldest

Start of time range of messages to include in results.

number
inclusive

Include messages with latest or oldest timestamp in results only when either timestamp is specified.

boolean
limit

The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.

number
cursor

Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.

string

Responses

200 application/json

Typical success response containing a channel's messages

{
channel_actions_count: number;
channel_actions_ts: (number | null)[];
has_more: boolean;
messages: ObjsMessage
interface ObjsMessage {
attachments?: {
fallback?: string;
id: number;
image_bytes?: number;
image_height?: number;
image_url?: string;
image_width?: number;
}
[]
;
blocks?: Blocks;
bot_id?: (DefsBotId | null)[];
bot_profile?: ObjsBotProfile;
client_msg_id?: string;
comment?: ObjsComment;
display_as_bot?: boolean;
file?: ObjsFile;
files?: ObjsFile[];
icons?: { emoji?: string;image_64?: string; };
inviter?: DefsUserId;
is_delayed_message?: boolean;
is_intro?: boolean;
is_starred?: boolean;
last_read?: DefsTs;
latest_reply?: DefsTs;
name?: string;
old_name?: string;
parent_user_id?: DefsUserId;
permalink?: string;
pinned_to?: DefsChannel[];
purpose?: string;
reactions?: ObjsReaction[];
reply_count?: number;
reply_users?: DefsUserId[];
reply_users_count?: number;
source_team?: DefsWorkspaceId;
subscribed?: boolean;
subtype?: string;
team?: DefsWorkspaceId;
text: string;
thread_ts?: DefsTs;
topic?: string;
ts: DefsTs;
type: string;
unread_count?: number;
upload?: boolean;
user?: DefsUserId;
user_profile?: ObjsUserProfileShort;
user_team?: DefsWorkspaceId;
username?: string;
}
[]
;
ok: DefsOkTrue
type DefsOkTrue = true
;
pin_count: number;
}
default application/json

Typical error response

{
callstack?: string;
error: "missing_scope" | "channel_not_found" | "invalid_ts_latest" | "invalid_ts_oldest" | "not_authed" | "invalid_auth" | "account_inactive" | "invalid_arg_name" | "invalid_array_arg" | "invalid_charset" | "invalid_form_data" | "invalid_post_type" | "missing_post_type" | "invalid_json" | "json_not_object" | "request_timeout" | "upgrade_required";
needed?: string;
ok: DefsOkFalse
type DefsOkFalse = false
;
provided?: string;
}