# Customer

**All the endpoints that can be called on the Customer controller.**

Endpoints that require the `CUSTOMER_READ` permission:

* `GET` index
* `GET` item
* `POST` searchByPrimaryExternalId
* `GET` timelineByCustomerExternalID

Endpoints that require the `CUSTOMER_CUD` permission:

* `POST` index
* `PUT` index
* `PUT` item
* `DELETE` item
* `POST` addChannelOnly
* `PUT` updateCustomer
* `DELETE` itemChannel
* `DELETE` itemPurgeData
* `POST` externalEvent
* `POST` syncWithCRM
* `POST` createCustomerCRUD

## index

> \*\*Returns all the customers.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer":{"get":{"tags":["Customer"],"summary":"index","description":"**Returns all the customers.**","responses":{"200":{"description":"OK","headers":{"Date":{"schema":{"type":"string"}},"Server":{"schema":{"type":"number"}},"X-Powered-By":{"schema":{"type":"string"}},"X-Frame-Options":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"X-Content-Type-Options":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"type":"string"}},"Pragma":{"schema":{"type":"string"}},"Access-Control-Allow-Orgin":{"schema":{"type":"string"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Keep-Alive":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```

## index

> \*\*Creates a new customer.\*\*\
> \
> Most parameters are optional but depending on the presence of other parameters.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer":{"post":{"tags":["Customer"],"summary":"index","description":"**Creates a new customer.**\n\nMost parameters are optional but depending on the presence of other parameters.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"channel_id":{"type":"string","description":"type: `^([0-9]+|email|telephone|facebook|twitter)$` = ' '\nName or the ID of the channel e.g. email or telephone.\nCan only be processed if `customer_link_channel` is set."},"customer_link_channel":{"type":"string","description":"type: `string`\nThe name of the address, depending on the channel e.g. a phone number or an email address."},"brand_id":{"type":"string","description":"type: `number`"},"primary_id":{"type":"string","description":"type: `string`\nThe external primary ID of the customer."},"noSync":{"type":"string","description":"type: `any`\nDoes not update the ticket with the new linked channel(s) if sent along with the request."},"firstname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$` = ' '"},"lastname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$` = ' '"},"ticket_id":{"type":"string","description":"type: `number` = null"},"extra_email":{"type":"string","description":"type: `string` = null\nHas to be a valid email address format."},"extra_telephone":{"type":"string","description":"type: `^\\+[0-9]+$` = null"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## index

> \*\*Updates this customer's name.\*\*\
> \
> PrimaryID, brandID and customerID are all optional, but dependent on the presence of at least one.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer":{"put":{"tags":["Customer"],"summary":"index","description":"**Updates this customer's name.**\n\nPrimaryID, brandID and customerID are all optional, but dependent on the presence of at least one.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"primaryID":{"type":"string","description":"The external primary ID of the customer."},"brandID":{"type":"string","description":"type: `number` = null"},"customerID":{"type":"string","description":"type: `number` = null"},"firstname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$` = null"},"lastname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$` = null"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## item

> \*\*Returns all the data of this customer.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/{id}":{"get":{"tags":["Customer"],"summary":"item","description":"**Returns all the data of this customer.**","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## item

> \*\*Updates any fields existing on this customer, including custom fields.\*\*\
> \
> See the example for how to update custom fields. It should always follow the pattern of "custom\_" followed by the name of the custom field.\
> \
> If you want to update or add multiple customer channels at once, it should be done in 2 parameters:\
> \
> \- customerChannelType\_0 (corresponding to the channel type ID)\
> &#x20;   \
> \- customerChannelValue\_0 (corresponding to the address of the channel you want to add)\
> &#x20;   \
> \
> The 0 would be incremental if you choose to do multiple.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/{id}":{"put":{"tags":["Customer"],"summary":"item","description":"**Updates any fields existing on this customer, including custom fields.**\n\nSee the example for how to update custom fields. It should always follow the pattern of \"custom_\" followed by the name of the custom field.\n\nIf you want to update or add multiple customer channels at once, it should be done in 2 parameters:\n\n- customerChannelType_0 (corresponding to the channel type ID)\n    \n- customerChannelValue_0 (corresponding to the address of the channel you want to add)\n    \n\nThe 0 would be incremental if you choose to do multiple.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"brandID":{"type":"string","description":"type: `number`"},"firstname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$` = ' '"},"lastname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$` = ' '"}}}}}},"parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","headers":{"Date":{"schema":{"type":"string"}},"Server":{"schema":{"type":"number"}},"X-Powered-By":{"schema":{"type":"string"}},"X-Frame-Options":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"X-Content-Type-Options":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"type":"string"}},"Pragma":{"schema":{"type":"string"}},"Access-Control-Allow-Orgin":{"schema":{"type":"string"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Keep-Alive":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```

## item

> \*\*Permanently deletes this customer.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/{id}":{"delete":{"tags":["Customer"],"summary":"item","description":"**Permanently deletes this customer.**","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## searchByPrimaryExternalID

