ArchAstro.V1.ThreadMessages (archastro v0.2.0)

Copy Markdown

ThreadMessage API resource.

Summary

Functions

delete(client, message)

@spec delete(ArchAstro.Client.t(), String.t()) ::
  {:ok, :ok} | {:error, ArchAstro.Error.reason()}

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.

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

get(client, message)

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.

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

replace(client, message, input)

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.

The updated message object.

replies(client, message, params \\ %ArchAstro.Types.Operations.GetApiV1ThreadMessagesMessageReplies.Params{})

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.

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