| Méthode | Chemin | Résumé |
|---|---|---|
| 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 |
Les chemins commencent par /users. Les endpoints GET demandent users:read, les autres users:write.
L’objet User
firestoreIdstringobligatoireID of the user.
firstNamestringlastNamestringdisplayNamestringemailstringemailobligatoirestatusstringobligatoireStatus of the user account.
registeredThe user has signed up.
phonestringAfficher les 15 champsMasquer la liste des champs
birthdatestringpositionstringPosition of the user in the company.
ceoChief executive officer.
cfoChief financial officer.
otherCLevelAnother C-level executive.
businessAdministrativeBusiness or administrative staff.
accountantAccountant.
otherAnother position.
photoUrlstringurilocalestringcreationobjectobligatoireWhen 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.
activationobjectobligatoireWhether the resource is enabled, and when and by whom it was last enabled or disabled.
Afficher les 3 champs enfants
enabledbooleanobligatoireWhether the resource is enabled.
updateDateTimestringdate-timeobligatoireDate and time when enabled was last set.
updatedBystringID of the user who last set enabled, when recorded.
notificationsobjectAfficher les 2 champs enfants
defaultsRecord<string, object>Afficher les 2 champs enfants
emailbooleanobligatoirepushbooleanobligatoireworkspacesRecord<string, object>Afficher les 2 champs enfants
modestringobligatoireHow 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>Afficher les 2 champs enfants
emailbooleanobligatoirepushbooleanobligatoirerelationshipsobjectobligatoireAfficher 1 champ enfant
lastAcceptedAgreementsRecord<string, object>obligatoireAfficher les 5 champs enfants
firestoreIdstringobligatoireID of the agreement.
userIdstringobligatoireID of the user.
acceptanceDateTimestringdate-timeobligatoirerevisionnumberobligatoiretypestringobligatoireLegal 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
Portéeusers:read
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
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
Portéeusers:write
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
firstNamestringlastNamestringpositionstringPosition of the user in the company.
ceoChief executive officer.
cfoChief financial officer.
otherCLevelAnother C-level executive.
businessAdministrativeBusiness or administrative staff.
accountantAccountant.
otherAnother position.
birthdatestringphonestringlocalestringRenvoie
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
Portéeusers:read
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
dataUserPermissionsobligatoireAfficher les 3 champs enfants
vintegerobligatoirewsRecord<string, string[]>obligatoirews.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[]>obligatoirews.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"
}
}