| Methode | Pfad | Zusammenfassung |
|---|---|---|
| GET | …/me | Get the authenticated user profile |
| PATCH | …/me | Update the authenticated user profile |
| GET | …/me/permissions | Get the permissions granted to the authenticated user |
Die Pfade beginnen mit /users. GET-Endpunkte brauchen users:read, die übrigen users:write.
Das Objekt User
firestoreIdstringerforderlichID of the user.
firstNamestringlastNamestringdisplayNamestringemailstringemailerforderlichstatusstringerforderlichStatus of the user account.
registeredThe user has signed up.
phonestringAlle 15 Felder anzeigenFeldliste ausblenden
birthdatestringpositionstringPosition of the user in the company.
ceoChief executive officer.
cfoChief financial officer.
otherCLevelAnother C-level executive.
businessAdministrativeBusiness or administrative staff.
accountantAccountant.
otherAnother position.
photoUrlstringurilocalestringcreationobjecterforderlichWhen 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.
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.
notificationsobject2 untergeordnete Felder anzeigen
defaultsRecord<string, object>2 untergeordnete Felder anzeigen
emailbooleanerforderlichpushbooleanerforderlichworkspacesRecord<string, object>2 untergeordnete Felder anzeigen
modestringerforderlichHow the user receives the notifications of the workspace.
defaultThe workspace follows the default notification settings of the user.
customThe workspace follows its own notification settings, in
custom.mutedThe user receives no notification for the workspace.
customRecord<string, object>2 untergeordnete Felder anzeigen
emailbooleanerforderlichpushbooleanerforderlichrelationshipsobjecterforderlich1 untergeordnetes Feld anzeigen
lastAcceptedAgreementsRecord<string, object>erforderlich5 untergeordnete Felder anzeigen
firestoreIdstringerforderlichID of the agreement.
userIdstringerforderlichID of the user.
acceptanceDateTimestringdate-timeerforderlichrevisionnumbererforderlichtypestringerforderlichLegal document of Sway that the user accepts.
termsAndConditionsTerms and conditions of Sway.
privacyPolicyPrivacy policy of Sway.
cookiePolicyCookie policy of Sway.
{
"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"
}
}
}
}/users/meGet the authenticated user profile
Bereichusers: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/users/me' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/users/me', {
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/users/me",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"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": {…}
}
}{
"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"
}
}/users/meUpdate the authenticated user profile
Bereichusers: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
firstNamestringlastNamestringpositionstringPosition of the user in the company.
ceoChief executive officer.
cfoChief financial officer.
otherCLevelAnother C-level executive.
businessAdministrativeBusiness or administrative staff.
accountantAccountant.
otherAnother position.
birthdatestringphonestringlocalestringRückgabe
Successful response
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"
}'const response = await fetch('https://api.business.swayapp.io/v1/users/me', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"position": "ceo",
"birthdate": "1990-05-14",
"phone": "+41791234567"
}),
});
console.log(await response.json());import os
import requests
response = requests.patch(
"https://api.business.swayapp.io/v1/users/me",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"position": "ceo",
"birthdate": "1990-05-14",
"phone": "+41791234567",
},
)
print(response.json()){
"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": {…}
}
}{
"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"
}
}/users/me/permissionsGet the permissions granted to the authenticated user
Bereichusers: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
dataUserPermissionserforderlich3 untergeordnete Felder anzeigen
vintegererforderlichwsRecord<string, string[]>erforderlichws.ownerOwner of the workspace, with every permission, including deleting the workspace and managing owners.
ws.adminAdministrator of the workspace, with every permission except managing owners and deleting the workspace or its files.
ws.memberMember of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.
ws.viewerViewer of the workspace, a role that grants no permission.
ws.supportSway support access, granted when you invite the Sway bot.
ba.ownerOwner of the billing account, with every permission, including deleting it.
ba.adminAdministrator of the billing account, who reads and updates it but cannot delete it.
ba.memberMember of the billing account, who can only read it.
baRecord<string, string[]>erforderlichws.ownerOwner of the workspace, with every permission, including deleting the workspace and managing owners.
ws.adminAdministrator of the workspace, with every permission except managing owners and deleting the workspace or its files.
ws.memberMember of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.
ws.viewerViewer of the workspace, a role that grants no permission.
ws.supportSway support access, granted when you invite the Sway bot.
ba.ownerOwner of the billing account, with every permission, including deleting it.
ba.adminAdministrator of the billing account, who reads and updates it but cannot delete it.
ba.memberMember 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"const response = await fetch('https://api.business.swayapp.io/v1/users/me/permissions', {
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/users/me/permissions",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"data": {
"v": 0,
"ws": {
"key": [
"ws.owner"
]
},
"ba": {
"key": [
"ws.owner"
]
}
}
}{
"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"
}
}