Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview
On this page

Connected accounts

Connect your company's account at Stripe, GitHub, Notion and other providers, by signing in or with an API key, so your agent can use it through governed actions without ever holding the credential.

A connected account is a secret connected for one integration, such as GitHub or Stripe, and bound to that integration’s API hosts. Anlyon checks it with the provider, keeps it encrypted, and puts it on requests to the provider’s API at dispatch. Nobody, including you and your agent, can read it back.

Why connect accounts through the catalogue

Pasting a provider key into an agent’s environment hands the model every permission that key has. Building the same integration yourself means writing the sign-in flow, refreshing tokens, noticing when a key stops working and keeping the key away from the model.

  • Risk. The credential is bound to the provider’s own API hosts and may appear only in a header, so no action can send it anywhere else. A key the provider refuses is never stored, and an account known to have stopped working is refused before anything is sent.
  • Cost. Each integration comes with ready-made operations: reads, and governed writes with declared impact and read-backs. You switch on the ones your agent needs instead of writing and maintaining a client per provider.
  • Effort. Anlyon runs the sign-in, stores and refreshes the token, checks every account once a day, and tells you which account to reconnect and why.

Choose how to connect

A service can also be reached through its vendor’s own MCP server. To compare all three ways, see Connect a service.

Each integration connects one of two ways, and Linear, GitHub and Notion take both:

How Integrations available now Secret kind
Sign in at the provider’s own consent page HubSpot, Slack and Linear, and GitHub and Notion where signing in is set up for the environment. connection: the secret holds the account, and Anlyon fetches its current access token at dispatch.
API key you create in the provider’s settings and paste GitHub and Notion (a token), Linear (a personal API key), and every integration in the key table. static, with integrationId set.

GET /api/v2/connections/integrations (reference) says which way each integration connects in this environment, in auth.kind (oauth or api_key), and for a key gives the provider’s instructions and link. GitHub and Notion are oauth with the token alternative in auth.apiKey where signing in is set up, and api_key elsewhere. In the console, their connect dialog signs in by default and offers Use a token instead.

Your accounts and your users’ accounts

The accounts on this page are workspace connections: your company’s own accounts, one set per environment, connected by your team.

Your product’s users can also connect their own accounts. Those are end-user connections. Each belongs to one of your users, and your agent uses it only when it acts for that user.

  • Your server says which user a call is for. It sends the user’s id in the Anlyon-End-User header, with your API key. The SDKs do it with anlyon.forUser(id) or client.for_user(id).
  • The model never chooses the user. The tools it gets have no user field.
  • Your server confirms each new connection for the user who is signed in, so nobody can attach their account to someone else.
  • A key can require a user. It then never touches your workspace’s own accounts.
  • Limits, approvals and receipts work per user.

See Workspace connections and end-user connections, and the Act for your users guide.

Connect an account with an API key

Connecting needs secrets:write, and the admin or member role for a person in the console. Before anything is stored, Anlyon sends the key to the provider once, in one read-only request to the integration’s own API host, to ask whether the provider accepts it.

import { Client } from '@anlyonhq/sdk';

// An operator key with secrets:write.
const ops = new Client({ apiKey: process.env.ANLYON_OPERATOR_KEY! });

const { data: account } = await ops.connections.connectWithApiKey({
  integrationId: 'stripe',
  secretName: 'STRIPE',
  apiKey: process.env.STRIPE_RESTRICTED_KEY!,
});

console.log(account!.name, account!.allowedHosts, account!.health);
curl -X POST https://api.anlyon.com/api/v2/connections/keys \
  -H "Authorization: Bearer $ANLYON_OPERATOR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "integrationId": "stripe", "secretName": "STRIPE", "apiKey": "'"$STRIPE_RESTRICTED_KEY"'" }'
import os
from anlyon import Client

# An operator key with secrets:write.
ops = Client(api_key=os.environ["ANLYON_OPERATOR_KEY"])

account = ops.connections.connect_with_api_key(
    integration_id="stripe",
    secret_name="STRIPE",
    api_key=os.environ["STRIPE_RESTRICTED_KEY"],
).data

It answers 201 with the secret’s metadata. The hosts and the header placement come from the integration and cannot be chosen:

