@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • 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.

      Parameters

      • thread: string

        Thread ID (thr_...) identifying the thread to remove the member from.

      • input: { agent?: string; membership_type?: string; type: string; user?: string }

        Request body.

        • Optionalagent?: string

          Agent ID of the principal to add. Required when type is "agent".

        • Optionalmembership_type?: string

          Role granted to the new member. One of "owner" or "member". Defaults to "member".

        • type: string

          Kind of principal being added. Must be "user" or "agent".

        • Optionaluser?: string

          User ID of the principal to add. Required when type is "user".

      Returns Promise<ChatMember>

      The user or agent membership that was added to the thread.

    • 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.

      Parameters

      • thread: string

        Thread ID (thr_...) identifying the thread to remove the member from.

      Returns Promise<
          {
              data: {
                  agent?: {
                      email?: string;
                      id: string;
                      name?: string;
                      org?: string;
                      team?: string;
                      user?: string;
                  };
                  joined_at?: string;
                  member_type?: string;
                  membership_type?: string;
                  role?: string;
                  type: string;
                  user?: {
                      email?: string;
                      full_name?: string;
                      id: string;
                      name?: string;
                      org?: string;
                  };
              }[];
          },
      >

      Successful response

    • 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.

      Parameters

      • thread: string

        Thread ID (thr_...) identifying the thread to remove the member from.

      Returns Promise<void>

      Empty response body. HTTP 204 on success.