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.
Install the Hexel CLI (0.11.1 or later). The connection goes to the workspace of your context, or the one you pass with --workspace.
# Connect pages in your browser: pick a connector and sign in there
hexel connections connect
hexel connections connect HUBSPOT_REST --for me # your own account, not the organization's
# Straight to one toolkit, shared by the workspace
hexel connections connect GITHUB --oauth
echo "$LINEAR_KEY" | hexel connections connect LINEAR --api-key
hexel connections connect ZENDESK --oauth --attribute subdomain=acme--api-key never takes the key on the command line: hexel asks for it without echo, reads it from standard input or from --api-key-file. --oauth opens the provider's sign-in page and waits for it to return to http://127.0.0.1:<port>/callback, so the toolkit's OAuth app must allow that redirect URI.
import { connectWithApiKey, startOAuth, completeOAuth } from '@hexelstudio/titan-sdk/flows';
// API key: sent as credentials.access_token, the value the tool receives
const account = await connectWithApiKey({
authConfigId,
apiKey: process.env.LINEAR_API_KEY,
account: { toolkit_slug: 'LINEAR', workspace_id: workspaceId },
});For an OAuth toolkit, call startOAuth, send the person to the URL it returns, and call completeOAuth(code, state) on your redirect page. See TypeScript SDK.
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.
- 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 noworkspace_id. - 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.fieldsinstead. - 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 withcodeandstate, complete it withPOST /v1/titan/tools/connections/callbackand the body{"code": "...", "state": "..."}. A provider with a per-tenant host (for example Zendesk's subdomain) takes it inattributes, 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
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 itWith 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:
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_boundariesaretype:idvalues. Every boundary an action's grant requires must be on the connection, so a connection scoped togithub.organization:acmecan't be used for another GitHub organization.tagsare 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
| Status | When |
|---|---|
400 | A required field is missing, or the body is not valid. |
401 | No token, or one the edge rejected. |
403 | The caller lacks tool-gateway:auth:read or tool-gateway:auth:write. |
404 | The 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.