{
  "success": true,
  "data": {
    "name": "STRIPE",
    "kind": "static",
    "connection": null,
    "integrationId": "stripe",
    "health": { "status": "active", "checkedAt": "2026-10-27T09:00:00.000Z", "reason": null },
    "allowedHosts": ["api.stripe.com"],
    "allowedPlacements": ["header"]
  }
}
  • The provider accepts it: the key is stored and the account is connected.
  • The provider refuses it (422 CONNECTION_KEY_REJECTED): nothing is stored. Check that you copied the whole key and gave it the permissions listed.
  • The provider could not be reached (502 CONNECTION_KEY_CHECK_FAILED): nothing is stored. Try again.

The secret name is 1 to 100 characters of A-Z 0-9 _ and must not exist yet in the environment (409 otherwise). The key is 8 to 4,096 printable characters with no spaces or line breaks. A connected account counts as one secret toward your plan’s secret limit. See Connect with an API key.

Create a key with the fewest permissions the operations need. Anlyon does not narrow a key: what the key allows at the provider is what an action using it can do, inside the limits and approvals you set.

From the CLI, the key is never a command-line argument, so it does not reach your shell history. At a terminal the CLI asks for it without echoing; in a script, pipe it:

anlyon connections integrations                  # what can be connected, and how
anlyon connections add stripe --secret STRIPE    # shows the instructions, then asks for the key
printf %s "$STRIPE_RESTRICTED_KEY" | anlyon connections add stripe --secret STRIPE --api-key-stdin --yes
anlyon connections list

Connect an account by signing in

Start a connect session, open its connectUrl in a browser, approve access at the provider, then complete the session.

import { Client } from '@anlyonhq/sdk';

const ops = new Client({ apiKey: process.env.ANLYON_OPERATOR_KEY! });

const { data: session } = await ops.connections.createSession({ integrationId: 'github', secretName: 'GITHUB' });
console.log('Open this in a browser:', session!.connectUrl); // valid for 15 minutes

// After the person approves access at GitHub:
const { data: done } = await ops.connections.complete(session!.sessionId);
console.log(done!.status); // "pending" until the provider has sent the person back, then "completed"
curl -X POST https://api.anlyon.com/api/v2/connections/sessions \
  -H "Authorization: Bearer $ANLYON_OPERATOR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "integrationId": "github", "secretName": "GITHUB" }'

# Open data.connectUrl in a browser and approve. Then, with data.sessionId:
curl -X POST https://api.anlyon.com/api/v2/connections/sessions/csn_4f9a1c2b7d8e0f3a/complete \
  -H "Authorization: Bearer $ANLYON_OPERATOR_KEY"
import os
from anlyon import Client

ops = Client(api_key=os.environ["ANLYON_OPERATOR_KEY"])

session = ops.connections.create_session(integration_id="github", secret_name="GITHUB").data
print("Open this in a browser:", session["connectUrl"])

# After the person approves access at GitHub:
print(ops.connections.complete(session["sessionId"]).data["status"])
  • A session lasts 15 minutes. An expired session, or one from another workspace or environment, answers 410 CONNECTION_SESSION_EXPIRED; start a new one.
  • Completing answers status: "pending" until the provider has sent the person back, then completed with the secret. It is idempotent: completing twice returns the same secret. A consent the person declined answers 400 with the reason.
  • An integration that connects only with a key is refused here; send its key to POST /api/v2/connections/keys.
  • From the CLI, anlyon connections add github --secret GITHUB opens the consent page, waits and prints the secret.

See Create a connect session and Complete a connect session. The secret reads back as kind: "connection":

{
  "name": "GITHUB",
  "kind": "connection",
  "connection": { "integrationId": "github", "status": "active" },
  "integrationId": "github",
  "health": { "status": "active", "checkedAt": "2026-10-27T09:00:00.000Z", "reason": null },
  "allowedHosts": ["api.github.com"],
  "allowedPlacements": ["header"]
}

Starting sessions, connecting with a key, checking and reconnecting together count toward a limit of 10 per minute per workspace.

Use the account in an action

Actions use a connected account like any secret, by name or by integration:

