RahalCorporate
CompanyReference

Company Reference

Complete reference for company fields and configuration options

Company Reference

This reference documents all company fields, settings, and configuration options.

Company Fields

Basic Information

FieldTypeRequiredMax LengthDescription
nameStringYes200Company display name
slugStringYes100URL-friendly unique identifier
verifiedDomainsString[]YesEmail domains for user matching
allowAutoSignupBooleanNoAuto-activate users (default: true)
isActiveBooleanNoCompany operational status (default: true)

Booking Engine Configuration

FieldTypeRequiredMax LengthDescription
bookingEngineClientIdStringNo255OAuth client identifier
bookingEngineClientSecretStringNo255OAuth client secret (encrypted)
bookingEngineScopesStringNo500Space-separated OAuth scopes
bookingEngineBaseUrlStringNo500API base URL (must be valid URL)
bookingEngineTokenUrlStringNo500Token endpoint URL (must be valid URL)

System Fields

FieldTypeDescription
idStringUnique identifier (CUID)
createdAtDateTimeCreation timestamp
updatedAtDateTimeLast update timestamp
deletedAtDateTimeSoft delete timestamp (null if not deleted)

Field Validations

Slug Format

The slug must use lowercase letters, numbers, and hyphens only.

ExampleValid?Notes
acmeSimple slug
acme-corpHyphen separator
global-travel-incMultiple hyphens
company123Numbers allowed
AcmeUppercase not allowed
acme_corpUnderscores not allowed
acme corpSpaces not allowed
-acmeCannot start with hyphen

URL Format

Booking engine URLs must be valid HTTP/HTTPS URLs.

ExampleValid?Notes
https://api.supplier.comStandard HTTPS URL
https://api.supplier.com/v1With path
http://localhost:3000For development
api.supplier.comMissing protocol
ftp://api.supplier.comWrong protocol
https://Incomplete URL

Domain Format

Verified domains should be valid domain names without the @ symbol:

Valid examples:

  • acme.com
  • acme.co.uk
  • sub.acme.com

Invalid examples:

  • @acme.com (includes @ symbol)
  • acme (missing TLD)
  • http://acme.com (includes protocol)

Default Values

FieldDefault Value
allowAutoSignuptrue
isActivetrue
verifiedDomains[] (empty array)
bookingEngineClientIdnull
bookingEngineClientSecretnull
bookingEngineScopesnull
bookingEngineBaseUrlnull
bookingEngineTokenUrlnull

Company Relationships

RelationshipTypeDescription
companyUsersOne-to-ManyUser memberships in this company
companyRolesOne-to-ManyRoles defined for this company
policiesOne-to-ManyTravel policies for this company
budgetsOne-to-ManyBudget configurations
costCentersOne-to-ManyOrganizational cost centers
bookingRequestsOne-to-ManyBooking requests from users
ordersOne-to-ManyCompleted bookings
userDelegationsOne-to-ManyDelegation relationships
budgetSettingsOne-to-OneCompany-wide budget settings

Automatic Behaviors

On Company Creation

When a new company is created:

  1. Predefined Roles — Three roles are automatically created:

    • Member (basic permissions)
    • Manager (oversight permissions)
    • Admin (full permissions)
  2. Default Settings — Company starts with:

    • Active status
    • Auto-signup enabled
    • No booking engine configuration

On Company Deletion

When a company is soft-deleted:

  1. deletedAt timestamp is set
  2. Company excluded from normal queries
  3. All users lose access
  4. Data preserved for potential recovery

Security

Credential Protection

When viewing company details, the booking engine client secret is never displayed. Instead, a hasConfiguredCredentials indicator shows whether credentials have been set.

The booking engine client secret is never shown after being saved. Keep a secure backup of your credentials.

Status Reference

Company Status

StatusisActivedeletedAtUser Access
ActivetruenullFull access
InactivefalsenullBlocked
DeletedSetBlocked

Status Transitions

Error Codes

ErrorDescriptionResolution
SLUG_EXISTSSlug already used by another companyUse a different slug
COMPANY_NOT_FOUNDCompany ID doesn't existCheck company ID
DOMAIN_ALREADY_CLAIMEDDomain belongs to another companyContact platform admin
INVALID_URLURL format is incorrectUse valid HTTP/HTTPS URL
INVALID_DOMAINDomain format is incorrectUse domain without @ or protocol
COMPANY_INACTIVECompany is deactivatedActivate the company
COMPANY_DELETEDCompany was deletedContact platform admin

Query Filters

Available Filters

FilterTypeDescription
searchStringSearch by name or slug
isActiveBooleanFilter by active status
allowAutoSignupBooleanFilter by auto-signup setting
createdAtFromDateTimeCreated after date
createdAtToDateTimeCreated before date

Sort Options

FieldDescription
createdAtSort by creation date
nameSort alphabetically
isActiveSort by status

On this page