Company Management

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

MethodEndpointDescription
GET/api/public-v1/companyGet all companies
POST/api/public-v1/companyCreate 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-deleteDelete 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

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination (default: 1)
limitintegerNoNumber of companies per page (default: 50)
searchstringNoSearch term for company name or domain
sortstringNoSort field (name, domain, created_at)
orderstringNoSort order (asc or desc)
industrystringNoFilter by industry
statusstringNoFilter 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

FieldTypeRequiredDescription
namestringYesCompany name (max 191 characters)
emailstringYesCompany email (must be unique)
phone_numberstringNoCompany phone number
websitestringNoCompany website URL (max 191 characters)
c_sizeintegerNoCompany size ID (numeric)
c_typeintegerNoCompany/Industry type ID (numeric)
country_idintegerNoCountry ID
state_idintegerNoState/Province ID
city_idintegerNoCity ID
addressstringNoCompany 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

ParameterTypeRequiredDescription
idintegerYesCompany 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

ParameterTypeRequiredDescription
idintegerYesCompany ID to update

Request Body

FieldTypeRequiredDescription
namestringYesCompany name (max 191 characters)
emailstringYesCompany email (must be unique, except for current company)
phone_numberstringNoCompany phone number
websitestringNoCompany website URL (max 191 characters)
c_sizeintegerNoCompany size ID (numeric)
c_typeintegerNoCompany/Industry type ID (numeric)
country_idintegerNoCountry ID
state_idintegerNoState/Province ID
city_idintegerNoCity ID
addressstringNoCompany 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

ParameterTypeRequiredDescription
idintegerYesCompany 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

FieldTypeRequiredDescription
idsarrayYesArray of company IDs to delete
ids.*integerYesEach 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 CodeError TypeDescription
400Bad RequestInvalid request data or missing required fields
401UnauthorizedInvalid or missing X-Secret-Key
404Not FoundCompany not found
409ConflictCompany name or domain already exists
422Validation ErrorRequest data failed validation
429Too Many RequestsRate 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

  1. Use consistent naming: Keep company names consistent across your CRM
  2. Verify domains: Ensure company domains are valid and unique
  3. Industry categorization: Use standardized industry categories for better filtering
  4. Complete profiles: Add as much company information as possible for better CRM insights

Data Management

  1. Regular updates: Keep company information current
  2. Bulk operations: Use bulk delete for efficient data management
  3. Associated data: Consider associated contacts and projects before deletion
  4. 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.