Skip to content
Resource · Accounting

Chart of accounts

A chart of accounts lists the accounts and the account groups of the workspace accounting.

chart-of-accounts:readchart-of-accounts:write
MethodPathSummary
GET…/chart-of-accountsList charts of accounts in the workspace
POST…/chart-of-accountsCreate a chart of accounts
PATCH…/chart-of-accounts/{chartOfAccountId}Update a chart of accounts
DELETE…/chart-of-accounts/{chartOfAccountId}Delete a chart of accounts
POST…/chart-of-accounts/{chartOfAccountId}/accountsCreate an account inside a chart of accounts
PATCH…/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}Update an account inside a chart of accounts
DELETE…/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}Delete an account from a chart of accounts
POST…/chart-of-accounts/{chartOfAccountId}/groupsCreate an account group inside a chart of accounts
PATCH…/chart-of-accounts/{chartOfAccountId}/groups/{groupId}Update an account group inside a chart of accounts
DELETE…/chart-of-accounts/{chartOfAccountId}/groups/{groupId}Delete an account group from a chart of accounts
POST…/chart-of-accounts/exportExport a chart of accounts to a downloadable file

Paths start with /workspaces/{workspaceId}. GET endpoints need chart-of-accounts:read, the others chart-of-accounts:write.

The ChartOfAccount object

firestoreIdstringrequired

ID of the chart of accounts.

workspaceIdstringrequired

ID of the workspace.

validFromstring
validUntilstring
titlestringrequired
groupsobject[]required
Show 4 child fields
idstringrequired
namestringrequired
descriptionstring
parentIdstring
accountsobject[]required
Show 8 child fields
codestringrequired
namestringrequired
descriptionstring
groupIdstringrequired
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
Show 18 values

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

Show all 8 fields
creationobjectrequired

When and by whom the resource was created.

Show 2 child fields
creationDateTimestringdate-timerequired

Date and time when the resource was created.

createdBystring

ID of the user who created the resource, when recorded.

The ChartOfAccount object
{
  "firestoreId": "Ca6yH3kN8pTr1vWx4bQs",
  "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
  "validFrom": "string",
  "validUntil": "string",
  "title": "string",
  "groups": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "parentId": "string"
    }
  ],
  "accounts": [
    {
      "code": "string",
      "name": "string",
      "description": "string",
      "groupId": "string",
      "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
      "type": "BANK",
      "currency": "CHF"
    }
  ],
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  }
}
GET/workspaces/{workspaceId}/chart-of-accounts

List charts of accounts in the workspace

Scopechart-of-accounts:read

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

limitinteger

Maximum number of items to return, from 1 to 100. A missing, invalid or non-positive value falls back to 20, and a larger value to 100.

Default20

startAfterstring

Cursor of the page to return: the nextCursor of the previous page.

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

idsstring[]

Comma-separated IDs of the items to return, up to 30. When set, limit, startAfter and the filters are ignored.

Returns

200

List of items

dataChartOfAccount[]required

Items of the page, in list order.

limitintegerrequired

Page size of the request, or the number of requested ids.

nextCursorstring

Cursor of the next page, to pass as startAfter. Absent when the page holds fewer items than limit; a full last page still has one, and the page it points to is empty.

curl 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "firestoreId": "Ca6yH3kN8pTr1vWx4bQs",
      "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
      "validFrom": "string",
      "validUntil": "string",
      "title": "string",
      "groups": […],
      "accounts": […],
      "creation": {
        "creationDateTime": "2026-03-02T09:15:00.000Z",
        "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      }
    }
  ],
  "limit": 0,
  "nextCursor": "string"
}
POST/workspaces/{workspaceId}/chart-of-accounts

Create a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Request body

titlestringrequired
validFromstring
validUntilstring
groupsobject[]required
Show 4 child fields
idstringrequired
namestringrequired
descriptionstring
parentIdstring
accountsobject[]required
Show 8 child fields
codestringrequired
namestringrequired
descriptionstring
groupIdstringrequired
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
Show 18 values

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

