Accounts Spec
Managing accounts in your environment via the API.
Create account
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.",
}
Custom identifier
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.
Toggle account state (beta)
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 }'
We are rolling out this feature gradually. Reach out to get early access.
Delete account (beta)
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)"
We are rolling out this feature gradually. Reach out to get early access.