Company Management
This documentation provides details for the API endpoints that allow managing companies in the system.
Get Companies
GET
api/companies
Description:
Returns a list of companies created by the authenticated company.
Request Headers:
Authorization
Bearer token for API access
string
Yes
Content-Type
Must be set to application/json
string
Yes
Response:
200 OK:
Create a New Company
POST /api/companies
Description:
Creates a new company under the authenticated company.
Request Headers:
Authorization
Bearer Token
The token used for authenticating the request.
Content-Type
string
Must be set to application/json
.
Request Body:
name
The name of the company.
string
Yes
"New Company"
address
The company's address.
string
No
"1234 Main St."
phone
The company's phone number.
string
No
"1234567890"
registration_id
The company's registration ID.
string
No
"REG123456"
first_name
First name of the super admin.
string
Yes
"John"
last_name
Last name of the super admin.
string
Yes
"Doe"
personal_email
Super admin's personal email (must be unique).
string
Yes
"john.doe@example.com"
title
The title of the super admin.
string
Yes
"CEO"
domain_name
Unique domain name for the company.
string
Yes
"newcompany.com"
email_template
Email template to be used.
string
Yes
"default_template"
payment_frequency
The payment frequency (one of: weekly, bi-weekly, monthly).
string
Yes
"monthly"
Response:
Get Company Details
GET /api/companies/{id}
Description:
Retrieves details of a specific company created by the authenticated company.
Request Headers:
Authorization
Bearer Token
The token used for authenticating the request.
Request Parameters:
id
Integer
The ID of the company to retrieve.
Response:
Update a Company
PUT /api/companies/{id}
Description:
Updates the details of a specific company created by the authenticated company.
Request Headers:
Authorization
Bearer Token
The token used for authenticating the request.
Content-Type
string
Must be set to application/json
.
Request Parameters:
id
Integer
The ID of the company to update.
Request Body:
name
The name of the company.
string
No
"Updated Company Name"
address
The company's address.
string
No
"Updated Address"
phone
The company's phone number.
string
No
"1234567890"
registration_id
The company's registration ID (must be unique).
string
No
"REG123456"
email_template
Email template to be used.
string
No
"new_template"
code
The company code.
string
No
"UCN01"
domain
The company's domain name.
string
No
"updatedcompany.com"
payment_frequency
The payment frequency (one of: weekly, bi-weekly, monthly).
string
No
"weekly"
Response:
OK:
Deactivate a Company
PATCH /api/companies/{id}/deactivate
Description:
Deactivates a company, making it inactive and revoking API access.
Request Headers:
Authorization
Bearer Token
The token used for authenticating the request.
Request Parameters:
id
Integer
The ID of the company to deactivate.
Response:
Activate a Company
PATCH /api/companies/{id}/activate
Description:
Activates a company, making it active and restoring API access.
Request Headers:
Authorization
Bearer Token
The token used for authenticating the request.
Request Parameters:
id
Integer
The ID of the company to activate.
Response:
OK
Last updated