APIs

Call an external API from your app

Use a connected account, such as Slack or Google, or a service's API key stored as a secret, from your app's server code.

On this page

Your app can call other services from its server code in two ways, through a connected account, where Ahamo adds the credential for you, or with the service's API key stored as a secret. Neither puts a key in the browser or the chat.

When to use it

  • The service is in Ahamo's connector catalog (for example Slack, Notion, Google Sheets, HubSpot, Stripe), so use a connected account. See Use a connection in your app.
  • Any other service with an API key, for example an email or SMS provider, so store the key as a secret.

How to use it

Ask the build AI and name the service.

When an order is paid, post it to our #orders channel in Slack.

Send the booking confirmation email with Resend. Ask me for the API key.

For a connected account, the build AI links it in Connectors and calls it with connectors.fetch(alias, path, init). For an API key, it asks for the key in a secure input and reads it with env('RESEND_API_KEY'). See Store secrets and variables.

The call then works in the preview with development credentials and in the published app with production ones.

Plans and limits

RuleValue
Where calls runServer code only
Connected-account request body1 MB
MethodsGET, HEAD, POST, PUT, PATCH, DELETE
Connectors availableThose your organisation has turned on

Troubleshooting

"Not connected". Link the account in Connectors for the environment you test.

"Reconnect required". The account's access expired or was revoked. Reconnect it.

"Rate limited". The service refused more calls for now. Wait and retry, or ask the build AI to call less often.

The published app fails but the preview works. Production secrets and links are separate. Add the production value and publish again.

On this page