Skip to main content

Create Customer

Create a new customer.

Endpoint

POST /api/customers

Request

POST https://app.getmanageit.io/api/customers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request Body

The request should be sent as multipart/form-data with the following structure:

email: [email protected]
name: Test
last_name: Test
phone: "654645654654"
"custom_fields[2][key]": new 2
"custom_fields[2][cust]": new 1
"business_information[company_name]": "111"
"custom_fields[2][file_upload][formats][]": jpg
"permissions[invoice][view-invoice]": "1"
"permissions[contract][view-contract]": "1"
"permissions[invoice][create-invoice]": "1"
profile_photo_path: string
"custom_fields[2][file_upload][files][]": string

Sample JSON Payload

While the API uses multipart/form-data, here's what the equivalent JSON structure would look like for reference:

Basic Customer Creation

{
"email": "[email protected]",
"name": "John",
"last_name": "Doe",
"phone": "555-123-4567",
"business_information": {
"company_name": "Acme Corp"
},
"permissions": {
"invoice": {
"view-invoice": "1",
"create-invoice": "1"
},
"contract": {
"view-contract": "1"
}
}
}

Customer with Custom Fields

{
"email": "[email protected]",
"name": "Jane",
"last_name": "Smith",
"phone": "555-987-6543",
"business_information": {
"company_name": "Tech Solutions Inc"
},
"permissions": {
"invoice": {
"view-invoice": "1",
"create-invoice": "1",
"edit-invoice": "1"
},
"contract": {
"view-contract": "1",
"create-contract": "1"
},
"proposal": {
"view-proposal": "1"
}
},
"custom_fields": {
"52": {
"key": "search_test",
"value": "Engineering Department"
},
"68": {
"key": "birthday",
"value": "January"
},
"54": {
"key": "q",
"value": "Important client notes"
}
}
}

Customer with File Upload Fields

{
"email": "[email protected]",
"name": "Mike",
"last_name": "Wilson",
"phone": "555-456-7890",
"business_information": {
"company_name": "Design Studio"
},
"permissions": {
"invoice": {
"view-invoice": "1",
"create-invoice": "1"
},
"contract": {
"view-contract": "1"
}
},
"custom_fields": {
"55": {
"key": "jpg",
"file_upload": {
"formats": ["DOCX", "DOC"],
"files": ["contract.pdf", "proposal.docx"]
}
}
}
}

Note: These JSON examples are for reference only. The actual API requires multipart/form-data format.

Request Parameters

ParameterTypeRequiredDescription
emailstringYesCustomer's email address
namestringYesCustomer's first name
last_namestringYesCustomer's last name
phonestringYesCustomer's phone number
business_information[company_name]stringYesCompany name
profile_photo_pathstring(binary)YesProfile photo file
custom_fields[N][key]stringNoCustom field key (N = field ID)
custom_fields[N][value]stringNoCustom field value
custom_fields[N][file_upload][formats][]stringNoAllowed file formats for file fields
custom_fields[N][file_upload][files][]string(binary)NoFile upload for file fields
permissions[module][permission]stringYesModule-specific permissions

Permissions System

The permissions system controls what modules and actions a customer can access. All permissions are required and must be set to "1" to grant access.

Permission Structure

permissions[MODULE][ACTION] = "1"

Available Modules and Actions

ModuleAvailable ActionsDescription
invoiceview-invoice, create-invoice, edit-invoice, delete-invoiceInvoice management permissions
contractview-contract, create-contract, edit-contract, delete-contractContract management permissions
proposalview-proposal, create-proposal, edit-proposal, delete-proposalProposal management permissions
meetingview-meeting, create-meeting, edit-meeting, delete-meetingMeeting management permissions

Required Permissions Example

# Minimum required permissions for basic access
-F "permissions[invoice][view-invoice]=1"
-F "permissions[contract][view-contract]=1"
-F "permissions[invoice][create-invoice]=1"

Full Permissions Example

# Grant all permissions
-F "permissions[invoice][view-invoice]=1"
-F "permissions[invoice][create-invoice]=1"
-F "permissions[invoice][edit-invoice]=1"
-F "permissions[invoice][delete-invoice]=1"
-F "permissions[contract][view-contract]=1"
-F "permissions[contract][create-contract]=1"
-F "permissions[contract][edit-contract]=1"
-F "permissions[contract][delete-contract]=1"
-F "permissions[proposal][view-proposal]=1"
-F "permissions[proposal][create-proposal]=1"
-F "permissions[proposal][edit-proposal]=1"
-F "permissions[proposal][delete-proposal]=1"
-F "permissions[meeting][view-meeting]=1"
-F "permissions[meeting][create-meeting]=1"
-F "permissions[meeting][edit-meeting]=1"
-F "permissions[meeting][delete-meeting]=1"

Custom Fields System

Custom fields are dynamically configured by each user and vary significantly between accounts. The field structure depends on how the user has set up their custom fields in their account settings.

Custom Field Structure

custom_fields[FIELD_ID][PROPERTY] = VALUE

Field Types and Their Properties

Field TypeType IDPropertiesExample
Text Field1key, valuecustom_fields[52][key]=department
custom_fields[52][value]=Engineering
Select Dropdown5key, valuecustom_fields[68][key]=birthday
custom_fields[68][value]=January
Text Area7key, valuecustom_fields[54][key]=notes
custom_fields[54][value]=Important client
File Upload9key, file_upload[formats][], file_upload[files][]custom_fields[55][key]=documents
custom_fields[55][file_upload][formats][]=pdf
custom_fields[55][file_upload][files][][email protected]

How to Determine Field Configuration

