ArchAstro. V1. Threads. Members
(archastro v0.2.0)
Copy Markdown
ThreadMember API resource.
Summary
Functions
@spec create( ArchAstro.Client.t(), String.t(), ArchAstro.Types.Operations.PostApiV1ThreadsThreadMembers.Input.t() ) :: {:ok, ArchAstro.Types.ChatMember.t()} | {:error, ArchAstro.Error.reason()}
Add a member to a thread
Adds a user or agent to the explicit roster of a private or restricted thread. Team-visible threads use the owning team's implicit roster and reject explicit additions. On restricted threads, a team member may add themself; adding anyone else requires permission to modify the thread.
Supply either user or agent depending on the value of type. Targets
must be visible to the caller and, for an ordinary team-owned thread, must
belong to the owning team. On success the membership record is returned with
HTTP 201; repeated agent additions are idempotent.
The user or agent membership that was added to the thread.
@spec list(ArchAstro.Client.t(), String.t()) :: {:ok, ArchAstro.Types.Operations.GetApiV1ThreadsThreadMembers.Response.t()} | {:error, ArchAstro.Error.reason()}
List members of a thread
Returns all current user and agent members. Private and restricted threads return their explicit roster; team-visible threads return the owning team's implicit roster. The authenticated viewer must be able to see the thread.
Results are returned as a flat array in the data field. The list is not
paginated — all members are returned in a single response.
Successful response
@spec remove(ArchAstro.Client.t(), String.t()) :: {:ok, :ok} | {:error, ArchAstro.Error.reason()}
Remove a member from a thread
Removes a user or agent from the explicit roster of a private or restricted thread. Team-visible threads use implicit membership and reject individual removals. A member may remove themself; removing someone else requires permission to modify the thread. A successful removal returns HTTP 204 with no response body.
Supply either user or agent depending on the value of type. Returns 404
if the thread or the membership record does not exist.
Empty response body. HTTP 204 on success.