> \*\*Searches for this customer by primary external ID.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/SearchByPrimaryExternalID":{"post":{"tags":["Customer"],"summary":"searchByPrimaryExternalID","description":"**Searches for this customer by primary external ID.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"primary_id":{"type":"string","description":"type: `string`\n\nThe external primary ID of the customer."},"brand_id":{"type":"string","description":"type: `number`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## searchByCustomerChannelValue

> \*\*Searches for this customer by channel value.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/SearchByCustomerChannelValue":{"post":{"tags":["Customer"],"summary":"searchByCustomerChannelValue","description":"**Searches for this customer by channel value.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"customerChannelValue":{"type":"string","description":"type: `string`\n\nThe channel value of the customer."},"brand_id":{"type":"string","description":"type: `number`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## addChannelOnly

> \*\*Adds a channel to a customer.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/addChannelOnly":{"post":{"tags":["Customer"],"summary":"addChannelOnly","description":"**Adds a channel to a customer.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"customer_id":{"type":"string","description":"type: `number` = null"},"primary_id":{"type":"string","description":"type: `string` = null\n\nThe external primary ID of the customer."},"brand_id":{"type":"string","description":"type: `number`"},"extra_email":{"type":"string","description":"type: `string` = null\n\nShould be in a valid email address format."},"extra_telephone":{"type":"string","description":"type: `^\\+[0-9]+$` = null"},"extra_twitter":{"type":"string","description":"type: `^[a-zA-Z0-9_ ]+$` = null"},"extra_facebook":{"type":"string","description":"type: `number` = null"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## updateCustomer

> \*\*Updates the fields of this customer.\*\*\
> \
> Similar to how \`PUT\` item works.\
> \
> If you want to update custom fields, just put the name of the field you want to update as the key and the value of the field you want to update as the value.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/updateCustomer":{"put":{"tags":["Customer"],"summary":"updateCustomer","description":"**Updates the fields of this customer.**\n\nSimilar to how `PUT` item works.\n\nIf you want to update custom fields, just put the name of the field you want to update as the key and the value of the field you want to update as the value.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"externalPrimaryID":{"type":"string","description":"type: `string`"},"brandID":{"type":"string","description":"type: `number`"},"firstname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$`"},"lastname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## itemChannel

> \*\*Permanently deletes a channel endpoint of this customer.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/channel/{id}":{"delete":{"tags":["Customer"],"summary":"itemChannel","description":"**Permanently deletes a channel endpoint of this customer.**","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## timelineByCustomerExternalID

> \*\*Returns the timeline from this customer by external primary ID.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/timelineByCustomerExternalID":{"get":{"tags":["Customer"],"summary":"timelineByCustomerExternalID","description":"**Returns the timeline from this customer by external primary ID.**","parameters":[{"name":"brand_id","in":"query","schema":{"type":"string"}},{"name":"external_id","in":"query","schema":{"type":"string"},"description":"External primary ID of the customer."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## itemPurgeData

> \*\*Permanently deletes customer data and related items/tickets.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/purgeData/{id}":{"delete":{"tags":["Customer"],"summary":"itemPurgeData","description":"**Permanently deletes customer data and related items/tickets.**","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## externalEvent

> \*\*Creates a new customer event e.g. an order or marketing mail to the customer timeline.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/externalEvent":{"post":{"tags":["Customer"],"summary":"externalEvent","description":"**Creates a new customer event e.g. an order or marketing mail to the customer timeline.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"customer_id":{"type":"string","description":"type: `number` = null"},"external_id":{"type":"string","description":"type: `string` = null\n\nThe external primary ID of the customer."},"brand_id":{"type":"string","description":"type: `number`"},"initiated_by":{"type":"string","description":"type: `string`"},"message":{"type":"string","description":"type: `string`"},"source_url":{"type":"string","description":"type: `string`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## syncWithCRM

> \*\*Synchronizes customer data for this customer with the CRM if a CRM lookup URL is configured for the brand.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/syncWithCRM":{"post":{"tags":["Customer"],"summary":"syncWithCRM","description":"**Synchronizes customer data for this customer with the CRM if a CRM lookup URL is configured for the brand.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"brandID":{"type":"string","description":"type: `number`"},"channel":{"type":"string","description":"type: `string`\n\nThe name of the channel e.g. telephone or email"},"address":{"type":"string","description":"type: `string` = null"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## createCustomerCRUD

> \*\*Creates a customer using the CRUD.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Customer","description":"**All the endpoints that can be called on the Customer controller.**\n\nEndpoints that require the `CUSTOMER_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `POST` searchByPrimaryExternalId\n    \n- `GET` timelineByCustomerExternalID\n    \n\nEndpoints that require the `CUSTOMER_CUD` permission:\n\n- `POST` index\n    \n- `PUT` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n- `POST` addChannelOnly\n    \n- `PUT` updateCustomer\n    \n- `DELETE` itemChannel\n    \n- `DELETE` itemPurgeData\n    \n- `POST` externalEvent\n    \n- `POST` syncWithCRM\n    \n- `POST` createCustomerCRUD"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/customer/createCustomerCRUD":{"post":{"tags":["Customer"],"summary":"createCustomerCRUD","description":"**Creates a customer using the CRUD.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"primaryID":{"type":"string","description":"type: `string`\n\nThe external primary ID of the customer."},"brandID":{"type":"string","description":"type: `number`"},"firstname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$`"},"lastname":{"type":"string","description":"type: `^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omnidesk.io/omnidesk/api-specification/customer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