{
  "urlTemplate": "https://api.github.com/repos/{{input.owner}}/{{input.repo}}/issues",
  "headers": { "Authorization": "Bearer {{connection:github}}" }
}

{{secret:GITHUB}} names one account. {{connection:github}} means the environment’s one GitHub account, or, on a call made for one of your users, that user’s own GitHub account. With two GitHub accounts in the environment, {{connection:github}} is ambiguous and refused: name one with {{secret:NAME}}. {{connection:github}} and {{connection:notion}} are sent as a Bearer token whichever way the account was connected.

Where the credential lives, and who sees it

  • A sign-in token is held by Anlyon itself. Anlyon runs the sign-in flow on its own API, stores the token encrypted in its own database under a key separate from the one secret values use, and refreshes it when it expires. No third party holds it. It is decrypted at dispatch, for that one request.
  • An API key is held in Anlyon’s secret store, encrypted, like any secret you store.
  • Either is redacted from every response and error Anlyon records.
  • No API returns it. Not to you, not to the console, and not to an agent. The secret’s metadata says which integration it is and, in health, whether it still works.
  • It can go only where the provider’s API is. A connected account is bound to the integration’s API hosts, which Anlyon sets, and it may appear only in a header. An action that addresses any other host is refused.

Choose what your agent may do

A connected account on its own does nothing. In the console, connecting continues to What may your agent do here?: the integration’s operations, one switch each, in two groups. The same screen opens later from the account’s row (Operations).

Each integration is a full toolset: the reads and writes an agent routinely needs on that product’s objects, so your agent needs no other tool for it and never holds the key. Account administration (members, billing, permissions, webhooks) is left out.

  • Reads return what the provider answers and change nothing: search, list and get. Each list returns one page, sized so the answer fits, and takes the provider’s cursor for the next. A read has no limit and no receipt. It is logged like any call, and an approval policy can still match it. Turn on all reads switches them on together.

  • Writes are governed. Each declares what one call changes, which counts against your limits, and can be held for an approval. Where the provider has a read that shows the change, Anlyon reads it back and the receipt is graded confirmed. Where it has none, the write’s description says why, and its receipt is graded acknowledged.

  • Turning an operation on creates one declared action in your workspace, named <integration>-<operation> (for example github-create-issue), that sends this account’s credential. Its suggested approval policy is installed off. The switch shows on only once the action exists. An operation that needs settings first (the Stripe account and currency for refunds, the sending domain for email) asks for them, and they are fixed into the action.

  • Turning it off disables the action. It is never deleted, so its receipts and pinned versions stay.

  • Approval policies suggested for the operations you turned on are listed with an Enable switch.

  • Limits are suggested with an amount you can change, and created only when you press Create limit. Creating a limit needs permission to manage impact limits; without it the screen says so and creates nothing.

Then Add to your agent lists the operations that are on by tool name and gives the setup for Claude Code, Cursor, Codex, the AI SDK, LangChain or curl. MCP clients sign in with a browser. The others need an agent key, which the screen can create with actions:invoke, actions:read and approvals:read only, shown once. A tool for the same provider already in your own code is not governed by Anlyon until you replace it with one of these.

