Skip to content
Hexel StudioDocs

Connections

Connect the accounts your agents' tools act with, by API key or OAuth, from the console, the CLI, the SDK or the API; limit where a connection may be used; revoke it.

On this page

A connection (a connected account) holds the credential a tool uses to act on a service for you: an API key, an OAuth token, or the named credential fields a toolkit needs. Titan stores it encrypted and hands it to the tool only when a governed action runs. The agent never holds the credential.

Each connection belongs to a toolkit (for example GITHUB or LINEAR) and to a workspace (ws_...), and optionally an environment. How the credential is obtained comes from the toolkit's auth config: its scheme (OAuth 2, API key, named fields), the OAuth app, scopes and URLs.

Connect an account

Open Titan → Connections in console.hexelstudio.com, pick a connector and sign in, or paste its key. The console uses Hexel Studio's Connect pages, so the credential goes straight from your browser to Hexel Studio.

Connect with the API

All connection routes are under https://api.hexelstudio.com/v1/titan/tools/. Send an access token (or a service user's API key as X-API-Key) and the workspace as X-Workspace-Id. Reading needs tool-gateway:auth:read; connecting, changing and revoking need tool-gateway:auth:write.

  1. Find the toolkit's auth config
    Bash
    curl "https://api.hexelstudio.com/v1/titan/tools/auth-configs?workspace_id=$WORKSPACE_ID" \
      -H "Authorization: Bearer $ACCESS_TOKEN" \
      -H "X-Workspace-Id: $WORKSPACE_ID"

    Pick the toolkit's config by toolkit_slug: the active one (is_active), and the default one (is_default) when there are several. An organization-level config has no workspace_id.

  2. Store an API key
    Bash
    curl -X POST https://api.hexelstudio.com/v1/titan/tools/connected-accounts \
      -H "Authorization: Bearer $ACCESS_TOKEN" \
      -H "X-Workspace-Id: $WORKSPACE_ID" \
      -H "Content-Type: application/json" \
      -d '{
        "account": {"toolkit_slug": "LINEAR", "workspace_id": "'"$WORKSPACE_ID"'", "auth_config_id": "'"$AUTH_CONFIG_ID"'"},
        "credentials": {"access_token": "'"$LINEAR_API_KEY"'"}
      }'

    A toolkit whose auth config declares named credential fields takes them in credentials.fields instead.

  3. Or start OAuth
    Bash
    curl -X POST https://api.hexelstudio.com/v1/titan/tools/connections/initiate \
      -H "Authorization: Bearer $ACCESS_TOKEN" \
      -H "X-Workspace-Id: $WORKSPACE_ID" \
      -H "Content-Type: application/json" \
      -d '{
        "auth_config_id": "'"$AUTH_CONFIG_ID"'",
        "organization_id": "'"$ORG_ID"'",
        "workspace_id": "'"$WORKSPACE_ID"'",
        "redirect_uri": "https://app.example.com/oauth/callback"
      }'

    Send the person to authorization_url. When the provider redirects back with code and state, complete it with POST /v1/titan/tools/connections/callback and the body {"code": "...", "state": "..."}. A provider with a per-tenant host (for example Zendesk's subdomain) takes it in attributes, such as {"subdomain": "acme"}.

The SDK and the CLI call these same routes. Every route, with its fields and errors, is in the Titan platform API reference.

List and revoke

Bash
hexel connections list               # this workspace (--all-workspaces for every one)
hexel connections show <ID>          # one connection and the apps that use it
hexel connections revoke <ID>        # revoke it; --app revokes only one app's use of it

With the API, GET /v1/titan/tools/connected-accounts?workspace_id=... lists them and DELETE /v1/titan/tools/connected-accounts/{nano_id} revokes one. A revoked connection can't be used by any later action. To stop a connection at once while you investigate, kill it with the ID that hexel connections list shows (the nano_id): hexel titan kill <ID> --type connection (Kill switch). Titan looks up the connection and returns its connected_account_id as the target_id.

Limit where a connection may be used

An administrator can scope a connection, so that a governed action uses it only for the destinations and labels you assign:

Bash
curl -X PATCH https://api.hexelstudio.com/v1/titan/tools/connected-accounts/$CONNECTION_ID/scope \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "X-Workspace-Id: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{"destination_boundaries": ["github.organization:acme"], "tags": ["prod"]}'
  • destination_boundaries are type:id values. Every boundary an action's grant requires must be on the connection, so a connection scoped to github.organization:acme can't be used for another GitHub organization.
  • tags are your own labels; every tag a grant requires must be on the connection.

A connection also records the permissions its provider granted at connect time (for example the OAuth scope repo): an action that needs a permission the connection doesn't have can't use it. Reconnect with the scopes the tool needs.

Errors

StatusWhen
400A required field is missing, or the body is not valid.
401No token, or one the edge rejected.
403The caller lacks tool-gateway:auth:read or tool-gateway:auth:write.
404The connection does not exist in your organization (revoke, scope).

An action that can't find a usable connection fails when it runs, and the Agent Ledger records why.