Skip to content

Users

Login user

POST/users/login

Authenticate a user with email and password. Returns an access token and the resolved user profile for the current brand or white-label origin.

Body parameters

emailstring<email>required
passwordstringrequired
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.login({
  email: "string",
  password: "string"
});

console.log(response);

Returns

idstring
Other parameters
user_idstring
ttlnumber
scopestringnullable
created_atstring<date-time>
impersonator_user_idstringnullable
updated_atstring<date-time>
userobject
redirect_originstringnullable
json
{
  "id": "string",
  "user_id": "string",
  "ttl": 31536000,
  "scope": "string",
  "created_at": "2025-01-15T10:30:00.000Z",
  "impersonator_user_id": "string",
  "updated_at": "2025-01-15T10:30:00.000Z",
  "user": {
    "id": "string",
    "email": "string",
    "name": "string",
    "email_verified": true,
    "account_id": "string",
    "settings": "string",
    "metadata": "string",
    "created_at": "2025-01-15T10:30:00.000Z",
    "updated_at": "2025-01-15T10:30:00.000Z"
  },
  "redirect_origin": "string"
}

Create user

POST/users/signup

Create a new user account. For regular main-app signups this provisions an initial account membership unless a valid account invitation token joins the user to an existing account. White-label signups remain entity-user signups and ignore account invitation tokens.

Body parameters

emailstring<email>required
passwordstringrequired
Other parameters
namestringoptionalnullable
settingsstringoptionalnullable
metadataobjectoptionalnullable
company_namestringoptional
account_invitation_tokenstringoptional
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.signup({
  email: "string",
  name: "string",
  password: "string",
  settings: "string",
  metadata: {},
  company_name: "string",
  account_invitation_token: "string"
});

console.log(response);

Returns

idstring
Other parameters
emailstring
namestringnullable
email_verifiedboolean
account_idstringnullable
settingsstringnullable
metadataobjectnullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "string",
  "email": "string",
  "name": "string",
  "email_verified": true,
  "account_id": "string",
  "settings": "string",
  "metadata": {},
  "created_at": "2025-01-15T10:30:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z"
}

Request password reset

POST/users/password-reset

Request a password reset email. Always returns success to avoid email enumeration.

Body parameters

emailstring<email>required
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.requestPasswordReset({
  email: "string"
});

console.log(response);

Returns

messagestring
json
{
  "message": "string"
}

Confirm password reset

POST/users/password-reset/confirm

Reset a user password with a valid password reset token.

Body parameters

tokenstringrequired
passwordstringrequired
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.confirmPasswordReset({
  token: "string",
  password: "string"
});

console.log(response);

Returns

messagestring
json
{
  "message": "string"
}

Request account deletion

POST/users/me/account-deletion

Immediately disables login and records a request to erase personal data that is not subject to statutory retention. Invoices and accounting records remain for the legally required period. Sign in with Apple authorization is revoked when a revocation token is available; provider failures are queued for retry without blocking the deletion request.

Returns

requested_atstring<date-time>
retention_noticestring
json
{
  "requested_at": "2025-01-15T10:30:00.000Z",
  "retention_notice": "string"
}

List current user accounts

GET/users/me/accounts

Return the accounts the authenticated user belongs to, including display names and account-level roles.

Returns

dataarray of objects
json
{
  "data": [
    {
      "id": "acc_123",
      "name": "Space Invoices",
      "role": "owner"
    },
    {
      "id": "acc_456",
      "name": "Apollo",
      "role": "member"
    }
  ]
}

Get current user

GET/users/me

Retrieve the authenticated user's profile information. Returns the user details associated with the provided Bearer token.

Returns

idstring
Other parameters
emailstring
namestringnullable
email_verifiedboolean
account_idstringnullable
settingsstringnullable
metadatastringnullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "6595a27b5d35015c3ef0c3fd",
  "email": "example@spaceinvoices.com",
  "email_verified": false,
  "name": null,
  "account_id": null,
  "metadata": {},
  "settings": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z"
}

Update current user

PATCH/users/me

Update the authenticated user's profile. Currently supports updating the display name and preferred UI language (locale).

Body parameters

namestringoptionalnullable
localestringoptionalnullable
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.update({
  locale: "sl"
});

console.log(response);

Returns

idstring
Other parameters
emailstring
namestringnullable
email_verifiedboolean
account_idstringnullable
settingsstringnullable
metadatastringnullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "6595a27b5d35015c3ef0c3fd",
  "email": "example@spaceinvoices.com",
  "email_verified": false,
  "name": null,
  "account_id": null,
  "metadata": {},
  "settings": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z"
}

Update user FURS operator settings

PUT/users/me/settings/furs

Update FURS operator settings (tax number, label) for the current user. Settings are stored per-entity using the x-entity-id header. These settings are used when the user creates invoices through the web interface.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

operator_tax_numberstringoptional
operator_labelstringoptional
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.updateFursSettings({
  operator_tax_number: "12345678",
  operator_label: "Alex Carter"
});

console.log(response);

Returns

idstring
Other parameters
emailstring
namestringnullable
email_verifiedboolean
account_idstringnullable
settingsstringnullable
metadatastringnullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "6595a27b5d35015c3ef0c3fd",
  "email": "example@spaceinvoices.com",
  "email_verified": false,
  "name": null,
  "account_id": null,
  "metadata": {},
  "settings": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z"
}

Update user FINA operator settings

PUT/users/me/settings/fina

Update FINA operator settings (OIB, label) for the current user. Settings are stored per-entity using the x-entity-id header. These settings are used when the user creates invoices through the web interface.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

operator_oibstringoptional
operator_labelstringoptional
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.updateFinaSettings({
  operator_oib: "12345678901",
  operator_label: "Ivan Horvat"
});

console.log(response);

Returns

idstring
Other parameters
emailstring
namestringnullable
email_verifiedboolean
account_idstringnullable
settingsstringnullable
metadatastringnullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "6595a27b5d35015c3ef0c3fd",
  "email": "example@spaceinvoices.com",
  "email_verified": false,
  "name": null,
  "account_id": null,
  "metadata": {},
  "settings": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z"
}

Update user Portugal operator settings

PUT/users/me/settings/pt

Update PT operator snapshot settings for the current user. Settings are stored per-entity using the x-entity-id header and used to auto-fill PT operator fields when the user creates PT documents.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

operator_first_namestringoptional
operator_last_namestringoptional
operator_tax_numberstringoptional
account_first_namestringoptional
account_last_namestringoptional
account_tax_numberstringoptional
import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.users.updatePtSettings({
  account_first_name: "Joao",
  account_last_name: "Silva",
  account_tax_number: "123456789"
});

console.log(response);

Returns

idstring
Other parameters
emailstring
namestringnullable
email_verifiedboolean
account_idstringnullable
settingsstringnullable
metadatastringnullable
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "6595a27b5d35015c3ef0c3fd",
  "email": "example@spaceinvoices.com",
  "email_verified": false,
  "name": null,
  "account_id": null,
  "metadata": {},
  "settings": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z"
}