Make sure you have CompanyFlow running locally or have access to a deployed instance. See the Installation guide if you need to set up the server first.
Step 1: Verify the Server is Running
First, check that the CompanyFlow server is healthy and accessible:ok response. The server runs on port 8080 by default, or the port specified in your PORT environment variable.
Step 2: Explore the API Documentation
CompanyFlow provides interactive Swagger documentation. Open your browser and navigate to:Step 3: Authenticate
All protected endpoints in CompanyFlow require JWT authentication. To get started, you’ll need to log in with valid employee credentials.Login Request
The login endpoint is located at/auth/login and accepts the following payload:
Login Response
On successful authentication, you’ll receive a response containing:token: JWT token for authenticating subsequent requestsrole: The employee’s role in the systememployee: Basic employee profile informationcompany: The company (tenant) the employee belongs to
Step 4: Make an Authenticated Request
Now that you have a JWT token, you can make authenticated requests to protected endpoints. Include the token in theAuthorization header with the Bearer prefix.
Example: Get Company Information
Example Response
Step 5: List Companies with Pagination
CompanyFlow supports pagination for list endpoints. Here’s how to retrieve a paginated list of companies:Query Parameters
page: Page number (default: 1)page_size: Number of items per page (default: 10)status: Filter by company status (optional)search: Search by company name or slug (optional)
Paginated Response
Common API Response Structure
All CompanyFlow API responses follow a consistent structure:Success Response
Error Response
HTTP Status Codes
CompanyFlow uses standard HTTP status codes:200 OK: Request succeeded201 Created: Resource created successfully400 Bad Request: Invalid request body or parameters401 Unauthorized: Missing or invalid authentication token404 Not Found: Resource not found500 Internal Server Error: Server error occurred
Next Steps
Authentication Guide
Learn more about JWT authentication and security
API Reference
Explore all available endpoints and their schemas
Employee Management
Manage employee records and bulk uploads
Leave Management
Handle leave requests and approvals