Share account connection | Moov Documentation
Share account connection
Shares access scopes from the account specified to the caller, establishing a connection between the two accounts with the specified permissions.
POST
/accounts/{accountID}/connections
Ask
curl -X POST "https://api.moov.io/accounts/{accountID}/connections" \
-H "Authorization: Bearer {token}" \
-H "X-Moov-Version: v2026.07.00" \
-d '{
"principalAccountID": "c520f1b9-0ba7-42f5-b977-248cdbe41c69"
}'
Ask
import { Moov } from "@moovio/sdk";
const moov = new Moov({
security: {
username: "",
password: "",
},
});
async function run() {
const result = await moov.accounts.connect({
accountID: "456cb5b6-20dc-4585-97b4-745d013adb1f",
shareScopes: {
principalAccountID: "c520f1b9-0ba7-42f5-b977-248cdbe41c69",
allowScopes: [\
"transfers.write",\
"payment-methods.read",\
],
},
});
console.log(result);
}
run();
Ask
declare(strict_types=1);
require 'vendor/autoload.php';
use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;
$sdk = MoovPhp\Moov::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$shareScopes = new Components\ShareScopes(
principalAccountID: 'c520f1b9-0ba7-42f5-b977-248cdbe41c69',
allowScopes: [\
Components\ApplicationScope::TransfersWrite,\
Components\ApplicationScope::PaymentMethodsRead,\
],
);
$response = $sdk->accounts->connect(
accountID: '456cb5b6-20dc-4585-97b4-745d013adb1f',
shareScopes: $shareScopes
);
if ($response->statusCode === 200) {
// handle response
}
Ask
package hello.world;
import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.ConnectAccountRequestValidationError;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.ConnectAccountResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws GenericError, ConnectAccountRequestValidationError, Exception {
Moov sdk = Moov.builder()
.security(Security.builder()
.username("")
.password("")
.build())
.build();
ConnectAccountResponse res = sdk.accounts().connect()
.accountID("456cb5b6-20dc-4585-97b4-745d013adb1f")
.shareScopes(ShareScopes.builder()
.principalAccountID("c520f1b9-0ba7-42f5-b977-248cdbe41c69")
.allowScopes(List.of(
ApplicationScope.TRANSFERS_WRITE,
ApplicationScope.PAYMENT_METHODS_READ))
.build())
.call();
// handle response
}
}
Ask
from moovio_sdk import Moov
from moovio_sdk.models import components
with Moov(
security=components.Security(
username="",
password="",
),
) as moov:
res = moov.accounts.connect(account_id="456cb5b6-20dc-4585-97b4-745d013adb1f", principal_account_id="c520f1b9-0ba7-42f5-b977-248cdbe41c69", allow_scopes=[\
components.ApplicationScope.TRANSFERS_WRITE,\
components.ApplicationScope.PAYMENT_METHODS_READ,\
])
# Handle response
print(res)
Ask
require 'moov_ruby'
Models = ::Moov::Models
s = ::Moov::Client.new(
security: Models::Components::Security.new(
username: '',
password: ''
)
)
res = s.accounts.connect(account_id: '456cb5b6-20dc-4585-97b4-745d013adb1f', share_scopes: Models::Components::ShareScopes.new(
principal_account_id: 'c520f1b9-0ba7-42f5-b977-248cdbe41c69',
allow_scopes: [\
Models::Components::ApplicationScope::TRANSFERS_WRITE,\
Models::Components::ApplicationScope::PAYMENT_METHODS_READ,\
]
))
if res.status_code == 200
# handle response
end
Ask
using Moov.Sdk;
using Moov.Sdk.Models.Components;
using System.Collections.Generic;
var sdk = new MoovClient(security: new Security() {
Username = "",
Password = "",
});
var res = await sdk.Accounts.ConnectAsync(
accountID: "456cb5b6-20dc-4585-97b4-745d013adb1f",
body: new ShareScopes() {
PrincipalAccountID = "c520f1b9-0ba7-42f5-b977-248cdbe41c69",
AllowScopes = new List<ApplicationScope>() {
ApplicationScope.TransfersWrite,
ApplicationScope.PaymentMethodsRead,
},
}
);
// handle response
The resource was successfully created.
Response headers
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
Response headers
A unique identifier used to trace requests.
The request contained missing or expired authentication.
Response headers
A unique identifier used to trace requests.
The user is not authorized to make the request.
Response headers
A unique identifier used to trace requests.
The requested resource was not found.
Response headers
A unique identifier used to trace requests.
The request conflicted with the current state of the target resource.
Response headers
A unique identifier used to trace requests.
The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields.
Ask
Example
{
"error": "string"
}
Response headers
A unique identifier used to trace requests.
The request was refused due to rate limiting.
Response headers
A unique identifier used to trace requests.
The request failed due to an unexpected error.
Response headers
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.
Response headers
A unique identifier used to trace requests.
Set this header to v2026.07.00 to use the API described in this specification. When omitted, the server defaults to v2024.01.00, which may not match the behavior documented here.
Possible values:
v2026.07.00
Describes the scopes being shared from a subject account to a principal account.
The account ID that will receive access to the scopes.
The list of scopes to share with the principal account. If none are provided, all intersecting scopes are added.
Possible values:
accounts.read,
accounts.write,
analytics.read,
apple-pay-merchant.read,
apple-pay-merchant.write,
apple-pay.read,
apple-pay.write,
bank-accounts.read,
bank-accounts.write,
capabilities.read,
capabilities.write,
cards.read,
cards.write,
documents.read,
documents.write,
fed.read,
files.read,
files.write,
issued-cards.read,
issued-cards.write,
issued-cards.read-secure,
payment-methods.read,
ping.read,
profile-enrichment.read,
profile.read,
profile.write,
profile.disconnect,
representatives.read,
representatives.write,
transfers.read,
transfers.write,
wallets.read