| Methode | Pfad | Zusammenfassung |
|---|---|---|
| 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 |
Die Pfade beginnen mit /workspaces/{workspaceId}. GET-Endpunkte brauchen chart-of-accounts:read, die übrigen chart-of-accounts:write.
Das Objekt ChartOfAccount
firestoreIdstringerforderlichID of the chart of accounts.
workspaceIdstringerforderlichID of the workspace.
validFromstringvalidUntilstringtitlestringerforderlichgroupsobject[]erforderlich4 untergeordnete Felder anzeigen
idstringerforderlichnamestringerforderlichdescriptionstringparentIdstringaccountsobject[]erforderlich8 untergeordnete Felder anzeigen
codestringerforderlichnamestringerforderlichdescriptionstringgroupIdstringerforderlichtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestring18 Werte anzeigen
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Alle 8 Felder anzeigenFeldliste ausblenden
creationobjecterforderlichWhen and by whom the resource was created.
2 untergeordnete Felder anzeigen
creationDateTimestringdate-timeerforderlichDate 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
Bereichchart-of-accounts:read
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
Abfrageparameter
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.
Standard20
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.
Rückgabe
List of items
Items of the page, in list order.
limitintegererforderlichPage 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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
Abfrageparameter
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Request-Body
titlestringerforderlichvalidFromstringvalidUntilstringgroupsobject[]erforderlich4 untergeordnete Felder anzeigen
idstringerforderlichnamestringerforderlichdescriptionstringparentIdstringaccountsobject[]erforderlich8 untergeordnete Felder anzeigen
codestringerforderlichnamestringerforderlichdescriptionstringgroupIdstringerforderlichtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestring18 Werte anzeigen
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
importedFromFilestringRückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
Request-Body
titlestringvalidFromstringvalidUntilstringgroupsobject[]4 untergeordnete Felder anzeigen
idstringerforderlichnamestringerforderlichdescriptionstringparentIdstringaccountsobject[]8 untergeordnete Felder anzeigen
codestringerforderlichnamestringerforderlichdescriptionstringgroupIdstringerforderlichtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestring18 Werte anzeigen
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Rückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
Rückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
Request-Body
accountCodestringerforderlichnamestringerforderlichdescriptionstringgroupIdstringerforderlichtaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestring18 Werte anzeigen
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Rückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
accountIdstringerforderlichCode of the account in the chart of accounts.
Request-Body
newAccountCodestringnamestringdescriptionstring | nullgroupIdstringtaxTypeIdstring | nullID of the tax type.
bankAccountIdstring | nullID of the bank account.
typestring | null18 Werte anzeigen
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystring | nullISO 4217 currency code
Rückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
accountIdstringerforderlichCode of the account in the chart of accounts.
Rückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
Request-Body
groupIdstringerforderlichnamestringerforderlichdescriptionstringparentIdstringRückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
groupIdstringerforderlichID of the account group in the chart of accounts.
Request-Body
newGroupIdstringnamestringdescriptionstring | nullparentIdstring | nullRückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
chartOfAccountIdstringerforderlichID of the chart of accounts.
groupIdstringerforderlichID of the account group in the chart of accounts.
Rückgabe
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
Bereichchart-of-accounts:write
Pfadparameter
workspaceIdstringerforderlichID of the workspace.
Abfrageparameter
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Rückgabe
Successful response
dataExportedFile[]erforderlich7 untergeordnete Felder anzeigen
successbooleanerforderlichWhether 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"
}
}