Upsert company membership
POST /internal/companies/{companyId}/memberships
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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” companyId
required
string format: uuid
Request Body required
Section titled “Request Body required ”object
userId
required
string format: uuid
role
required
string
isActive
boolean
approvalLimit
Optional decimal string; omit to leave existing value unchanged on upsert
string
metadata
Optional JSON; omit to leave existing company metadata unchanged on upsert (see README_AUTH_API.md).
Responses
Section titled “ Responses ”Membership saved
object
success
required
boolean
data
required
data
object
id
string format: uuid
userId
string format: uuid
companyId
string format: uuid
role
string
isActive
boolean
approvalLimit
string
invoiceViewScope
string
canEditOthersScope
string
canEditOthersInvoices
boolean
metadata
Optional JSON; echoed from company_memberships.metadata.
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