Connect an account
Connects a provider account. OAuth returns an authorization URL; credential connections return null after validation.
POST
Connects a provider account. OAuth returns an authorization URL; credential connections return null after validation. Name an app to ask for its scopes and install it when the connection finishes. Pass accountId to reconnect an account for renewed access or additional scopes. Connecting or reconnecting Shopify with read_products and read_legal_policies creates its Shopify store knowledge source.
apiKeyheader
x-api-key<token>application/json- body
provider*IntegrationKeyMatch
^[a-z0-9][a-z0-9_-]{0,63}$input?credentials?app?IntegrationKeyMatch
^[a-z0-9][a-z0-9_-]{0,63}$accountId?IntegrationAccountIdMatch
^intgacct_[0-9a-hjkmnp-tv-z]{16,24}$expectedHosts?array<string>returnTo*IntegrationReturnToA dashboard path starting with a single slash, such as /dashboard/acme/agents.
Match
^\/(?:[\x21-\x2e\x30-\x5b\x5d-\x7e][\x21-\x7e]*)?$Length
length <= 2048ConnectAccountResponse
application/json- response
accountId*IntegrationAccountIdMatch
^intgacct_[0-9a-hjkmnp-tv-z]{16,24}$authorizationUrl*string|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.accounts.connect({
"provider": "example",
"returnTo": "example"
});Example Response
{
"accountId": "string",
"authorizationUrl": "string"
}