You must first query the user's custom field configuration to know which fields are available:

  1. Get Custom Fields Configuration (separate endpoint)
  2. Identify Field IDs and Types from the configuration
  3. Use the correct structure based on field type

Custom Field Examples by Type

Text Field (Type 1)

# Single line text input
-F "custom_fields[52][key]=department"
-F "custom_fields[52][value]=Engineering"

Select Dropdown (Type 5)

# Dropdown with predefined options
-F "custom_fields[68][key]=priority"
-F "custom_fields[68][value]=high"

Text Area (Type 7)

# Multi-line text input
-F "custom_fields[54][key]=notes"
-F "custom_fields[54][value]=This is a longer description or notes about the customer"

File Upload (Type 9)

# File upload with format restrictions
-F "custom_fields[55][key]=documents"
-F "custom_fields[55][file_upload][formats][]=pdf"
-F "custom_fields[55][file_upload][formats][]=docx"
-F "custom_fields[55][file_upload][files][][email protected]"
-F "custom_fields[55][file_upload][files][][email protected]"

Important Notes About Custom Fields

  1. Field IDs are unique per user account - The same field might have different IDs for different users
  2. Field types determine the structure - Each type requires different properties
  3. File upload fields have restrictions - Check the fileConfig in the field configuration
  4. Some fields may be required - Check the field configuration for required status
  5. Values must match field options - For select fields, values must be from the predefined options

Getting Custom Field Configuration

Before creating a customer, you should fetch the available custom fields:

# Get custom fields configuration (example endpoint)
GET /api/custom-fields

This will return the field structure like:

{
"data": [
{
"id": 52,
"type": 1,
"name": "Department",
"key": "department",
"required": true,
"fields": {
"options": null
}
},
{
"id": 55,
"type": 9,
"name": "Documents",
"key": "documents",
"required": false,
"fields": {
"fileConfig": {
"acceptFile": ["PDF", "DOCX"],
"allowMultiple": true,
"maxFiles": 5
}
}
}
]
}

Response

{
"data": {
"id": 310,
"name": "simitri",
"last_name": "dimitri",
"phone": "555-987-6543",
"profile_photo_path": null,
"email": "[email protected]",
"stripe_customer_flag": false,
"business_information": {
"company_name": "Tech Solutions Inc",
"company_phone": "5627143119",
"company_email": null,
"company_website": null,
"address_1": null,
"address_2": null,
"country": null,
"city": null,
"state": null,
"zip_code": null,
"fax": null
},
"custom_fields": [
{
"id": 54,
"user_id": 231,
"location": 3,
"type": 7,
"name": "q",
"key": "q",
"description": null,
"placeholder": null,
"fields": {
"options": ["234"],
"fileConfig": null
},
"group": "c5cd8947-93a8-4f22-bfed-d7dc45657afb",
"created_at": "2025-07-29T12:32:45.000000Z",
"updated_at": "2025-07-29T12:32:45.000000Z",
"custom_field_values": [
{
"id": 136,
"owner_id": 231,
"user_id": 310,
"custom_field_id": 54,
"value": "234",
"created_at": "2025-10-01T00:40:54.000000Z",
"updated_at": "2025-10-01T00:40:54.000000Z"
}
]
}
],
"notes": [],
"activity_log": [],
"permissions": {
"4": "view-invoice",
"8": "view-contract",
"12": "view-proposal"
}
}
}

Response Fields

FieldTypeDescription
dataobjectThe created customer data
data.idintegerUnique identifier for the customer
data.namestringCustomer's first name
data.last_namestringCustomer's last name
data.phonestringCustomer's phone number
data.profile_photo_pathstring/nullURL to customer's profile photo
data.emailstringCustomer's email address
data.stripe_customer_flagbooleanWhether customer has Stripe integration
data.business_informationobjectCustomer's business details
data.custom_fieldsarrayArray of custom fields for the customer
data.notesarrayArray of notes for the customer (empty on creation)
data.activity_logarrayArray of activity log entries (empty on creation)
data.permissionsobjectCustomer's permissions for different modules

Business Information Fields

FieldTypeDescription
company_namestring/nullCompany name
company_phonestring/nullCompany phone number
company_emailstring/nullCompany email address
company_websitestring/nullCompany website URL
address_1string/nullPrimary address line
address_2string/nullSecondary address line
countrystring/nullCountry
citystring/nullCity
statestring/nullState/Province
zip_codestring/nullPostal/ZIP code
faxstring/nullFax number

Custom Fields Structure

FieldTypeDescription
idintegerUnique identifier for the custom field
user_idintegerID of the user who created the field
locationintegerField location identifier
typeintegerField type (1=text, 5=select, 7=text, 9=file)
namestringDisplay name of the field
keystringUnique key for the field
descriptionstring/nullField description
placeholderstring/nullPlaceholder text
fieldsobjectField configuration options
groupstringField group identifier
created_atdatetimeWhen the field was created
updated_atdatetimeWhen the field was last updated
custom_field_valuesarrayArray of values for this customer

Custom Field Values Structure

FieldTypeDescription
idintegerUnique identifier for the field value
owner_idintegerID of the field owner
user_idintegerID of the customer
custom_field_idintegerID of the custom field
valuemixedThe field value (string, array, etc.)
created_atdatetimeWhen the value was created
updated_atdatetimeWhen the value was last updated

Permissions Structure

The permissions object contains key-value pairs where:

  • Key: Permission ID (integer as string)
  • Value: Permission name (string)

Common permissions include:

  • "4": "view-invoice"
  • "8": "view-contract"
  • "12": "view-proposal"
  • "16": "view-meeting"

Status Codes

CodeDescription
201Created
400Bad Request
401Unauthorized
422Validation Error
500Server Error