Skip to content

Upsert company membership

POST
/internal/companies/{companyId}/memberships

PLATFORM_ADMIN / PLATFORM_SUPERADMIN, or company ADMIN/FINANCE/TENANT_SUPERADMIN in this company. PLATFORM_MODERATOR is not allowed. Company role MANAGER requires at least one active business unit membership for this user in this company (assign BU membership first). FINANCE does not require a BU membership.

companyId
required
string format: uuid
object
userId
required
string format: uuid
role
required
string
Allowed values: TENANT_SUPERADMIN ADMIN FINANCE MANAGER SUBMITTER
isActive
boolean
default: true
approvalLimit

Optional decimal string; omit to leave existing value unchanged on upsert

string
nullable
metadata

Optional JSON; omit to leave existing company metadata unchanged on upsert (see README_AUTH_API.md).

nullable

Membership saved

object
success
required
boolean
data
required
data
object
id
string format: uuid
userId
string format: uuid
companyId
string format: uuid
role
string
Allowed values: TENANT_SUPERADMIN ADMIN FINANCE MANAGER SUBMITTER
isActive
boolean
approvalLimit
string
nullable
invoiceViewScope
string
nullable
canEditOthersScope
string
nullable
canEditOthersInvoices
boolean
nullable
metadata

Optional JSON; echoed from company_memberships.metadata.

nullable

Validation error

object
success
required
boolean
error
required
object
code
required
string
Example
validation_error
message
required
string

Missing/invalid token or credentials

object
success
required
boolean
error
required
object
code
required
string
Example
validation_error
message
required
string

Authenticated but not allowed (e.g. wrong role or invalid internal key)

object
success
required
boolean
error
required
object
code
required
string
Example
validation_error
message
required
string