Integration Reads Writes
GitHub Search and list issues; issue comments and labels; pull requests, their files, reviews and review comments; repository, branches, commits and file contents; code search Open, update, close and reopen issues; comment, edit and delete comments; add and remove labels and assignees; create and delete labels; open a pull request, review it, request reviewers, merge it
Notion Search pages and databases; get a page, a property, a block and its children; get and query a database; list comments Create a page, a database and a database row; update page properties; append paragraphs and blocks; update and delete a block; archive and restore a page; add, reply to, update and delete comments
Intercom Search and list contacts and conversations; get a contact, a conversation, a company, an admin; list tags, admins, teams and companies; search and get Help Center articles Create, update and delete contacts; tag and untag a contact; attach and detach a company; start a conversation; reply, add a note, assign to an admin or a team, snooze, close, reopen, tag
Attio Query people, companies and list entries; get a record, a note, an entry, a task; list attributes, notes, lists and tasks Create people and companies; update a job title, a company, a description; delete a record; add and delete notes; add to a list, update an entry, remove it; create, reschedule, complete and delete tasks
Asana Workspaces, projects, sections, tasks in a project or section, a task, its subtasks and stories, tags Create, update, complete, reopen and delete tasks; create subtasks; comment; move to a section; add and remove followers and tags; create and delete sections
Discord A server’s channels and active threads; a channel’s messages, pins and archived threads; a message; a thread’s messages Post, reply, edit and delete messages; post in a thread; add and remove a reaction; pin and unpin; start, join and archive a thread (as your bot)
PagerDuty Incidents, their notes, log entries and alerts; services; who is on call; escalation policies; schedules; users; maintenance windows Open, acknowledge, resolve, reassign, snooze and merge incidents; change urgency; add a note; create and end a maintenance window
Sentry Projects, teams, releases; issues with a search query; an issue, its events, one event Resolve, resolve in the next release, reopen, archive (with or without a time), assign to a member or a team, unassign, set priority, bookmark, mark seen
Stripe Customers (list, search, get); payment intents; charges; refunds; invoices; subscriptions; balance and balance transactions Refund a payment (the stripe.refund adapter, counted in money); create, update and delete customers; cancel a subscription or end it at period end; finalize and void an invoice
Resend Emails, domains, contacts, segments, a contact’s segments Send an email (the resend.email_send adapter, counted per recipient); reschedule and cancel a scheduled email; create, rename, delete and (un)subscribe contacts; add and remove a contact from a segment
HubSpot Search and get contacts, companies and deals; a contact by email; deal pipelines; a property; associations; notes Create and update contacts, companies and deals; move a contact’s lifecycle stage or a deal’s stage; set lead status; add and delete notes; associate records and remove an association; archive contacts, companies and deals
Slack None: the pack holds writes, each read back from Slack Post and edit a message in a public channel; add a reaction; set a channel’s topic or purpose
SendGrid Marketing contacts and lists; templates; unsubscribe groups; bounces and global unsubscribes Send an email or a template email; add, update and delete contacts; create, rename and delete lists; remove a contact from a list; add or remove an address from an unsubscribe group or the global unsubscribe list
Postmark Sent and received messages; bounces; suppressions; templates; message streams; stats (one server) Send an email or a template email to one recipient; reactivate a bounced address; suppress and unsuppress an address
Pipedrive Search and get deals, people and organizations; activities, notes, pipelines and stages Create, update and delete people; create organizations; create, update and delete deals; move a deal’s stage; mark it won, lost or open; create and complete activities; add notes
Front Search and get conversations, their messages and comments; contacts; channels, teammates and tags Reply and draft a reply; comment; assign and unassign; archive and reopen; tag; create a contact, rename it, set its description and add a note
Airtable Bases and their schemas; search and get records; a record’s comments Create one or several records; update and upsert records; delete a record; add and edit comments
Mailchimp Audiences, members, tags, notes and activity; segments; campaigns Add or update a member; update a member’s name or status; add and remove tags; add a note; archive a member; add to or remove from a static segment; send a campaign test; schedule and unschedule a campaign
ClickUp Workspaces, spaces, folders and lists; a list’s statuses; tasks in a list or across a workspace; a task, its comments and replies; a space’s tags Create, update and delete tasks; change status; assign and unassign people; comment; add and remove tags; add checklists and items, and resolve items
Todoist Projects, sections, labels; active tasks by project, section, label or filter query; a task; completed tasks in a date range; a task’s comments Create, update, complete, reopen, move and delete tasks; comment; create and delete sections
Cal.com The user; event types; free slots for an event type; availability schedules; bookings (by status, attendee, event type or time) and a booking’s attendees Book a meeting; reschedule, cancel, confirm and decline bookings; mark an attendee or the host absent; add a guest
Calendly The token’s user; event types; open times and busy times; availability schedules; scheduled meetings, their invitees and no-shows Book a meeting; create a single-use scheduling link; cancel a meeting; mark and unmark an invitee as a no-show
GitLab Projects; search and list issues, an issue and its comments; labels; merge requests, their diffs and comments; pipelines; files, branches and commits Open, update, close and reopen issues; comment; open, update, close, comment on, approve and merge merge requests; retry and cancel pipelines
Vercel Teams; deployments, a deployment and its build log; its aliases; a project’s domains; a domain’s DNS config; which deployment a domain serves; promote status Redeploy; promote a deployment to production; roll back production; cancel a build; delete a deployment
Jira You; projects, issue types and priorities; search issues with JQL; an issue, its transitions and comments Create an issue; rename it; add a label; set its priority; assign it; move it through a transition; comment; delete a comment or an issue
Zendesk Search and list tickets; a ticket and its comments; a user’s tickets; search and get users; groups Create a ticket; reply to the requester; add an internal note; set status or priority; assign; add tags
Linear (sign-in or API key) Teams, workflow states and labels; list and search issues; an issue and its comments Create and update issues; assign; move to a state; add and remove labels; comment; archive
monday.com Boards, a board’s columns and groups; items on a board or in a group; search items by a column; an item and its updates Create an item; set one or several column values; move to a group; post an update; archive or delete an item
Trello Your boards; a board, its lists and labels; cards on a board or in a list; search cards; a card and its comments Create, update, move, archive, restore and delete cards; comment; add and remove labels
Close Search leads; a lead, a contact, an opportunity, a task or a note; lead and opportunity statuses; opportunities, tasks and activities on a lead Create, update and delete leads; create contacts; create and update opportunities; add notes; create and complete tasks
Twilio Messages and their media; phone numbers; calls Send a text message; redact or delete a message; rename a phone number

