Source of an administration
Which accounting package feeds the administration, the linked division, the last sync and any error. Unlike the other administration routes this also answers before a package is linked (source: none).
A product shows this next to its own connect button: an admin of the administration connects Exact Online by opening /connect/exact?administrationId=…&returnUrl=… on AskLedger (see the API overview), or uploads an auditfile (…/auditfiles). The source is linked once per administration and every product that includes the administration sees it.
For an auditfile source (source: auditfile) the answer has the latest upload (auditfile), the period all processed files cover (dataAvailableFrom/dataAvailableTo) and, when the latest upload failed, error.code auditfile_failed. An administration has one source: it is fed by Exact Online or by auditfiles, not both.
Other LedgerSuite products call this with their own client_credentials token (scope askledger:read) for administrations that include them; company group API keys and OAuth tokens work too. Requires the ledger:read scope.
bearerAuthorizationBearer <token>A company group API key (al_live_…, created at /dashboard/api), an OAuth access token from the same authorization flow MCP clients use, or (other LedgerSuite products, /administrations routes only) a LedgerSuite client_credentials token.
administrationId*stringLedgerSuite administration id; its linked ledger is used
OK
application/json- response
administrationId*stringsource*stringAccounting package that feeds the administration; none until one is linked
"exact""auditfile""none"status*stringpending: linked, first sync (or first auditfile) not finished yet; syncing: a newer auditfile is being imported
"not_connected""pending""syncing""synced""error"division*|Exact only
lastSyncedAt*|When data was last fetched from the package, or the last auditfile was processed (ISO 8601)
dataAvailableFrom*|Auditfile: start of the earliest processed file's period (YYYY-MM-DD); null for Exact
dataAvailableTo*|Auditfile: end of the latest processed file's period (YYYY-MM-DD); null for Exact
auditfile*|Auditfile: the most recent completed upload (see GET …/auditfiles/{id} for its issues)
error*|nullcurl -X GET "https://example.com/administrations/string/source"{ "administrationId": "string", "source": "exact", "status": "not_connected", "division": { "code": "string", "name": "string" }, "lastSyncedAt": "string", "dataAvailableFrom": "string", "dataAvailableTo": "string", "auditfile": { "id": "string", "fileName": "string", "status": "awaiting_upload", "periodStart": "string", "periodEnd": "string", "uploadedAt": "string", "processedAt": "string" }, "error": { "code": "reauth_required", "message": "string", "at": "string" }}