| Methode | Pfad | Zusammenfassung |
|---|---|---|
| GET | /workspaces | List workspaces accessible to the authenticated user |
| POST | /workspaces | Create a new workspace |
| PATCH | /workspaces/{workspaceId} | Update a workspace |
GET-Endpunkte brauchen workspaces:read, die übrigen workspaces:write.
Das Objekt Workspace
firestoreIdstringerforderlichID of the workspace.
billingAccountIdstringerforderlichID of the billing account.
namestringerforderlichnormalizedNamestringphotoUrlstringurisubscriptionobjecterforderlich5 untergeordnete Felder anzeigen
trialStartDateTimestringdate-timeerforderlichtrialEndDateTimestringdate-timeerforderlichstatusstringerforderlichStatus of the workspace subscription.
trialingThe workspace is in its trial period.
activeThe workspace has a running paid subscription.
expiredThe trial or the subscription has ended, and the workspace is suspended.
startDateTimestringdate-timeendDateTimestringdate-timecreationobjecterforderlichWhen 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.
Alle 15 Felder anzeigenFeldliste ausblenden
activationobjecterforderlichWhether the resource is enabled, and when and by whom it was last enabled or disabled.
3 untergeordnete Felder anzeigen
enabledbooleanerforderlichWhether the resource is enabled.
updateDateTimestringdate-timeerforderlichDate and time when enabled was last set.
updatedBystringID of the user who last set enabled, when recorded.
usersstring[]erforderlichvatobject3 untergeordnete Felder anzeigen
schemestringWertecash_basisaccrual_basisnet_tax_rateflat_tax_rate
identificationNumberstringratesobject[]2 untergeordnete Felder anzeigen
typestringerforderlichWertestandardreducedspecialfixed
ratenumbererforderlichallowedDomainsstring[]allowedEmailsstring[]emailaiBasedAccountCodingEnabledbooleanStandardtrue
ruleBasedAccountCodingEnabledbooleanStandardfalse
baseCurrencystringISO 4217 currency code
{
"firestoreId": "Wk7fQ2xR9bLm4tZp8sNv",
"billingAccountId": "Bl6tW3mQ8xKp2vNr7zHs",
"name": "string",
"normalizedName": "string",
"photoUrl": "https://example.com",
"subscription": {
"trialStartDateTime": "2026-03-02T09:30:00.000Z",
"trialEndDateTime": "2026-03-02T09:30:00.000Z",
"status": "trialing",
"startDateTime": "2026-03-02T09:30:00.000Z",
"endDateTime": "2026-03-02T09:30:00.000Z"
},
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"activation": {
"enabled": true,
"updateDateTime": "2026-03-02T09:15:00.000Z",
"updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"users": [
"string"
],
"vat": {
"scheme": "cash_basis",
"identificationNumber": "string",
"rates": [
{
"type": "standard",
"rate": 0
}
]
},
"allowedDomains": [
"string"
],
"allowedEmails": [
"anna.meier@example.com"
],
"aiBasedAccountCodingEnabled": true,
"ruleBasedAccountCodingEnabled": false,
"baseCurrency": "CHF"
}/workspacesList workspaces accessible to the authenticated user
Bereichworkspaces:read
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
curl 'https://api.business.swayapp.io/v1/workspaces' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces', {
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",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"data": [
{
"firestoreId": "Wk7fQ2xR9bLm4tZp8sNv",
"billingAccountId": "Bl6tW3mQ8xKp2vNr7zHs",
"name": "string",
"normalizedName": "string",
"photoUrl": "https://example.com",
"subscription": {
"trialStartDateTime": "2026-03-02T09:30:00.000Z",
"trialEndDateTime": "2026-03-02T09:30:00.000Z",
"status": "trialing",
"startDateTime": "2026-03-02T09:30:00.000Z",
"endDateTime": "2026-03-02T09:30:00.000Z"
},
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"activation": {
"enabled": true,
"updateDateTime": "2026-03-02T09:15:00.000Z",
"updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"users": [
"string"
],
"vat": {…},
"allowedDomains": [
"string"
],
"allowedEmails": [
"anna.meier@example.com"
],
"aiBasedAccountCodingEnabled": true,
"ruleBasedAccountCodingEnabled": false,
"baseCurrency": "CHF"
}
]
}{
"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": "internal",
"message": "An internal error occurred"
}
}/workspacesCreate a new workspace
Bereichworkspaces:write
Abfrageparameter
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Request-Body
namestringerforderlichName of the workspace.
foundationDatestringsizestringNumber of employees of the company.
lessFiveFewer than 5 employees.
fiveToTen5 to 10 employees.
elevenToFifty11 to 50 employees.
fiftyOneToOneHundred51 to 100 employees.
oneHundredToTwoHundredFifty100 to 250 employees.
moreThanTwoHundredFiftyMore than 250 employees.
industrystringIndustry of the company.
29 Werte anzeigen
agriculturePiscicultureAgriculture and fish farming.
businessServicesBusiness services.
chemicalChemical industry.
commerceCommerce.
communicationCommunication.
constructionConstruction.
cultureEntertainmentCulture and entertainment.
defenseDefense.
educationEducation.
energyEnergy.
financeFinance.
foodFood.
forestryForestry.
healthHealth.
hospitalityCateringHospitality and catering.
insuranceInsurance.
legalLegal services.
manufacturingManufacturing.
mediaInformationMedia and information.
miningOilGasMining, oil and gas.
personalServicesPersonal services.
publicServicePublic service.
realEstateReal estate.
sportFitnessSport and fitness.
technologyTechnology.
textileLifeStyleTextile and lifestyle.
tourismTourism.
transportationTransportation.
otherAnother industry.
addressPostalAddressPostal address, with the parts of an ISO 20022 postal address.
12 untergeordnete Felder anzeigen
countrystringerforderlichISO 3166-1 alpha-2 country code
postCodestringerforderlichPost code of the address.
townNamestringerforderlichName of the town or city.
streetNamestringName of the street.
buildingNumberstringNumber of the building in the street.
namestringName of the building or place.
sortingCodestringAdditional sorting code of the postal service, used in a few countries such as France.
postBoxstringPost office box.
administrativeAreastringRegion of the country, such as a canton or a state.
recipientsstring[]Names of the people the address is for.
organizationstringName of the organization at the address.
sourcestring[]Text the address was read from, one item per line.
Rückgabe
Successful response
curl -X POST 'https://api.business.swayapp.io/v1/workspaces' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"foundationDate": "1990-05-14",
"size": "lessFive",
"industry": "agriculturePisciculture",
"address": {
"country": "CH",
"postCode": "8001",
"townName": "Zürich",
"streetName": "Bahnhofstrasse",
"buildingNumber": "10",
"name": "Haus zur Linde",
"sortingCode": "string",
"postBox": "Postfach 1234",
"administrativeArea": "Zürich",
"recipients": [
"Anna Meier"
],
"organization": "Muster AG",
"source": [
"Muster AG",
"Bahnhofstrasse 10",
"8001 Zürich"
]
}
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"foundationDate": "1990-05-14",
"size": "lessFive",
"industry": "agriculturePisciculture",
"address": {
"country": "CH",
"postCode": "8001",
"townName": "Zürich",
"streetName": "Bahnhofstrasse",
"buildingNumber": "10",
"name": "Haus zur Linde",
"sortingCode": "string",
"postBox": "Postfach 1234",
"administrativeArea": "Zürich",
"recipients": [
"Anna Meier"
],
"organization": "Muster AG",
"source": [
"Muster AG",
"Bahnhofstrasse 10",
"8001 Zürich"
]
}
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"name": "string",
"foundationDate": "1990-05-14",
"size": "lessFive",
"industry": "agriculturePisciculture",
"address": {
"country": "CH",
"postCode": "8001",
"townName": "Zürich",
"streetName": "Bahnhofstrasse",
"buildingNumber": "10",
"name": "Haus zur Linde",
"sortingCode": "string",
"postBox": "Postfach 1234",
"administrativeArea": "Zürich",
"recipients": [
"Anna Meier",
],
"organization": "Muster AG",
"source": [
"Muster AG",
"Bahnhofstrasse 10",
"8001 Zürich",
],
},
},
)
print(response.json()){
"data": {
"firestoreId": "Wk7fQ2xR9bLm4tZp8sNv",
"billingAccountId": "Bl6tW3mQ8xKp2vNr7zHs",
"name": "string",
"normalizedName": "string",
"photoUrl": "https://example.com",
"subscription": {
"trialStartDateTime": "2026-03-02T09:30:00.000Z",
"trialEndDateTime": "2026-03-02T09:30:00.000Z",
"status": "trialing",
"startDateTime": "2026-03-02T09:30:00.000Z",
"endDateTime": "2026-03-02T09:30:00.000Z"
},
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"activation": {
"enabled": true,
"updateDateTime": "2026-03-02T09:15:00.000Z",
"updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"users": [
"string"
],
"vat": {…},
"allowedDomains": [
"string"
],
"allowedEmails": [
"anna.meier@example.com"
],
"aiBasedAccountCodingEnabled": true,
"ruleBasedAccountCodingEnabled": false,
"baseCurrency": "CHF"
}
}{
"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": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}Update a workspace
Bereichworkspaces: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
namestringName of the workspace.
vatobject3 untergeordnete Felder anzeigen
schemestringWertecash_basisaccrual_basisnet_tax_rateflat_tax_rate
identificationNumberstringratesobject[]2 untergeordnete Felder anzeigen
typestringerforderlichWertestandardreducedspecialfixed
ratenumbererforderlichallowedDomainsArrayOperationobject2 untergeordnete Felder anzeigen
operationstringerforderlichWerteunionremove
itemsstring[]erforderlichallowedEmailsArrayOperationobject2 untergeordnete Felder anzeigen
operationstringerforderlichWerteunionremove
itemsstring[]emailerforderlichaiBasedAccountCodingEnabledbooleanruleBasedAccountCodingEnabledbooleanentityInformationobject5 untergeordnete Felder anzeigen
entityTypestringerforderlichKind of entity: an individual or an organization.
individualA natural person.
organizationA company or another organization.
legalNamestringerforderlichphonesstring[]erforderlichemailsstring[]erforderlichaddressesPostalAddress[]erforderlichPostal address, with the parts of an ISO 20022 postal address.
12 untergeordnete Felder anzeigen
countrystringerforderlichISO 3166-1 alpha-2 country code
postCodestringerforderlichPost code of the address.
townNamestringerforderlichName of the town or city.
streetNamestringName of the street.
buildingNumberstringNumber of the building in the street.
namestringName of the building or place.
sortingCodestringAdditional sorting code of the postal service, used in a few countries such as France.
postBoxstringPost office box.
administrativeAreastringRegion of the country, such as a canton or a state.
recipientsstring[]Names of the people the address is for.
organizationstringName of the organization at the address.
sourcestring[]Text the address was read from, one item per line.
baseCurrencystringISO 4217 currency code
Rückgabe
Successful response
curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv' \
-H "Authorization: Bearer $SWAY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"vat": {
"scheme": "cash_basis"
},
"allowedEmailsArrayOperation": {
"operation": "union",
"items": [
"anna.meier@example.com"
]
},
"baseCurrency": "CHF"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"vat": {
"scheme": "cash_basis"
},
"allowedEmailsArrayOperation": {
"operation": "union",
"items": [
"anna.meier@example.com"
]
},
"baseCurrency": "CHF"
}),
});
console.log(await response.json());import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"vat": {
"scheme": "cash_basis",
},
"allowedEmailsArrayOperation": {
"operation": "union",
"items": [
"anna.meier@example.com",
],
},
"baseCurrency": "CHF",
},
)
print(response.json()){
"data": {
"firestoreId": "Wk7fQ2xR9bLm4tZp8sNv",
"billingAccountId": "Bl6tW3mQ8xKp2vNr7zHs",
"name": "string",
"normalizedName": "string",
"photoUrl": "https://example.com",
"subscription": {
"trialStartDateTime": "2026-03-02T09:30:00.000Z",
"trialEndDateTime": "2026-03-02T09:30:00.000Z",
"status": "trialing",
"startDateTime": "2026-03-02T09:30:00.000Z",
"endDateTime": "2026-03-02T09:30:00.000Z"
},
"creation": {
"creationDateTime": "2026-03-02T09:15:00.000Z",
"createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"activation": {
"enabled": true,
"updateDateTime": "2026-03-02T09:15:00.000Z",
"updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
},
"users": [
"string"
],
"vat": {…},
"allowedDomains": [
"string"
],
"allowedEmails": [
"anna.meier@example.com"
],
"aiBasedAccountCodingEnabled": true,
"ruleBasedAccountCodingEnabled": false,
"baseCurrency": "CHF"
}
}{
"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"
}
}