Zum Inhalt springen
Ressource · Files and account

Users

The user is the person the API token acts for.

users:readusers:write
MethodePfadZusammenfassung
GET…/meGet the authenticated user profile
PATCH…/meUpdate the authenticated user profile
GET…/me/permissionsGet the permissions granted to the authenticated user

Die Pfade beginnen mit /users. GET-Endpunkte brauchen users:read, die übrigen users:write.

Das Objekt User

firestoreIdstringerforderlich

ID of the user.

firstNamestring
lastNamestring
displayNamestring
emailstringemailerforderlich
statusstringerforderlich

Status of the user account.

  • registered

    The user has signed up.

phonestring
Alle 15 Felder anzeigen
birthdatestring
positionstring

Position of the user in the company.

  • ceo

    Chief executive officer.

  • cfo

    Chief financial officer.

  • otherCLevel

    Another C-level executive.

  • businessAdministrative

    Business or administrative staff.

  • accountant

    Accountant.

  • other

    Another position.

photoUrlstringuri
localestring
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.

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.

notificationsobject
2 untergeordnete Felder anzeigen
defaultsRecord<string, object>
2 untergeordnete Felder anzeigen
emailbooleanerforderlich
pushbooleanerforderlich
workspacesRecord<string, object>
2 untergeordnete Felder anzeigen
modestringerforderlich

How the user receives the notifications of the workspace.

  • default

    The workspace follows the default notification settings of the user.

  • custom

    The workspace follows its own notification settings, in custom.

  • muted

    The user receives no notification for the workspace.

customRecord<string, object>
2 untergeordnete Felder anzeigen
emailbooleanerforderlich
pushbooleanerforderlich
relationshipsobjecterforderlich
1 untergeordnetes Feld anzeigen
lastAcceptedAgreementsRecord<string, object>erforderlich
5 untergeordnete Felder anzeigen
firestoreIdstringerforderlich

ID of the agreement.

userIdstringerforderlich

ID of the user.

acceptanceDateTimestringdate-timeerforderlich
revisionnumbererforderlich
typestringerforderlich

Legal document of Sway that the user accepts.

  • termsAndConditions

    Terms and conditions of Sway.

  • privacyPolicy

    Privacy policy of Sway.

  • cookiePolicy

    Cookie policy of Sway.

Das Objekt User
{
  "firestoreId": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj",
  "firstName": "string",
  "lastName": "string",
  "displayName": "string",
  "email": "anna.meier@example.com",
  "status": "registered",
  "phone": "+41791234567",
  "birthdate": "1990-05-14",
  "position": "ceo",
  "photoUrl": "https://example.com",
  "locale": "string",
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "activation": {
    "enabled": true,
    "updateDateTime": "2026-03-02T09:15:00.000Z",
    "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "notifications": {
    "defaults": {
      "key": {
        "email": true,
        "push": true
      }
    },
    "workspaces": {
      "Wk7fQ2xR9bLm4tZp8sNv": {
        "mode": "default",
        "custom": {
          "key": {
            "email": true,
            "push": true
          }
        }
      }
    }
  },
  "relationships": {
    "lastAcceptedAgreements": {
      "key": {
        "firestoreId": "Ag4kR8tN2wQx6zLp3vMb",
        "userId": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj",
        "acceptanceDateTime": "2026-03-02T09:30:00.000Z",
        "revision": 0,
        "type": "termsAndConditions"
      }
    }
  }
}
GET/users/me

Get the authenticated user profile

Bereichusers: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

dataUsererforderlich
curl 'https://api.business.swayapp.io/v1/users/me' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": {
    "firestoreId": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj",
    "firstName": "string",
    "lastName": "string",
    "displayName": "string",
    "email": "anna.meier@example.com",
    "status": "registered",
    "phone": "+41791234567",
    "birthdate": "1990-05-14",
    "position": "ceo",
    "photoUrl": "https://example.com",
    "locale": "string",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "activation": {
      "enabled": true,
      "updateDateTime": "2026-03-02T09:15:00.000Z",
      "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "notifications": {…},
    "relationships": {…}
  }
}
PATCH/users/me

Update the authenticated user profile

Bereichusers: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

firstNamestring
lastNamestring
positionstring

Position of the user in the company.

  • ceo

    Chief executive officer.

  • cfo

    Chief financial officer.

  • otherCLevel

    Another C-level executive.

  • businessAdministrative

    Business or administrative staff.

  • accountant

    Accountant.

  • other

    Another position.

birthdatestring
phonestring
localestring

Rückgabe

200

Successful response

dataUsererforderlich
curl -X PATCH 'https://api.business.swayapp.io/v1/users/me' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "position": "ceo",
  "birthdate": "1990-05-14",
  "phone": "+41791234567"
}'
{
  "data": {
    "firestoreId": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj",
    "firstName": "string",
    "lastName": "string",
    "displayName": "string",
    "email": "anna.meier@example.com",
    "status": "registered",
    "phone": "+41791234567",
    "birthdate": "1990-05-14",
    "position": "ceo",
    "photoUrl": "https://example.com",
    "locale": "string",
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "activation": {
      "enabled": true,
      "updateDateTime": "2026-03-02T09:15:00.000Z",
      "updatedBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    },
    "notifications": {…},
    "relationships": {…}
  }
}
GET/users/me/permissions

Get the permissions granted to the authenticated user

Bereichusers: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

dataUserPermissionserforderlich
3 untergeordnete Felder anzeigen
vintegererforderlich
wsRecord<string, string[]>erforderlich
  • ws.owner

    Owner of the workspace, with every permission, including deleting the workspace and managing owners.

  • ws.admin

    Administrator of the workspace, with every permission except managing owners and deleting the workspace or its files.

  • ws.member

    Member of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.

  • ws.viewer

    Viewer of the workspace, a role that grants no permission.

  • ws.support

    Sway support access, granted when you invite the Sway bot.

  • ba.owner

    Owner of the billing account, with every permission, including deleting it.

  • ba.admin

    Administrator of the billing account, who reads and updates it but cannot delete it.

  • ba.member

    Member of the billing account, who can only read it.

baRecord<string, string[]>erforderlich
  • ws.owner

    Owner of the workspace, with every permission, including deleting the workspace and managing owners.

  • ws.admin

    Administrator of the workspace, with every permission except managing owners and deleting the workspace or its files.

  • ws.member

    Member of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.

  • ws.viewer

    Viewer of the workspace, a role that grants no permission.

  • ws.support

    Sway support access, granted when you invite the Sway bot.

  • ba.owner

    Owner of the billing account, with every permission, including deleting it.

  • ba.admin

    Administrator of the billing account, who reads and updates it but cannot delete it.

  • ba.member

    Member of the billing account, who can only read it.

curl 'https://api.business.swayapp.io/v1/users/me/permissions' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": {
    "v": 0,
    "ws": {
      "key": [
        "ws.owner"
      ]
    },
    "ba": {
      "key": [
        "ws.owner"
      ]
    }
  }
}

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.