Zum Inhalt springen
Ressource · Workspace

Workspaces

A workspace holds the bank accounts, invoices, payments and accounting of one company.

workspaces:readworkspaces:write
MethodePfadZusammenfassung
GET/workspacesList workspaces accessible to the authenticated user
POST/workspacesCreate a new workspace
PATCH/workspaces/{workspaceId}Update a workspace

GET-Endpunkte brauchen workspaces:read, die übrigen workspaces:write.

Das Objekt Workspace

firestoreIdstringerforderlich

ID of the workspace.

billingAccountIdstringerforderlich

ID of the billing account.

namestringerforderlich
normalizedNamestring
photoUrlstringuri
subscriptionobjecterforderlich
5 untergeordnete Felder anzeigen
trialStartDateTimestringdate-timeerforderlich
trialEndDateTimestringdate-timeerforderlich
statusstringerforderlich

Status of the workspace subscription.

  • trialing

    The workspace is in its trial period.

  • active

    The workspace has a running paid subscription.

  • expired

    The trial or the subscription has ended, and the workspace is suspended.

startDateTimestringdate-time
endDateTimestringdate-time
creationobjecterforderlich

When and by whom the resource was created.

2 untergeordnete Felder anzeigen
creationDateTimestringdate-timeerforderlich

Date and time when the resource was created.

createdBystring

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

Alle 15 Felder anzeigen
activationobjecterforderlich

Whether the resource is enabled, and when and by whom it was last enabled or disabled.

3 untergeordnete Felder anzeigen
enabledbooleanerforderlich

Whether the resource is enabled.

updateDateTimestringdate-timeerforderlich

Date and time when enabled was last set.

updatedBystring

ID of the user who last set enabled, when recorded.

usersstring[]erforderlich
vatobject
3 untergeordnete Felder anzeigen
schemestring

Wertecash_basisaccrual_basisnet_tax_rateflat_tax_rate

identificationNumberstring
ratesobject[]
2 untergeordnete Felder anzeigen
typestringerforderlich

Wertestandardreducedspecialfixed

ratenumbererforderlich
allowedDomainsstring[]
allowedEmailsstring[]email
aiBasedAccountCodingEnabledboolean

Standardtrue

ruleBasedAccountCodingEnabledboolean

Standardfalse

baseCurrencystring

ISO 4217 currency code

Das Objekt Workspace
{
  "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"
}
GET/workspaces

List workspaces accessible to the authenticated user

Bereichworkspaces:read

Abfrageparameter

fieldsstring

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

Rückgabe

200

Successful response

dataWorkspace[]erforderlich
curl 'https://api.business.swayapp.io/v1/workspaces' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "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"
    }
  ]
}
POST/workspaces

Create a new workspace

Bereichworkspaces:write

Abfrageparameter

fieldsstring

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

Request-Body

namestringerforderlich

Name of the workspace.

foundationDatestring
sizestring

Number of employees of the company.

  • lessFive

    Fewer than 5 employees.

  • fiveToTen

    5 to 10 employees.

  • elevenToFifty

    11 to 50 employees.

  • fiftyOneToOneHundred

    51 to 100 employees.

  • oneHundredToTwoHundredFifty

    100 to 250 employees.

  • moreThanTwoHundredFifty

    More than 250 employees.

industrystring

Industry of the company.

29 Werte anzeigen
  • agriculturePisciculture

    Agriculture and fish farming.

  • businessServices

    Business services.

  • chemical

    Chemical industry.

  • commerce

    Commerce.

  • communication

    Communication.

  • construction

    Construction.

  • cultureEntertainment

    Culture and entertainment.

  • defense

    Defense.

  • education

    Education.

  • energy

    Energy.

  • finance

    Finance.

  • food

    Food.

  • forestry

    Forestry.

  • health

    Health.

  • hospitalityCatering

    Hospitality and catering.

  • insurance

    Insurance.

  • legal

    Legal services.

  • manufacturing

    Manufacturing.

  • mediaInformation

    Media and information.

  • miningOilGas

    Mining, oil and gas.

  • personalServices

    Personal services.

  • publicService

    Public service.

  • realEstate

    Real estate.

  • sportFitness

    Sport and fitness.

  • technology

    Technology.

  • textileLifeStyle

    Textile and lifestyle.

  • tourism

    Tourism.

  • transportation

    Transportation.

  • other

    Another industry.

addressPostalAddress

Postal address, with the parts of an ISO 20022 postal address.

12 untergeordnete Felder anzeigen
countrystringerforderlich

ISO 3166-1 alpha-2 country code

postCodestringerforderlich

Post code of the address.

townNamestringerforderlich

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring

Post office box.

administrativeAreastring

Region of the country, such as a canton or a state.

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

Text the address was read from, one item per line.

Rückgabe

200

Successful response

dataWorkspaceerforderlich
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"
    ]
  }
}'
{
  "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"
  }
}
PATCH/workspaces/{workspaceId}

Update a workspace

Bereichworkspaces:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

Abfrageparameter

fieldsstring

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

Request-Body

namestring

Name of the workspace.

vatobject
3 untergeordnete Felder anzeigen
schemestring

Wertecash_basisaccrual_basisnet_tax_rateflat_tax_rate

identificationNumberstring
ratesobject[]
2 untergeordnete Felder anzeigen
typestringerforderlich

Wertestandardreducedspecialfixed

ratenumbererforderlich
allowedDomainsArrayOperationobject
2 untergeordnete Felder anzeigen
operationstringerforderlich

Werteunionremove

itemsstring[]erforderlich
allowedEmailsArrayOperationobject
2 untergeordnete Felder anzeigen
operationstringerforderlich

Werteunionremove

itemsstring[]emailerforderlich
aiBasedAccountCodingEnabledboolean
ruleBasedAccountCodingEnabledboolean
entityInformationobject
5 untergeordnete Felder anzeigen
entityTypestringerforderlich

Kind of entity: an individual or an organization.

  • individual

    A natural person.

  • organization

    A company or another organization.

legalNamestringerforderlich
phonesstring[]erforderlich
emailsstring[]erforderlich
addressesPostalAddress[]erforderlich

Postal address, with the parts of an ISO 20022 postal address.

12 untergeordnete Felder anzeigen
countrystringerforderlich

ISO 3166-1 alpha-2 country code

postCodestringerforderlich

Post code of the address.

townNamestringerforderlich

Name of the town or city.

streetNamestring

Name of the street.

buildingNumberstring

Number of the building in the street.

namestring

Name of the building or place.

sortingCodestring

Additional sorting code of the postal service, used in a few countries such as France.

postBoxstring

Post office box.

administrativeAreastring

Region of the country, such as a canton or a state.

recipientsstring[]

Names of the people the address is for.

organizationstring

Name of the organization at the address.

sourcestring[]

Text the address was read from, one item per line.

baseCurrencystring

ISO 4217 currency code

Rückgabe

200

Successful response

dataWorkspaceerforderlich
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"
}'
{
  "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"
  }
}

Bauen Sie auf Ihren eigenen Daten.

Erstellen Sie ein Konto, öffnen Sie Profil › Entwickler und erstellen Sie einen Schlüssel, der auf die nötigen Ressourcen begrenzt ist. Fragen zu einer Integration? Das Team beantwortet sie in einem Gespräch.