Skip to main content
POST
/
api
/
adm
/
companies
Create Company
curl --request POST \
  --url https://localhost:44371/api/adm/companies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Description

Creates a new company entity with the specified name, billing address, and configuration settings. This is typically the first step when onboarding a new customer organization.

Input

  • Body: model (CompanyCreateCommandRequest, required) — Company details including:
    • name (string, required) — Unique company name.
    • billingAddress (object, optional) — Street, city, state, and zip code.
    • contactEmail (string, optional) — Primary contact email.
    • contactPhone (string, optional) — Primary contact phone.
    • isActive (bool, optional) — Active status (default: true).

Output

Returns a CompanyCreateCommandResponse containing the ID of the newly created company.

Example Request

POST /api/admin/companies
Content-Type: application/json
Authorization: Bearer {token}

{
  "name": "Acme Corporation",
  "billingAddress": {
    "street": "123 Main St",
    "city": "New York",
    "state": "NY",
    "zipCode": "10001"
  },
  "contactEmail": "[email protected]",
  "contactPhone": "555-0100",
  "isActive": true
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Errors

  • 400 Bad Request — Missing required fields, validation errors, duplicate company name, or field exceeds maximum length.

Notes

  • Company name must be unique across the entire platform.
  • After creating a company, use CompanyProjectController to create projects and UserInvitationController to invite users.
  • New companies are created in active status by default unless explicitly set to inactive.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

The company creation request containing name, address, contact information, and settings.

Base structure for command requests that modify data. Represents a request to create a new company entry. Submitted to company administration controllers when onboarding a new organization in the portal.

companyName
string
required

Company Name

Maximum string length: 50
addressLine1
string | null

Address 1

Maximum string length: 150
addressLine2
string | null

Address 2

Maximum string length: 150
city
string | null

City

Maximum string length: 150
state
string | null

State

Maximum string length: 50
zip
string | null

Zip

Maximum string length: 15
phoneNumber
string | null

Phone Number

Maximum string length: 7
phoneArea
string | null

Phone Area Code

Maximum string length: 3
phoneExtension
string | null

Phone Extension

Maximum string length: 6
createdByUserId
string<guid> | null

The identifier of the user that created the company. Captures the administrative user responsible for onboarding to aid audit trails.

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Create response containing the identifier of the newly created entity. Represents the response returned after creating a company entry. Conveys success metadata and identifiers back to the administrative client after creation.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null

id
string<guid>

Unique identifier of the newly created entity.

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"