Skip to Content

Connect an account

Connects a provider account. OAuth returns an authorization URL; credential connections return null after validation.

POST
/v1/accounts/connect

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.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
provider*IntegrationKey
Match^[a-z0-9][a-z0-9_-]{0,63}$
input?
credentials?
app?IntegrationKey
Match^[a-z0-9][a-z0-9_-]{0,63}$
accountId?IntegrationAccountId
Match^intgacct_[0-9a-hjkmnp-tv-z]{16,24}$
expectedHosts?array<string>
returnTo*IntegrationReturnTo

A dashboard path starting with a single slash, such as /dashboard/acme/agents.

Match^\/(?:[\x21-\x2e\x30-\x5b\x5d-\x7e][\x21-\x7e]*)?$
Lengthlength <= 2048

Response Body

ConnectAccountResponse

application/json
  1. response
accountId*IntegrationAccountId
Match^intgacct_[0-9a-hjkmnp-tv-z]{16,24}$
authorizationUrl*string|null
Example Request
import { 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"
}

Related documentation