| Méthode | Chemin | Résumé |
|---|---|---|
| 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 |
Les chemins commencent par /workspaces/{workspaceId}. Les endpoints GET demandent chart-of-accounts:read, les autres chart-of-accounts:write.
L’objet ChartOfAccount
firestoreIdstringobligatoireID of the chart of accounts.
workspaceIdstringobligatoireID of the workspace.
validFromstringvalidUntilstringtitlestringobligatoiregroupsobject[]obligatoireAfficher les 4 champs enfants
idstringobligatoirenamestringobligatoiredescriptionstringparentIdstringaccountsobject[]obligatoireAfficher les 8 champs enfants
codestringobligatoirenamestringobligatoiredescriptionstringgroupIdstringobligatoiretaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringAfficher les 18 valeurs
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Afficher les 8 champsMasquer la liste des champs
creationobjectobligatoireWhen and by whom the resource was created.
Afficher les 2 champs enfants
creationDateTimestringdate-timeobligatoireDate 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
Portéechart-of-accounts:read
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
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.
Par défaut20
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.
Renvoie
List of items
Items of the page, in list order.
limitintegerobligatoirePage 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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Corps de la requête
titlestringobligatoirevalidFromstringvalidUntilstringgroupsobject[]obligatoireAfficher les 4 champs enfants
idstringobligatoirenamestringobligatoiredescriptionstringparentIdstringaccountsobject[]obligatoireAfficher les 8 champs enfants
codestringobligatoirenamestringobligatoiredescriptionstringgroupIdstringobligatoiretaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringAfficher les 18 valeurs
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
importedFromFilestringRenvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
Corps de la requête
titlestringvalidFromstringvalidUntilstringgroupsobject[]Afficher les 4 champs enfants
idstringobligatoirenamestringobligatoiredescriptionstringparentIdstringaccountsobject[]Afficher les 8 champs enfants
codestringobligatoirenamestringobligatoiredescriptionstringgroupIdstringobligatoiretaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringAfficher les 18 valeurs
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Renvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
Renvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
Corps de la requête
accountCodestringobligatoirenamestringobligatoiredescriptionstringgroupIdstringobligatoiretaxTypeIdstringID of the tax type.
bankAccountIdstringID of the bank account.
typestringAfficher les 18 valeurs
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystringISO 4217 currency code
Renvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
accountIdstringobligatoireCode of the account in the chart of accounts.
Corps de la requête
newAccountCodestringnamestringdescriptionstring | nullgroupIdstringtaxTypeIdstring | nullID of the tax type.
bankAccountIdstring | nullID of the bank account.
typestring | nullAfficher les 18 valeurs
BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE
currencystring | nullISO 4217 currency code
Renvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
accountIdstringobligatoireCode of the account in the chart of accounts.
Renvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
Corps de la requête
groupIdstringobligatoirenamestringobligatoiredescriptionstringparentIdstringRenvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
groupIdstringobligatoireID of the account group in the chart of accounts.
Corps de la requête
newGroupIdstringnamestringdescriptionstring | nullparentIdstring | nullRenvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
chartOfAccountIdstringobligatoireID of the chart of accounts.
groupIdstringobligatoireID of the account group in the chart of accounts.
Renvoie
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
Portéechart-of-accounts:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Renvoie
Successful response
dataExportedFile[]obligatoireAfficher les 7 champs enfants
successbooleanobligatoireWhether 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"
}
}