@archastro/sdk
    Preparing search index...

    Class TeamThreadResource

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Create a thread for a team Creates a new thread owned by the specified team. The authenticated caller must have access to the team; requests from callers without team access are rejected with 404. If a profile_picture is provided in the thread params, it must be base64-encoded image data. The image is uploaded and associated with the thread before creation completes. Omit profile_picture to skip this step. By default the platform sends an automatic welcome message into the new thread. Pass skip_welcome_message: true to suppress this behavior, for example when creating threads programmatically in bulk or seeding test data.

      Parameters

      • team: string

        Team ID (tem_...) whose threads should be listed.

      • input: {
            skip_welcome_message?: boolean;
            thread: {
                create_legacy_agent?: boolean;
                description?: string;
                is_unlisted?: boolean;
                key?: string;
                kind?: "personal";
                members?: { id: string; type: "user" | "agent" }[];
                metadata?: Record<string, unknown>;
                muted?: boolean;
                org_id?: string;
                profile_picture?: { data?: string; filename?: string; mime_type?: string };
                settings?: { agent_enabled?: boolean | null };
                slug?: string;
                title?: string;
                visibility?: "team" | "private" | "restricted";
            };
        }

        Request body.

        • Optionalskip_welcome_message?: boolean

          When true, suppresses the automatic welcome message that is otherwise sent into the thread on creation. Defaults to false.

        • thread: {
              create_legacy_agent?: boolean;
              description?: string;
              is_unlisted?: boolean;
              key?: string;
              kind?: "personal";
              members?: { id: string; type: "user" | "agent" }[];
              metadata?: Record<string, unknown>;
              muted?: boolean;
              org_id?: string;
              profile_picture?: { data?: string; filename?: string; mime_type?: string };
              settings?: { agent_enabled?: boolean | null };
              slug?: string;
              title?: string;
              visibility?: "team" | "private" | "restricted";
          }

          Attributes for the new thread. See ThreadCreateParams for available fields.

      Returns Promise<Thread>

      The newly created thread.

    • List threads for a team Returns all threads owned by the specified team that the authenticated caller has permission to view. The caller must have access to the team; requests without team access are rejected with 404. Threads are returned in a single data array, ordered with the team's default thread first, then by most recent activity (newest first). Each thread carries a last_activity timestamp — the most recent message's creation time, falling back to the thread's own creation time. Use the team-scoped thread endpoints to create, update, or delete individual threads.

      Parameters

      • team: string

        Team ID (tem_...) whose threads should be listed.

      • Optionalparams: { tags?: string[] }

        Query parameters.

        • Optionaltags?: string[]

          Optional: only return threads tagged with at least one of these tags (OR-match). Repeated query params, e.g. ?tags[]=blocked&tags[]=needs-review.

      Returns Promise<
          {
              data: {
                  agent_user?: string
                  | null;
                  created_at?: string;
                  creator?:
                      | string
                      | {
                          alias?: string
                          | null;
                          app?: string | null;
                          app_name?: string | null;
                          created_by_agent_user?: string | null;
                          created_by_developer?: string | null;
                          created_by_org?: string | null;
                          created_by_team?: string | null;
                          created_by_user?: string | null;
                          email?: string | null;
                          id: string;
                          is_system_user?: boolean;
                          metadata?: Record<string, unknown>;
                          name?: string | null;
                          org?: string | null;
                          org_name?: string | null;
                          org_role?: string | null;
                          org_slug?: string | null;
                          sandbox?: string | null;
                          sandbox_name?: string | null;
                      }
                      | null;
                  description?: string
                  | null;
                  id: string;
                  is_channel?: boolean;
                  is_default?: boolean;
                  is_transient?: boolean;
                  is_unlisted?: boolean;
                  key?: string | null;
                  kind?: string | null;
                  last_activity?: string | null;
                  last_message_preview?: string | null;
                  last_message_sender?: string | null;
                  metadata?: Record<string, unknown> | null;
                  muted?: boolean;
                  org?: string | null;
                  parent_message?:
                      | {
                          acl?: | {
                              add?: { actions: ...; principal?: ...; principal_type: ... }[];
                              grants?: { actions: ...; principal?: ...; principal_type: ... }[];
                              remove?: { principal?: ...; principal_type: ... }[];
                          }
                          | null;
                          actors?: {
                              alias?: string
                              | null;
                              id?: string | null;
                              name?: string | null;
                              profile_picture?:
                                  | {
                                      file?: ...;
                                      height?: ...;
                                      media?: ...;
                                      mime_type?: ...;
                                      refresh_url?: ...;
                                      url?: ...;
                                      width?: ...;
                                  }
                                  | null;
                          }[];
                          agent?: string
                          | null;
                          agent_mode?: "cli" | "embedded" | null;
                          attachments?: {
                              content_type?: string | null;
                              description?: string | null;
                              filename?: string | null;
                              height?: number | null;
                              id: string;
                              image_height?: number | null;
                              image_source?:
                                  | {
                                      file?: ...;
                                      height?: ...;
                                      media?: ...;
                                      mime_type?: ...;
                                      refresh_url?: ...;
                                      url?: ...;
                                      width?: ...;
                                  }
                                  | null;
                              image_url?: string
                              | null;
                              image_width?: number | null;
                              media_type?: string;
                              name?: string | null;
                              object?: Record<(...), (...)>;
                              title?: string | null;
                              type: string;
                              url?: string | null;
                              variants?: (...)[];
                              version?: number | null;
                              width?: number | null;
                          }[];
                          branched_thread?: string
                          | null;
                          content?: string | null;
                          context?: {
                              attributes?: Record<(...), (...)>;
                              content?: string | null;
                              title?: string | null;
                              type: string;
                          }[];
                          created_at?: string;
                          has_replies?: boolean;
                          id: string;
                          idempotency_key?: string
                          | null;
                          is_deleted?: boolean;
                          legacy_agent?: string | null;
                          metadata?: Record<string, unknown>;
                          org?: string | null;
                          reactions?: {
                              payload?: Record<(...), (...)>;
                              type: string;
                              user?: string;
                          }[];
                          rendering_mode?: string
                          | null;
                          replies?: Record<string, unknown>[];
                          replies_after_cursor?: string | null;
                          replies_before_cursor?: string | null;
                          reply_count?: number;
                          reply_to?: Record<string, unknown> | null;
                          root_message_id?: string | null;
                          sandbox?: string | null;
                          team?: string | null;
                          thread?: string;
                          type?: string | null;
                          user?:
                              | string
                              | {
                                  alias?: string
                                  | null;
                                  app?: string | null;
                                  app_name?: string | null;
                                  created_by_agent_user?: string | null;
                                  created_by_developer?: string | null;
                                  created_by_org?: string | null;
                                  created_by_team?: string | null;
                                  created_by_user?: string | null;
                                  email?: string | null;
                                  id: string;
                                  is_system_user?: boolean;
                                  metadata?: Record<string, unknown>;
                                  name?: string | null;
                                  org?: string | null;
                                  org_name?: string | null;
                                  org_role?: string | null;
                                  org_slug?: string | null;
                                  sandbox?: string | null;
                                  sandbox_name?: string | null;
                              }
                              | null;
                          visibility?: "default"
                          | "private";
                      }
                      | null;
                  participant?: string[];
                  participants?: {
                      alias?: string
                      | null;
                      app?: string | null;
                      app_name?: string | null;
                      created_by_agent_user?: string | null;
                      created_by_developer?: string | null;
                      created_by_org?: string | null;
                      created_by_team?: string | null;
                      created_by_user?: string | null;
                      email?: string | null;
                      id: string;
                      is_system_user?: boolean;
                      metadata?: Record<string, unknown>;
                      name?: string | null;
                      org?: string | null;
                      org_name?: string | null;
                      org_role?: string | null;
                      org_slug?: string | null;
                      sandbox?: string | null;
                      sandbox_name?: string | null;
                  }[];
                  participating_actor?: string[];
                  participating_agents?: | {
                      acl?: { add?: (...)[]; grants?: (...)[]; remove?: (...)[] }
                      | null;
                      app?: string;
                      created_at?: string;
                      default_model?: string | null;
                      description?: string | null;
                      email?: string | null;
                      id: string;
                      identity?: string | null;
                      last_applied_template_config?: string | null;
                      lookup_key?: string | null;
                      metadata?: Record<string, unknown>;
                      name?: string;
                      org?: string | null;
                      org_name?: string | null;
                      originator?: string | null;
                      phone_number?: string | null;
                      sandbox?: string | null;
                      source_solution?:
                          | {
                              current_solution?: {
                                  category_keys?: ...;
                                  created_at?: ...;
                                  description?: ...;
                                  events?: ...;
                                  id: ...;
                                  image_url?: ...;
                                  installed_config_ids: ...;
                                  kind: ...;
                                  latest_solution?: ...;
                                  latest_version?: ...;
                                  lookup_key?: ...;
                                  metadata?: ...;
                                  name?: ...;
                                  org?: ...;
                                  org_logo?: ...;
                                  org_name?: ...;
                                  org_slug?: ...;
                                  owners: ...;
                                  readme_url?: ...;
                                  screenshot_urls?: ...;
                                  solution_id?: ...;
                                  solution_version?: ...;
                                  tag_keys?: ...;
                                  template_kind?: ...;
                                  templates: ...;
                                  updated_at?: ...;
                                  upgrade_available: ...;
                                  virtual_path?: ...;
                              };
                              solution: {
                                  category_keys?: (...)
                                  | (...);
                                  created_at?: (...) | (...);
                                  description?: (...) | (...) | (...);
                                  events?: (...) | (...);
                                  id: string;
                                  image_url?: (...) | (...) | (...);
                                  installed_config_ids: (...)[];
                                  kind: string;
                                  latest_solution?: (...) | (...) | (...);
                                  latest_version?: (...) | (...) | (...);
                                  lookup_key?: (...) | (...) | (...);
                                  metadata?: (...) | (...);
                                  name?: (...) | (...) | (...);
                                  org?: (...) | (...) | (...);
                                  org_logo?: (...) | (...) | (...);
                                  org_name?: (...) | (...) | (...);
                                  org_slug?: (...) | (...) | (...);
                                  owners: (...)[];
                                  readme_url?: (...) | (...) | (...);
                                  screenshot_urls?: (...) | (...);
                                  solution_id?: (...) | (...) | (...);
                                  solution_version?: (...) | (...) | (...);
                                  tag_keys?: (...) | (...);
                                  template_kind?: (...) | (...) | (...);
                                  templates: (...)[];
                                  updated_at?: (...) | (...);
                                  upgrade_available: boolean;
                                  virtual_path?: (...) | (...) | (...);
                              };
                              template: {
                                  created_at?: (...)
                                  | (...);
                                  description?: (...) | (...) | (...);
                                  display_name?: (...) | (...) | (...);
                                  id: string;
                                  kind: string;
                                  lookup_key?: (...) | (...) | (...);
                                  name?: (...) | (...) | (...);
                                  updated_at?: (...) | (...);
                                  virtual_path?: (...) | (...) | (...);
                              };
                          }
                          | null;
                      team?: string
                      | null;
                      template_upgrade_available?: boolean | null;
                      updated_at?: string;
                      user?: string | null;
                  }[]
                  | null;
                  role?: string
                  | null;
                  sandbox?: string | null;
                  settings?: { agent_enabled?: boolean | null };
                  slug?: string | null;
                  sub_threads?: Record<string, unknown>[] | null;
                  tags?: string[];
                  team?: string | null;
                  title?: string | null;
                  ttl?: string | null;
                  unread_count?: number | null;
                  updated_at?: string;
                  user?: string | null;
                  visibility: "team" | "private" | "restricted";
              }[];
          },
      >

      Successful response

    • Get threads-created count for a team Returns how many network-public team threads were created in the UTC-day window. Counts come from realtime SQL aggregation over append-only network_activity_events (thread.created rows co-committed with create): team- or restricted-visibility threads (plus legacy open-team rows), never private or mirror. Every Network member sees the same number. Hard-delete co-commits a separate thread.deleted transition event and does not remove create events (metric is "created", not "still present"). Visibility flips after insert are ignored in v1. Any authenticated team member may read this count-only Network summary. Requests from callers without team access return 404 so team existence is not disclosed.

      Parameters

      • team: string

        Team ID (tem_...) whose threads should be listed.

      • Optionalparams: { days?: number }

        Query parameters.

        • Optionaldays?: number

          UTC-day window. One of 7, 30, 90, or 365; defaults to 30.

      Returns Promise<{ days: number; end_at: string; opened: number; start_at: string }>

      Successful response