Registers a new third-party account with Fiber. The format of CREDENTIAL
will
depend on the source you're using.
curl -X POST https://api.fiber.dev/accounts \
-H "Content-Type: application/json" \
-H "Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)" \
-d '{
"sourceType": SOURCE_TYPE,
"credential": CREDENTIAL,
"app": APP_NAME, // Required for certain sources.
"identifier": CUSTOM_ACCOUNT_ID, // Optional.
}'
Response
Success (status 200)
{
"account": {
"external_id": "EXTERNAL_ID",
"identifier": "IDENTIFIER",
},
// If the account already existed, this will be true.
"already_existed": true,
}
Failure (status 400)
{
"type": "invalid_request_error",
"message": "A description of the error.",
}
You can give your account a custom
identifier
to customize the
account_id
column of its rows in the destination.
{
"sourceType": SOURCE_TYPE,
"credential": CREDENTIAL,
"identifier": "a-custom-account-id"
}
This request will fail if another account already exists in the environment with
the same (sourceType, identifier)
combination.
You can enable or disable accounts via the following request.
curl https://api.fiber.dev/accounts/SOURCE_TYPE/IDENTIFIER \
-X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)" \
--data-raw '{ "active": boolean }'
This request may take several seconds to complete.
curl https://api.fiber.dev/accounts/SOURCE_TYPE/IDENTIFIER \
-X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)"