To use an API that is not here, import its OpenAPI spec or declare the action yourself.

Each operation’s limitations are in its description, which a reviewer sees in the preview. The same operations install from the CLI with anlyon packs install ./packs/github --action <operation>; see Install a pack.

What Anlyon asks for when you sign in

For a sign-in integration, Anlyon requests the smallest set of scopes its operations need, and shows them before the consent window opens. With Anlyon’s shared app the provider’s consent page shows Anlyon’s name, because the app you approve is Anlyon’s. An environment can use its own OAuth app instead; see Your own OAuth app.

Sign-in integration Token may be sent to What Anlyon asks for
HubSpot api.hubapi.com Read and write on contacts, companies and deals: crm.objects.contacts.read and .write, and the same for companies and deals
Slack slack.com chat:write, channels:read, channels:history, channels:write.topic, reactions:read and reactions:write
Linear api.linear.app read and write
GitHub api.github.com The repo scope, the narrowest that reaches private repositories’ issues, pull requests and contents. A GitHub App ignores scopes and uses the permissions set on the app
Notion api.notion.com No scopes. The person picks the pages Anlyon may reach on Notion’s consent page

Where Anlyon’s own app is not set up for a sign-in integration, the integration is still listed, marked as needing your own app (ownOAuthAppRequired in GET /api/v2/connections/integrations). Add the environment’s own OAuth app for it; until then, starting a sign-in answers 400 OWN_OAUTH_APP_REQUIRED.

What to create at each provider

For an API-key integration there is no Anlyon app. You decide what the key may do when you create it.

