Test the connection

3 min read · updated 2026-06-21

Every key save runs a connection test before anything persists: SleeveFolio asks Alpaca for your basic account details using the keys you supplied. It is a read-only check. A pass proves the keys are valid, match the environment (paper keys against Alpaca’s paper system, live keys against live), and identify exactly one account.

One prerequisite: if you have two-factor authentication enrolled, the current sign-in must already be two-factor verified. Saving broker keys is sensitive, so an unverified session is asked to complete its authenticator step first, before the connection test runs.

What a pass looks like

The broker card flips to active, shows a masked preview of your Alpaca account id, and stamps the last-tested time. SleeveFolio also records your Alpaca account id: that’s how later broker events are matched back to your account and nobody else’s.

Common failures

SymptomUsual causeFix
An “unauthorized” error (code 401)Typo in key/secret, a revoked pair, or keys from the wrong environment (live keys in the paper card, or vice versa)Regenerate at Alpaca and re-paste both halves, making sure they were generated in the matching (paper vs live) dashboard
TimeoutAlpaca outage or network hiccupRetry; check Alpaca’s status page

More cases in Broker connection errors.