Company Management API
The Company Management API allows you to manage companies in your TaskIP CRM system. You can create, read, update, and delete companies, as well as perform bulk operations.
Endpoints Overview
Method | Endpoint | Description |
---|---|---|
GET | /api/public-v1/company | Get all companies |
POST | /api/public-v1/company | Create a new company |
GET | /api/public-v1/company/{id} | Get a specific company |
PUT | /api/public-v1/company/{id} | Update a company |
DELETE | /api/public-v1/company/{id} | Delete a company |
POST | /api/public-v1/company/bulk-delete | Delete multiple companies |
Get All Companies
Retrieve a list of all companies in your system.
GET /api/public-v1/company
Request Headers
X-Secret-Key: your-secret-key-here
Content-Type: application/json
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
page | integer | No | Page number for pagination (default: 1) |
limit | integer | No | Number of companies per page (default: 50) |
search | string | No | Search term for company name or domain |
sort | string | No | Sort field (name , domain , created_at ) |
order | string | No | Sort order (asc or desc ) |
industry | string | No | Filter by industry |
status | string | No | Filter by status (active , inactive ) |
Example Request
curl -X GET "https://public-api.taskip.net/api/public-v1/company?page=1&limit=20&industry=technology" \
-H "X-Secret-Key: your-secret-key-here" \
-H "Content-Type: application/json"
JavaScript Example
const response = await fetch('https://public-api.taskip.net/api/public-v1/company?page=1&limit=20', {
method: 'GET',
headers: {
'X-Secret-Key': 'your-secret-key-here',
'Content-Type': 'application/json'
}
});
const companies = await response.json();
Example Response
{
"message": "Company list",
"data": [
{
"id": 1,
"name": "Acme Corporation",
"email": "info@acme.com",
"phone_number": "+1-555-0100",
"website": "https://www.acme.com",
"c_size": 3,
"c_type": 5,
"size": "51-200 employees",
"type": "Technology",
"country_id": 1,
"city_id": 10,
"state_id": 5,
"country": "United States",
"state": "New York",
"city": "New York City",
"address": "123 Business Street, New York, NY 10001",
"created_at": "2024-01-10T09:30:00Z",
"image": {
"id": 101,
"url": "https://cdn.taskip.net/companies/acme-logo.png",
"thumbnail": "https://cdn.taskip.net/companies/acme-logo-thumb.png"
}
},
{
"id": 2,
"name": "Tech Solutions Inc",
"email": "hello@techsolutions.com",
"phone_number": "+1-555-0101",
"website": "https://www.techsolutions.com",
"c_size": 2,
"c_type": 8,
"size": "11-50 employees",
"type": "Software",
"country_id": 1,
"city_id": 15,
"state_id": 8,
"country": "United States",
"state": "California",
"city": "San Francisco",
"address": "456 Innovation Ave, San Francisco, CA 94105",
"created_at": "2024-01-05T11:20:00Z",
"image": null
}
],
"links": {
"first": "https://public-api.taskip.net/api/public-v1/company?page=1",
"last": "https://public-api.taskip.net/api/public-v1/company?page=3",
"prev": null,
"next": "https://public-api.taskip.net/api/public-v1/company?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 3,
"path": "https://public-api.taskip.net/api/public-v1/company",
"per_page": 20,
"to": 20,
"total": 45
}
}
Create a Company
Create a new company in your system.
POST /api/public-v1/company
Request Headers
X-Secret-Key: your-secret-key-here
Content-Type: application/json
Request Body
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Company name (max 191 characters) |
email | string | Yes | Company email (must be unique) |
phone_number | string | No | Company phone number |
website | string | No | Company website URL (max 191 characters) |
c_size | integer | No | Company size ID (numeric) |
c_type | integer | No | Company/Industry type ID (numeric) |
country_id | integer | No | Country ID |
state_id | integer | No | State/Province ID |
city_id | integer | No | City ID |
address | string | No | Company address |
Example Request
curl -X POST "https://public-api.taskip.net/api/public-v1/company" \
-H "X-Secret-Key: your-secret-key-here" \
-H "Content-Type: application/json" \
-d '{
"name": "Green Energy Solutions",
"email": "contact@greenenergy.com",
"phone_number": "+1-555-0102",
"website": "https://www.greenenergy.com",
"c_size": 4,
"c_type": 12,
"country_id": 1,
"state_id": 15,
"city_id": 120,
"address": "789 Sustainability Blvd, Austin, TX 78701"
}'
Python Example
import requests
headers = {
'X-Secret-Key': 'your-secret-key-here',
'Content-Type': 'application/json'
}
company_data = {
"name": "Green Energy Solutions",
"email": "contact@greenenergy.com",
"phone_number": "+1-555-0102",
"website": "https://www.greenenergy.com",
"c_size": 4,
"c_type": 12,
"country_id": 1,
"state_id": 15,
"city_id": 120,
"address": "789 Sustainability Blvd, Austin, TX 78701"
}
response = requests.post(
'https://public-api.taskip.net/api/public-v1/company',
headers=headers,
json=company_data
)
result = response.json()
Example Response
{
"msg": "Company Created",
"data": {
"id": 46,
"name": "Green Energy Solutions",
"email": "contact@greenenergy.com",
"phone_number": "+1-555-0102",
"website": "https://www.greenenergy.com",
"c_size": 4,
"c_type": 12,
"size": "201-500 employees",
"type": "Renewable Energy",
"country_id": 1,
"city_id": 120,
"state_id": 15,
"country": "United States",
"state": "Texas",
"city": "Austin",
"address": "789 Sustainability Blvd, Austin, TX 78701",
"created_at": "2024-01-25T10:30:00Z",
"image": null
}
}
Get a Specific Company
Retrieve details of a specific company by ID.
GET /api/public-v1/company/{id}
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | integer | Yes | Company ID |
Example Request
curl -X GET "https://public-api.taskip.net/api/public-v1/company/46" \
-H "X-Secret-Key: your-secret-key-here" \
-H "Content-Type: application/json"
Example Response
{
"msg": "Company Created",
"data": {
"id": 46,
"name": "Green Energy Solutions",
"email": "contact@greenenergy.com",
"phone_number": "+1-555-0102",
"website": "https://www.greenenergy.com",
"c_size": 4,
"c_type": 12,
"size": "201-500 employees",
"type": "Renewable Energy",
"country_id": 1,
"city_id": 120,
"state_id": 15,
"country": "United States",
"state": "Texas",
"city": "Austin",
"address": "789 Sustainability Blvd, Austin, TX 78701",
"created_at": "2024-01-25T10:30:00Z",
"image": {
"id": 205,
"url": "https://cdn.taskip.net/companies/green-energy-logo.png",
"thumbnail": "https://cdn.taskip.net/companies/green-energy-logo-thumb.png"
}
}
}
Update a Company
Update an existing company's information.
PUT /api/public-v1/company/{id}
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | integer | Yes | Company ID to update |
Request Body
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Company name (max 191 characters) |
email | string | Yes | Company email (must be unique, except for current company) |
phone_number | string | No | Company phone number |
website | string | No | Company website URL (max 191 characters) |
c_size | integer | No | Company size ID (numeric) |
c_type | integer | No | Company/Industry type ID (numeric) |
country_id | integer | No | Country ID |
state_id | integer | No | State/Province ID |
city_id | integer | No | City ID |
address | string | No | Company address |
Example Request
curl -X PUT "https://public-api.taskip.net/api/public-v1/company/46" \
-H "X-Secret-Key: your-secret-key-here" \
-H "Content-Type: application/json" \
-d '{
"name": "Green Energy Solutions Updated",
"email": "info@greenenergy.com",
"phone_number": "+1-555-0103",
"c_size": 5,
"address": "789 Sustainability Blvd, Suite 200, Austin, TX 78701"
}'
Example Response
{
"msg": "Company update success"
}
Delete a Company
Delete a specific company from your system.
DELETE /api/public-v1/company/{id}
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | integer | Yes | Company ID to delete |
Warning: Deleting a company will also remove all associated contacts and projects. This action cannot be undone.
Example Request
curl -X DELETE "https://public-api.taskip.net/api/public-v1/company/46" \
-H "X-Secret-Key: your-secret-key-here"
Example Response
{
"msg": "Company Deleted"
}
Note: The response status code will be 204 No Content
.
Bulk Delete Companies
Delete multiple companies at once.
POST /api/public-v1/company/bulk-delete
Request Body
Field | Type | Required | Description |
---|---|---|---|
ids | array | Yes | Array of company IDs to delete |
ids.* | integer | Yes | Each ID must be a valid integer that exists in companies table |
Example Request
curl -X POST "https://public-api.taskip.net/api/public-v1/company/bulk-delete" \
-H "X-Secret-Key: your-secret-key-here" \
-H "Content-Type: application/json" \
-d '{
"ids": [44, 45, 47, 48]
}'
JavaScript Example
const bulkDeleteData = {
ids: [44, 45, 47, 48]
};
const response = await fetch('https://public-api.taskip.net/api/public-v1/company/bulk-delete', {
method: 'POST',
headers: {
'X-Secret-Key': 'your-secret-key-here',
'Content-Type': 'application/json'
},
body: JSON.stringify(bulkDeleteData)
});
const result = await response.json();
Example Response
{
"msg": "companies deleted."
}
Note: The response status code will be 202 Accepted
.
Error Responses
Common Error Codes
Status Code | Error Type | Description |
---|---|---|
400 | Bad Request | Invalid request data or missing required fields |
401 | Unauthorized | Invalid or missing X-Secret-Key |
404 | Not Found | Company not found |
409 | Conflict | Company name or domain already exists |
422 | Validation Error | Request data failed validation |
429 | Too Many Requests | Rate limit exceeded |
Example Error Response
{
"success": false,
"error": "Validation Error",
"message": "The given data was invalid",
"errors": {
"name": ["The name field is required."],
"email": ["The email format is invalid."],
"website": ["The website must be a valid URL."]
},
"status_code": 422
}
Response Schemas
Company Object
{
"id": "integer",
"name": "string",
"email": "string",
"phone_number": "string|null",
"website": "string|null",
"c_size": "integer|null",
"c_type": "integer|null",
"size": "string|null",
"type": "string|null",
"country_id": "integer|null",
"city_id": "integer|null",
"state_id": "integer|null",
"country": "string|null",
"state": "string|null",
"city": "string|null",
"address": "string|null",
"created_at": "string (ISO 8601)",
"image": "object|null"
}
Image Object
{
"id": "integer",
"url": "string",
"thumbnail": "string"
}
Best Practices
Company Creation
- Use consistent naming: Keep company names consistent across your CRM
- Verify domains: Ensure company domains are valid and unique
- Industry categorization: Use standardized industry categories for better filtering
- Complete profiles: Add as much company information as possible for better CRM insights
Data Management
- Regular updates: Keep company information current
- Bulk operations: Use bulk delete for efficient data management
- Associated data: Consider associated contacts and projects before deletion
- Search optimization: Use descriptive names and domains for better searchability
Tip: Use the industry filter in the GET /company endpoint to segment your companies by business sector. This is particularly useful for targeted marketing campaigns or industry-specific reporting.