API-key integration Key may be sent to What to create at the provider
GitHub api.github.com A fine-grained personal access token, limited to the repositories your agent should work in, with Issues and Pull requests: Read and write and Contents: Read. Merging needs Contents: Read and write
Notion api.notion.com An internal integration with Read, Update and Insert content and Read and Insert comments, then share each page with it
PagerDuty api.pagerduty.com An API access key that is not read-only
Resend api.resend.com An API key with Full access (a sending-only key cannot read an email back)
Stripe api.stripe.com A restricted key with Customers, Refunds, Invoices and Subscriptions: Write, and Payment Intents, Charges and Balance: Read. Leave out what your agent should not touch; those operations are refused
Intercom api.intercom.io An access token from an app you create in the Developer Hub. US-hosted workspaces only
Attio api.attio.com An access token with Records, List entries, Notes and Tasks: Read-write, and Object configuration, List configuration and User management: Read
Sentry sentry.io An auth token with org:read, project:read and event:write
Asana app.asana.com A personal access token. It acts as the person who made it
Discord discord.com A bot token, with the bot invited to your server and given View Channel, Send Messages, Send Messages in Threads, Read Message History, Create Public Threads, Add Reactions and Pin Messages
SendGrid api.sendgrid.com An API key with Custom Access: Mail Send, Marketing and Suppressions: Full Access, and Template Engine: Read Access. EU regional subusers (api.eu.sendgrid.com) are not reached
Postmark api.postmarkapp.com A Server API token, from the API Tokens tab of the server your agent sends from. It reaches that one server
Pipedrive api.pipedrive.com A user’s personal API token (Settings, Personal preferences, API). It acts with that user’s permissions
Front api2.frontapp.com An API token for Global resources and the shared workspaces your agent works in, with Read, Write and Send
Airtable api.airtable.com A personal access token with data.records:read and :write, data.recordComments:read and :write and schema.bases:read, limited to the bases your agent needs
Mailchimp <dc>.api.mailchimp.com An API key from your profile, Extras, API keys, and its data center: the part after the dash at the end of the key (us21). Mailchimp keys have no permission settings and reach the whole account
ClickUp api.clickup.com A personal API token. It acts as the person who made it, in every workspace they belong to
Todoist api.todoist.com The API token from Settings, Integrations, Developer. It has no scopes and acts as the person it belongs to
Cal.com api.cal.com An API key from Settings, Developer, API keys. It acts as the user who made it
Calendly api.calendly.com A personal access token with users:read, event_types:read, availability:read, scheduled_events:read and write, and scheduling_links:write. It acts as the person who made it. Booking needs a paid plan
GitLab gitlab.com A personal access token with the api scope, or a project or group access token with api and the Developer role (Maintainer to merge into protected branches). gitlab.com, not self-managed
Vercel api.vercel.com An access token scoped to one team, with an expiration. It acts as the person who made it in that team
Jira <site>.atlassian.net Your site, your Atlassian email and an API token without scopes from id.atlassian.com. It acts as you
Zendesk <subdomain>.zendesk.com Your subdomain, an agent’s email and an API token from Admin Center, Apps and integrations, APIs. Calls act as that agent
Linear (API key) api.linear.app A personal API key with read and write access to the teams your agent works in. It acts as you
monday.com api.monday.com Your personal API token from Developers, My access tokens. It acts as you on every board you can reach
Trello api.trello.com A Power-Up’s API key and a token you create with it for your account. It acts as you on every board you can reach
Close api.close.com An API key from Settings, Developer, API keys. It acts as you in your organization
Twilio api.twilio.com An Account SID and its Auth Token. Connect a subaccount limited to the numbers your agent should use

Check that an account still works

A connected account can stop working without anyone changing anything in Anlyon: a key expires or is deleted at the provider, or the person who signed in withdraws Anlyon’s access there. Anlyon treats both the same way. Every connected account carries a health record, Anlyon asks the provider whether the account still works, and an account that does not is marked needs_reauth with a reason:

health.reason What happened Which kind
key_rejected The provider refused the stored key API key
access_revoked The provider no longer honours the account’s grant: access withdrawn, or the token can no longer be renewed Sign-in
refresh_failed Anlyon tried to renew the token and could not Sign-in

Once an account is marked, the next call that uses it fails before anything is sent. The invocation is failed, and its error says the account needs to be reconnected (CONNECTION_NEEDS_REAUTH). Nothing reaches the provider with a credential Anlyon knows is dead.

Anlyon asks the provider:

  • When you press Check. In the console, on the account’s row under Integrations. From the CLI, anlyon connections check GITHUB. From the API, POST /api/v2/connections/{name}/check, or connections.check(name) in an SDK (reference). The answer is the secret with its health; an account that does not work is an answer, not an error. A secret you stored directly cannot be checked (400).
  • Once a day. Anlyon checks every connected account that has not been checked for a day. An account already marked waits for you. Your users’ own keys are checked the same way, each on its own account’s host. A key the provider refuses is marked needs_reconnect, and the next call made for that user answers 409 END_USER_RECONNECT_REQUIRED.
  • After a 401. When the provider answers an action with 401, Anlyon checks the connected accounts the action used, and marks one only if the check confirms it. A request the provider refused for its own reasons leaves a working account alone.

