@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    reactions: ReactionResource

    Methods

    • Delete a thread message Permanently removes the specified message from its thread. This action cannot be undone. A message may be deleted by its author, an admin of the org the message belongs to, an admin of the team that owns the thread, or the agent that sent it. Service-to-service callers with elevated (all_powerful) scope may delete any message in a thread they can access. Returns 403 Forbidden when the caller is not permitted to delete the message.

      Parameters

      • message: string

        ID of the message to delete (msg_...).

      Returns Promise<void>

      Empty body. The server responds with HTTP 204 No Content on success.

    • Retrieve a message Returns a single message by its globally unique message ID. The authenticated viewer must be able to read the message and its thread. The response includes the message's content, sender information, and any attachments that were loaded at creation time. For admin-authenticated requests, an additional admin field is returned containing raw metadata and the associated trajectory data (LLM input/output messages) if one exists. A trajectory belongs to the agent response it produced, so admin.trajectory is only populated on the response message. On the triggering user message the trajectory is omitted and admin.response_message links to the agent response (where the trajectory is shown), when a response exists. If the message is not found or is not visible to the caller, a 404 is returned.

      Parameters

      • message: string

        Globally unique message ID (msg_...).

      Returns Promise<ThreadMessage>

      The requested message, including its content, sender, and attachments.

    • Update a thread message Edits an existing thread message and returns the updated message object. A regular user may only edit messages they authored. Service-to-service callers with elevated (all_powerful) scope may edit any accessible message without an ownership check. Returns 403 Forbidden when the caller does not own the message.

      Parameters

      • message: string

        ID of the message to update (msg_...).

      • input: {
            acl?: {
                add?: { actions: string[]; principal?: string; principal_type: string }[];
                grants?: { actions: string[]; principal?: string; principal_type: string }[];
                remove?: { principal?: string; principal_type: string }[];
            };
            content?: string;
            metadata?: Record<string, unknown>;
            type?: string;
            visibility?: "default" | "private";
        }

        Request body.

        • Optionalacl?: {
              add?: { actions: string[]; principal?: string; principal_type: string }[];
              grants?: { actions: string[]; principal?: string; principal_type: string }[];
              remove?: { principal?: string; principal_type: string }[];
          }

          Access control list for a private message (replace or patch grants). Only valid when the message is already private. Omit to leave unchanged.

        • Optionalcontent?: string

          Replacement text content for the message. Omit to leave the content unchanged.

        • Optionalmetadata?: Record<string, unknown>

          Replacement key-value metadata. Keys beginning with sys: are reserved and stripped.

        • Optionaltype?: string

          Replacement client-defined classification. Free-form string up to 64 characters; platform-reserved values such as system are rejected.

        • Optionalvisibility?: "default" | "private"

          Create-time message visibility. Supplying the existing value is harmless, but changing between default and private returns 422.

      Returns Promise<Message>

      The updated message object.

    • List replies to a thread message Returns a cursor-paginated list of reply messages for the specified thread message. By default only direct (first-level) replies are returned. Set tree to true to retrieve the full nested reply tree in a flat list, ordered by creation time ascending. The authenticated user must have access to the thread that contains the message. If the message belongs to a team-scoped thread, the viewer is automatically scoped to that team before the query executes. Use before_cursor and after_cursor together with limit to page through large reply threads. The has_more field in the response indicates whether additional pages exist.

      Parameters

      • message: string

        ID of the thread message to fetch replies for (msg_...).

      • Optionalparams: { afterCursor?: string; beforeCursor?: string; limit?: number; tree?: boolean }

        Query parameters.

        • OptionalafterCursor?: string

          Opaque pagination cursor. Returns replies created after this point. Obtain from after_cursor in a previous response.

        • OptionalbeforeCursor?: string

          Opaque pagination cursor. Returns replies created before this point. Obtain from before_cursor in a previous response.

        • Optionallimit?: number

          Maximum number of replies to return per page. Defaults to 20.

        • Optionaltree?: boolean

          When true, returns all replies in the nested reply tree (flattened). When false or omitted, returns only direct replies to the message.

      Returns Promise<PaginatedReplies>

      Cursor-paginated list of reply messages for the requested thread message.