# Customers Endpoints from `customers` routes module. ## List customers - [GET /v1/customers](https://timify-dev-api.redocly.app/apis/openapi/customers/getv1customers.md): List all customers ## Create customer - [POST /v1/customers](https://timify-dev-api.redocly.app/apis/openapi/customers/postv1customers.md): The customer data must be added through the payload attribute "customfields". Each kind of data associated with a customer is a custom filed. For example: firstName, lastName, email etc. You can use the endpoint GET /customers/customfields to retrieve all available custom fields for the selected company. To create a new custom field you can use the endpoint POST customers/customfields ## List custom fields - [GET /v1/customers/customfields](https://timify-dev-api.redocly.app/apis/openapi/customers/getv1customerscustomfields.md): List custom field definitions for customer records. ## Add custom field - [POST /v1/customers/customfields](https://timify-dev-api.redocly.app/apis/openapi/customers/postv1customerscustomfields.md): All new custom fields are available to all customers. ## List custom fields categories - [GET /v1/customers/customfields/categories](https://timify-dev-api.redocly.app/apis/openapi/customers/getv1customerscustomfieldscategories.md): List categories that group customer custom fields. ## Create custom fields category - [POST /v1/customers/customfields/categories](https://timify-dev-api.redocly.app/apis/openapi/customers/postv1customerscustomfieldscategories.md): Create a new custom field category. ## Delete custom field category - [DELETE /v1/customers/customfields/categories/{categoryId}](https://timify-dev-api.redocly.app/apis/openapi/customers/deletev1customerscustomfieldscategoriesbycategoryid.md): Delete a custom field category. ## Fetch custom field category - [GET /v1/customers/customfields/categories/{categoryId}](https://timify-dev-api.redocly.app/apis/openapi/customers/getv1customerscustomfieldscategoriesbycategoryid.md): Fetch a single custom field category. ## Update custom fields category - [PATCH /v1/customers/customfields/categories/{categoryId}](https://timify-dev-api.redocly.app/apis/openapi/customers/patchv1customerscustomfieldscategoriesbycategoryid.md): Update a custom field category. ## Delete resource - [DELETE /v1/customers/customfields/{fieldId}](https://timify-dev-api.redocly.app/apis/openapi/customers/deletev1customerscustomfieldsbyfieldid.md): Delete a custom field definition. ## Get resource - [GET /v1/customers/customfields/{fieldId}](https://timify-dev-api.redocly.app/apis/openapi/customers/getv1customerscustomfieldsbyfieldid.md): Fetch a single custom field definition. ## Update custom fields - [PATCH /v1/customers/customfields/{fieldId}](https://timify-dev-api.redocly.app/apis/openapi/customers/patchv1customerscustomfieldsbyfieldid.md): Each custom field is a data field for every customer. For example: firstName, lastName etc. With this endpoint, you can create your own custom fields like customerNr. ## List global customer events - [GET /v1/customers/global/{customerId}/events](https://timify-dev-api.redocly.app/apis/openapi/customers/getv1customersglobalbycustomeridevents.md): List global customer events ## Import or update customers - [POST /v1/customers/import](https://timify-dev-api.redocly.app/apis/openapi/customers/postv1customersimport.md): Bulk create or update of customers. This endpoint accepts importCustomerId as a unique identifier for the customer. If there is a customer with the importCustomerId or id then the customer is updated. ## Delete customer by ID - [DELETE /v1/customers/{customerId}](https://timify-dev-api.redocly.app/apis/openapi/customers/deletev1customersbycustomerid.md): Delete a customer with the "customerId" or "externalId" parameter ## Fetch customer - [GET /v1/customers/{customerId}](https://timify-dev-api.redocly.app/apis/openapi/customers/getv1customersbycustomerid.md): The URL parameter "customerId" can be used in two ways: - Unique ID of the customer assigned by TIMIFY ("customerId"). In this case, you don't need the QUERY parameter "external" - use the "externalId" that you added to this customer. In this case, you need to add the parameter "external" ( for ex.: /?external=1) so the api will search by your "externalId" and not by "customerId" assigned by TIMIFY You can add "externalId" to the customer with the endpoints POST /customers and PATCH customers/:customerId ## Update customer - [PATCH /v1/customers/{customerId}](https://timify-dev-api.redocly.app/apis/openapi/customers/patchv1customersbycustomerid.md): Update the data of a customer. Customer data is created and updated with the "customfield" attribute. Every data attribute of a customer is a custom field, for example firstName, lastName, email etc. The URL parameter "customerId" can be used in two ways: - As a unique ID of the customer assigned by TIMIFY ("customerId"). In this case, you don't need the QUERY parameter "external" - use the "externalId" that you added to this customer. In this case, you need to add the parameter "external" ( for ex.: /?external=1) the API will search by your "externalId" and not by "customerId" assigned by TIMIFY You can add "externalId" to the customer with the Developer API endpoints POST /customers and PATCH /customers/:customerId You can use the endpoint GET /customers/customfields to retrieve all available custom fields for the selected company. To create a new custom field you can use the endpoint POST /customers/customfields