importedFromFilestring

Returns

200

Successful response

dataChartOfAccountrequired
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "string",
  "validFrom": "string",
  "validUntil": "string",
  "groups": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "parentId": "string"
    }
  ],
  "accounts": [
    {
      "code": "string",
      "name": "string",
      "description": "string",
      "groupId": "string",
      "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
      "type": "BANK",
      "currency": "CHF"
    }
  ],
  "importedFromFile": "string"
}'
{
  "data": {
    "firestoreId": "Ca6yH3kN8pTr1vWx4bQs",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "validFrom": "string",
    "validUntil": "string",
    "title": "string",
    "groups": […],
    "accounts": […],
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    }
  }
}
PATCH/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}

Update a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

Request body

titlestring
validFromstring
validUntilstring
groupsobject[]
Show 4 child fields
idstringrequired
namestringrequired
descriptionstring
parentIdstring
accountsobject[]
Show 8 child fields
codestringrequired
namestringrequired
descriptionstring
groupIdstringrequired
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
Show 18 values

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

Returns

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "string",
  "validFrom": "string",
  "validUntil": "string",
  "groups": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "parentId": "string"
    }
  ],
  "accounts": [
    {
      "code": "string",
      "name": "string",
      "description": "string",
      "groupId": "string",
      "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
      "type": "BANK",
      "currency": "CHF"
    }
  ]
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}

Delete a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

Returns

204

No content

curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts

Create an account inside a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

Request body

accountCodestringrequired
namestringrequired
descriptionstring
groupIdstringrequired
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
Show 18 values

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

Returns

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "accountCode": "string",
  "name": "string",
  "description": "string",
  "groupId": "string",
  "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "type": "BANK",
  "currency": "CHF"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
PATCH/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}

Update an account inside a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

accountIdstringrequired

Code of the account in the chart of accounts.

Request body

newAccountCodestring
namestring
descriptionstring | null
groupIdstring
taxTypeIdstring | null

ID of the tax type.

bankAccountIdstring | null

ID of the bank account.

typestring | null
Show 18 values

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring | null

ISO 4217 currency code

Returns

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "type": "BANK",
  "currency": "CHF"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}

Delete an account from a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

accountIdstringrequired

Code of the account in the chart of accounts.

Returns

204

No content

curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups

Create an account group inside a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

Request body

groupIdstringrequired
namestringrequired
descriptionstring
parentIdstring

Returns

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "groupId": "string",
  "name": "string",
  "description": "string",
  "parentId": "string"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
PATCH/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups/{groupId}

Update an account group inside a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

groupIdstringrequired

ID of the account group in the chart of accounts.

Request body

newGroupIdstring
namestring
descriptionstring | null
parentIdstring | null

Returns

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "newGroupId": "string",
  "name": "string",
  "description": "string",
  "parentId": "string"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups/{groupId}

Delete an account group from a chart of accounts

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

chartOfAccountIdstringrequired

ID of the chart of accounts.

groupIdstringrequired

ID of the account group in the chart of accounts.

Returns

204

No content

curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/chart-of-accounts/export

Export a chart of accounts to a downloadable file

Scopechart-of-accounts:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Returns

200

Successful response

dataExportedFile[]required
Show 7 child fields
successbooleanrequired

Whether the file was produced; a failed file has no content.

fromDatestring

First day of the period the file covers.

toDatestring

Last day of the period the file covers, included.

mimeTypestring

Media type of the file.

namestring

Name of the file.

contentstring

Content of the file, as text.

encodingstring

Character encoding of the file, when it is not UTF-8.

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/export' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "success": true,
      "fromDate": "2026-03-02",
      "toDate": "2026-03-02",
      "mimeType": "text/csv",
      "name": "string",
      "content": "string",
      "encoding": "win1252"
    }
  ]
}

Start building on your own data.

Create an account, open Profile › Developer and create a key scoped to the resources you need. Questions about an integration? The team answers them on a call.