For a key, a check is the same single read-only request to the provider’s own API host that was made when you connected it. For a sign-in, Anlyon asks the provider to renew the token, so the provider itself says whether the grant is still honoured. Neither returns the credential. A check that could not be made (CONNECTION_KEY_CHECK_FAILED, CONNECTION_PROVIDER_ERROR) leaves the status as it was.

Reconnect an account

Reconnecting makes an account work again under the same name, so nothing that references {{secret:NAME}} changes: not the actions, not the policies, not the limits. You can also reconnect an account that still works, for example to rotate a key before it expires.

// A key integration: the new key is checked with the provider, then replaces the old one.
const { data } = await ops.connections.reconnect('STRIPE', { apiKey: process.env.STRIPE_RESTRICTED_KEY! });
console.log(data!.status); // "completed"

// A sign-in integration: open the new session's connectUrl, then complete it as for a first connect.
const { data: pending } = await ops.connections.reconnect('GITHUB');
console.log(pending!.status, pending!.session?.connectUrl); // "pending"
curl -X POST https://api.anlyon.com/api/v2/connections/STRIPE/reconnect \
  -H "Authorization: Bearer $ANLYON_OPERATOR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "apiKey": "'"$STRIPE_RESTRICTED_KEY"'" }'
result = ops.connections.reconnect("STRIPE", api_key=os.environ["STRIPE_RESTRICTED_KEY"]).data
print(result["status"])  # "completed"
  • A key integration takes apiKey. Anlyon checks the new key the way it checked the old one, replaces the stored value, and answers status: "completed" with the secret. A key the provider refuses changes nothing (422 CONNECTION_KEY_REJECTED).
  • A sign-in integration takes an empty body. Anlyon answers status: "pending" with a session to open and complete exactly as for a first connect.
  • Sending a key for a sign-in account, or none for a key account, is 400.
  • In the console: Reconnect on the account’s row opens the same dialog as Connect, for that account. From the CLI: anlyon connections reconnect STRIPE asks for the new key without echoing it (--api-key-stdin reads it from a pipe); anlyon connections reconnect GITHUB opens the consent page and waits.

Checking and reconnecting need secrets:write. See Reconnect a connection.

Disconnect an account

Delete the secret: Disconnect in the console, DELETE /api/v2/secrets/{name}, or secrets.delete(name) in an SDK.

  • An API key: Anlyon deletes its copy. Delete the key at the provider as well to end its access.
  • A sign-in: Anlyon asks the provider to revoke its access, then deletes the token it holds and the secret. Asking the provider is best effort: if the provider does not answer, Anlyon deletes its token anyway, so the account can no longer be used through Anlyon, but the grant may remain at the provider. If Anlyon cannot delete its own token, the secret is kept and the request answers 502 CONNECTION_REVOKE_FAILED.
  • In a protected environment, deleting needs confirmProtected: true.

To be sure a grant has ended at the provider, remove Anlyon’s access in the provider’s own settings. You can do that at any time.

Handle connection errors

Code Status Meaning What to do
CONNECTIONS_UNAVAILABLE 501 Signing in to this integration is not set up for the environment. API-key connections do not need it Connect with a key, or add your own OAuth app
CONNECTION_KEY_REJECTED 422 The provider did not accept the API key. Nothing was stored Check the key and its permissions
CONNECTION_KEY_CHECK_FAILED 502 The API key could not be checked with the provider. Nothing was stored Try again
CONNECTION_SESSION_EXPIRED 410 The session expired, or belongs to another workspace or environment Start a new session
CONNECTION_NEEDS_REAUTH In the invocation’s error The account was marked as no longer working. Nothing was sent Reconnect the account
CONNECTION_PROVIDER_ERROR 502 The account’s token could not be fetched or checked just then. Nothing was sent Try again shortly
CONNECTION_REVOKE_FAILED 502 Anlyon could not delete the account’s token, so the secret was kept Try again
SECRET_KIND_MISMATCH 409 PUT /secrets/{name} cannot turn a connected account into a stored value, or the other way round Reconnect it, or delete it first
RATE_LIMIT_EXCEEDED 429 More than 10 connects, checks or reconnects in a minute in the workspace Wait a minute

A connected account is a credential, not a way around governance. Limits, approvals, previews and read-backs apply to the actions that use it exactly as to any other.

Was this page helpful?