| Method | Path | Summary |
|---|---|---|
| GET | …/chart-of-accounts | List charts of accounts in the workspace |
| POST | …/chart-of-accounts | Create 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}/accounts | Create 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}/groups | Create 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/export | Export 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
firestoreIdstringrequiredID of the chart of accounts.
workspaceIdstringrequiredID of the workspace.
validFromstringvalidUntilstringtitlestringrequiredgroupsobject[]requiredShow 4 child fields
idstringrequirednamestringrequireddescriptionstringparentIdstringaccountsobject[]requiredShow 8 child fields
codestringrequirednamestringrequireddescriptionstringgroupIdstringrequiredtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringShow 18 values
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Show all 8 fieldsHide the field list
creationobjectrequiredWhen and by whom the resource was created.
Show 2 child fields
creationDateTimestringdate-timerequiredDate and time when the resource was created.
createdBystringID of the user who created the resource, when recorded.
{
"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"
}
}/workspaces/{workspaceId}/chart-of-accountsList charts of accounts in the workspace
Scopechart-of-accounts:read
Path parameters
workspaceIdstringrequiredID of the workspace.
Query parameters
limitintegerMaximum 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
startAfterstringCursor of the page to return: the nextCursor of the previous page.
fieldsstringComma-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
List of items
Items of the page, in list order.
limitintegerrequiredPage size of the request, or the number of requested ids.
nextCursorstringCursor 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"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts', {
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(await response.json());import os
import requests
response = requests.get(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"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"
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accountsCreate a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
Query parameters
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Request body
titlestringrequiredvalidFromstringvalidUntilstringgroupsobject[]requiredShow 4 child fields
idstringrequirednamestringrequireddescriptionstringparentIdstringaccountsobject[]requiredShow 8 child fields
codestringrequirednamestringrequireddescriptionstringgroupIdstringrequiredtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringShow 18 values
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
importedFromFilestringReturns
Successful response
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"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"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"
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"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",
},
)
print(response.json()){
"data": {
"firestoreId": "Ca6yH3kN8pTr1vWx4bQs",
"workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
"validFrom": "string",
"validUntil": "string",
"title": "string",
"groups": […],
"accounts": […],
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
}
}
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}Update a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
Request body
titlestringvalidFromstringvalidUntilstringgroupsobject[]Show 4 child fields
idstringrequirednamestringrequireddescriptionstringparentIdstringaccountsobject[]Show 8 child fields
codestringrequirednamestringrequireddescriptionstringgroupIdstringrequiredtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringShow 18 values
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Returns
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"
}
]
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"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"
}
]
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"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",
},
],
},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}Delete a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
Returns
No content
curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(response.status);import os
import requests
response = requests.delete(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accountsCreate an account inside a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
Request body
accountCodestringrequirednamestringrequireddescriptionstringgroupIdstringrequiredtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringShow 18 values
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Returns
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"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"accountCode": "string",
"name": "string",
"description": "string",
"groupId": "string",
"taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"type": "BANK",
"currency": "CHF"
}),
});
console.log(response.status);import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"accountCode": "string",
"name": "string",
"description": "string",
"groupId": "string",
"taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"type": "BANK",
"currency": "CHF",
},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}Update an account inside a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
accountIdstringrequiredCode of the account in the chart of accounts.
Request body
newAccountCodestringnamestringdescriptionstring | nullgroupIdstringtaxTypeIdstring | nullID of the tax type.
bankAccountIdstring | nullID of the bank account.
typestring | nullShow 18 values
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystring | nullISO 4217 currency code
Returns
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"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"type": "BANK",
"currency": "CHF"
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"type": "BANK",
"currency": "CHF",
},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}Delete an account from a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
accountIdstringrequiredCode of the account in the chart of accounts.
Returns
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"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(response.status);import os
import requests
response = requests.delete(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groupsCreate an account group inside a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
Request body
groupIdstringrequirednamestringrequireddescriptionstringparentIdstringReturns
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"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"groupId": "string",
"name": "string",
"description": "string",
"parentId": "string"
}),
});
console.log(response.status);import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"groupId": "string",
"name": "string",
"description": "string",
"parentId": "string",
},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups/{groupId}Update an account group inside a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
groupIdstringrequiredID of the account group in the chart of accounts.
Request body
newGroupIdstringnamestringdescriptionstring | nullparentIdstring | nullReturns
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"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"newGroupId": "string",
"name": "string",
"description": "string",
"parentId": "string"
}),
});
console.log(response.status);import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"newGroupId": "string",
"name": "string",
"description": "string",
"parentId": "string",
},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups/{groupId}Delete an account group from a chart of accounts
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
chartOfAccountIdstringrequiredID of the chart of accounts.
groupIdstringrequiredID of the account group in the chart of accounts.
Returns
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"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(response.status);import os
import requests
response = requests.delete(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/chart-of-accounts/exportExport a chart of accounts to a downloadable file
Scopechart-of-accounts:write
Path parameters
workspaceIdstringrequiredID of the workspace.
Query parameters
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Returns
Successful response
dataExportedFile[]requiredShow 7 child fields
successbooleanrequiredWhether the file was produced; a failed file has no content.
fromDatestringFirst day of the period the file covers.
toDatestringLast day of the period the file covers, included.
mimeTypestringMedia type of the file.
namestringName of the file.
contentstringContent of the file, as text.
encodingstringCharacter 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"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/export', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/export",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"data": [
{
"success": true,
"fromDate": "2026-03-02",
"toDate": "2026-03-02",
"mimeType": "text/csv",
"name": "string",
"content": "string",
"encoding": "win1252"
}
]
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}