@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    • Assign a Slack channel's resident agent Makes the given agent the channel's sole resident (one resident per channel: any previously attached agent is detached in the same transaction and its mirror-thread read grant is revoked immediately). Creates a bare internal binding first when the channel has none. Fetches the channel's is_private / is_ext_shared flags live from Slack (server-side, best-effort) to feed the fail-closed residency gates: a channel shared with an external workspace but not yet bound to a customer team fails with team_required_for_shared_channel (bind the team first via upsert/setup), and a private channel is member-managed — mutation without platform-verified in-channel evidence fails with channel_membership_required. When the binding is bound to a customer team, the agent is also enrolled as a member of that team (same pairing as upsert).

      Parameters

      • input: { agent_user_id: string; channel_id: string; slack_team_id: string }

        Request body.

        • agent_user_id: string

          Agent user ID to assign as the channel's sole resident.

        • channel_id: string

          Slack channel ID whose resident is being assigned (e.g. C01234ABCDE). A bare internal binding is created when the channel has none.

        • slack_team_id: string

          Slack workspace team ID that the channel belongs to (e.g. T01234ABCDE). Identifies which Slack integration to use.

      Returns Promise<SlackChannelBinding>

      The binding after assignment, with the attached agent list.

    • Create or update a Slack channel binding Creates a new binding between a Slack channel and a team, or updates the existing binding if one already exists for the given channel. The caller also supplies a list of agents to attach to the binding and enroll as members of the destination team. The caller must have team-manage rights on the destination team (and on the currently bound team if the channel is being re-pointed). Returns 403 if permission is insufficient. All write steps are idempotent, so retrying after a partial failure is safe. On success the REST endpoint returns 201 Created. The script binding (slack.channel_bindings.upsert) returns the full binding object including the attached agents.

      Parameters

      • input: {
            agent_user_ids: string[];
            allow_bot_conversations?: boolean;
            channel_id: string;
            customer_label?: string;
            is_ext_shared_cached?: boolean;
            is_private_cached?: boolean;
            slack_team_id: string;
            team_id: string;
        }

        Request body.

        • agent_user_ids: string[]

          List of agent user IDs to attach to the binding and enroll as members of the destination team. Pass an empty array to bind the channel without attaching any agents.

        • Optionalallow_bot_conversations?: boolean

          Opt this channel into sustained bot-to-bot conversation: the reply loop brake is disabled for its mirror thread. Set when the counterparty is a known bot the agent should keep answering. Omitting the parameter leaves the stored value unchanged.

        • channel_id: string

          Slack channel ID to bind (e.g. C01234ABCDE). Acts as the natural key of the binding within the workspace.

        • Optionalcustomer_label?: string

          Human-readable label for the customer associated with this channel. Stored in the binding's config. null if omitted.

        • Optionalis_ext_shared_cached?: boolean

          Cached value of Slack's is_ext_shared flag for the channel. When provided, this value is persisted on the binding to avoid repeated Slack API lookups. null if omitted.

        • Optionalis_private_cached?: boolean

          Cached value of Slack's is_private flag for the channel. When provided, this value is persisted on the binding to avoid repeated Slack API lookups. Private channels are member-managed. null if omitted.

        • slack_team_id: string

          Slack workspace team ID that the channel belongs to (e.g. T01234ABCDE). Identifies which Slack integration to use.

        • team_id: string

          ID of the team to bind the Slack channel to. The caller must have team-manage rights on this team.

      Returns Promise<SlackChannelBinding>

      The created or updated Slack channel binding, including the full list of currently attached agents.

    • Delete a Slack channel binding Removes the binding between a Slack channel and its associated team. The channel is identified by its Slack channel ID together with the slack_team_id that scopes it to a specific Slack workspace. Removing the binding does not delete the bound team or any conversation threads scoped to it; decommission those resources separately if required. The caller must have team-manage rights on the team the channel is currently bound to. Returning 403 indicates insufficient permission; returning 404 indicates the binding does not exist or is not visible to the caller. The REST endpoint returns 204 No Content on success. The script binding (slack.channel_bindings.delete) returns a confirmation object so script callers can verify success without an additional fetch. Both paths are idempotent — retrying after a partial failure is safe.

      Parameters

      • channel: string

        Slack channel ID of the binding to delete (e.g. C01234ABCDE).

      Returns Promise<{ channel: string; deleted: boolean }>

      Successful response

    • List delivery outcomes for a Slack channel Returns what happened to each agent message this platform sent to a Slack channel, newest attempt first. A message that never appears in a Slack channel has several possible causes that look identical from the channel itself: a content guard withheld it, the cross-org judge refused it, Slack rejected the call, or nobody asked anything. This endpoint tells them apart. Use it to confirm a reply was delivered, or to find out why one never arrived, without reading the channel's mirrored conversation. Outcomes cover outbound agent messages only. They carry no message content, no author, and nothing about inbound messages. Access follows the channel's binding — the organization and app the channel is bound to — and needs no membership in the mirrored thread. Paginated with opaque cursors, newest first. When has_more is true, pass the response's before_cursor back as before_cursor to continue into older history. since and outcome narrow the result set; they are filters, not paging controls.

      Parameters

      • channel: string

        Slack channel ID to read delivery outcomes for (e.g. C01234ABCDE).

      • Optionalparams: {
            afterCursor?: string;
            beforeCursor?: string;
            limit?: number;
            outcome?: "failed" | "delivered" | "floored" | "judge_refused";
            since?: string;
        }

        Query parameters.

        • OptionalafterCursor?: string

          Opaque cursor from a previous response; returns outcomes newer than it. Suited to a UI loading newer entries. To poll for everything recorded since a point in time, prefer since with a little overlap and de-duplicate on idafter_cursor can miss an attempt recorded in the same millisecond as the cursor's own row.

        • OptionalbeforeCursor?: string

          Opaque cursor from a previous response; returns outcomes older than it. Cursors are not parseable and are only valid against this endpoint.

        • Optionallimit?: number

          Maximum number of outcomes to return. Defaults to 50; maximum is 200.

        • Optionaloutcome?: "failed" | "delivered" | "floored" | "judge_refused"

          Return only attempts with this outcome. Omit to return every outcome. Use floored and judge_refused to see only what was withheld.

        • Optionalsince?: string

          Only return attempts at or after this ISO 8601 timestamp (e.g. 2026-08-11T00:00:00Z). Omit to return the most recent attempts regardless of age.

      Returns Promise<SlackDeliveryOutcomeListResponse>

      Delivery outcomes for the requested channel, newest first.

    • Point a Slack channel's deposit pipe at a staging thread, or turn it off Sets the binding's deposit target — the internal staging thread the deposit pipe copies this channel's mirror content into. Pass a null thread_id to turn the pipe off. The target is validated server-side: it must exist, belong to the binding's app and org, and never be a Slack mirror thread. Customer bindings (bound team_id) additionally require a team-owned private thread with no participant list, so the staging read ACL stays governed by the channel-membership projection. Re-pointing or clearing an existing target purges the old thread's deposit entries.

      Parameters

      • channel: string

        Slack channel ID whose binding is being configured (e.g. C01234ABCDE).

      • input: { slack_team_id: string; thread_id?: string }

        Request body.

        • slack_team_id: string

          Slack workspace team ID that the channel belongs to (e.g. T01234ABCDE). Identifies which Slack integration to use.

        • Optionalthread_id?: string

          Staging thread ID (primary key, thr_…) deposits should flow into. Pass null to turn the pipe off.

      Returns Promise<SlackChannelBinding>

      The binding with the updated deposit config.

    • Retrieve a Slack channel binding Returns the Slack channel binding identified by a Slack channel ID and workspace team ID pair. Use this endpoint to look up the team and agents currently bound to a specific Slack channel. The channel path parameter is the Slack channel ID; slack_team_id identifies the Slack workspace the channel belongs to, disambiguating channels with the same ID across workspaces. Both parameters are required. Returns 404 if no binding exists for the given pair or the associated Slack integration is not visible to the caller.

      Parameters

      • channel: string

        Slack channel ID of the binding to retrieve (e.g. C01234ABCDE).

      • Optionalparams: { slackTeamId?: string }

        Query parameters.

        • OptionalslackTeamId?: string

          Slack workspace team ID that the channel belongs to (e.g. T01234ABCDE). Used together with channel to uniquely identify the binding.

      Returns Promise<SlackChannelBinding>

      The Slack channel binding for the given channel and workspace.

    • List Slack channel bindings Returns a page of Slack channel bindings visible to the authenticated user. Results can be filtered by integration, team, agent, or organization. Omit all filter params to retrieve every binding the caller can see. Pagination is page-based. Pass page and per_page to navigate large result sets. page must be a positive integer; per_page must be between 1 and 100. Invalid values return 400.

      Parameters

      • Optionalparams: {
            agent?: string[];
            integration?: string[];
            org?: string[];
            page?: number;
            perPage?: number;
            team?: string[];
        }

        Query parameters.

        • Optionalagent?: string[]

          Return only bindings that have at least one of these agent user IDs attached. Omit to return bindings regardless of agent attachment.

        • Optionalintegration?: string[]

          Return only bindings whose Slack integration matches one of these integration IDs. Omit to return bindings across all integrations.

        • Optionalorg?: string[]

          Return only bindings that belong to one of these organization IDs. Omit to return bindings across all organizations visible to the caller.

        • Optionalpage?: number

          Page number to retrieve, 1-indexed. Defaults to 1. Must be a positive integer.

        • OptionalperPage?: number

          Number of bindings to return per page. Defaults to 25; maximum is 100.

        • Optionalteam?: string[]

          Return only bindings bound to one of these team IDs. Omit to return bindings for all teams.

      Returns Promise<SlackChannelBindingListResponse>

      Paginated list of Slack channel bindings visible to the caller.

    • Start adding a customer over Slack Connect Opens a Slack Connect channel with a new customer — creating one and sending the invite, or adopting a shared channel you already have — and records who is adding whom so the addition can finish once the customer accepts. The returned binding is pending: nothing mirrors, and no per-customer Team, agent, or solution instance exists yet. Acceptance is asynchronous and may never come. When it does, the addition completes in the background under the identity of the admin who called this endpoint, re-checked live at that moment. A caller who has since lost their admin role does not get a substitute — the addition is refused and a human re-adds the customer. The caller must be an admin of the Slack integration's own organization. This is the same authority the completion demands, checked here so a customer is never invited into a channel whose addition can never finish. Deliberately not exposed as a script binding: this sends mail to a person outside the org, so it stays a vendor-admin HTTP surface.

      Parameters

      • input: {
            channel_name?: string;
            customer_email?: string;
            customer_key: string;
            customer_label: string;
            existing_channel_id?: string;
            inputs?: Record<string, unknown>;
            slack_team_id: string;
            template_config_id: string;
        }

        Request body.

        • Optionalchannel_name?: string

          Name for a Slack channel to create for this customer. Required unless existing_channel_id is given. The channel is created private.

        • Optionalcustomer_email?: string

          Address the Slack Connect invite is sent to. Required when creating a channel; optional when adopting one the customer is already in. Whoever accepts becomes the verified counterparty.

        • customer_key: string

          The vendor's own primary key for this customer (customer_id / account_id / tenant_id). The per-customer agent's data access is locked to it. Immutable once the customer is added: re-targeting means offboarding and re-provisioning.

        • customer_label: string

          Human-readable name for the customer (e.g. Acme, Inc.). Used for the vendor's own dashboards and as the per-customer Team's name. Not an identity or an access control input.

        • Optionalexisting_channel_id?: string

          Adopt this already-shared Slack Connect channel (e.g. C01234ABCDE) instead of creating one. Mutually exclusive with channel_name.

        • Optionalinputs?: Record<string, unknown>

          String-keyed values the per-customer solution instance is stamped with. Defaults to an empty map.

        • slack_team_id: string

          Slack workspace team ID of the vendor's own Slack installation (e.g. T01234ABCDE). The customer's workspace is not known yet — it resolves from whoever accepts.

        • template_config_id: string

          Config ID (cfg_…) of the org-installed Solution the per-customer instance is stamped from. Must be the organization's own installed copy, not the catalog original — instances stamped from a different config do not appear in the vendor's customer fleet.

      Returns Promise<SlackChannelBinding>

      The pending binding for the customer's channel. disclosure_state is pending until the customer accepts, and scope_key is null until the addition finishes.