# 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.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}},"parameters":{"query":{"name":"query","in":"query","schema":{"type":"string","pattern":"^[0-9a-zA-Z ]+$","minLength":1,"default":""}},"itemStart":{"name":"itemStart","in":"query","schema":{"type":"number","default":0}},"itemLimit":{"name":"itemLimit","in":"query","schema":{"type":"number","maximum":99,"default":15}}}},"paths":{"/api/v2/customer":{"get":{"tags":["Customer"],"summary":"index","description":"**Returns all the customers.**","operationId":"customerIndexGET","parameters":[{"$ref":"#/components/parameters/query"},{"$ref":"#/components/parameters/itemStart"},{"$ref":"#/components/parameters/itemLimit"}],"responses":{"200":{"description":"index","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"itemStart":{"type":"integer"},"itemTotal":{"type":"integer"},"itemLimit":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"external_primary_id":{"type":"string"},"brand_name":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"channels":{"type":"array","items":{}}}}}}}}}}}}}}}
```

## index

> \*\*Creates a new customer.\*\*\
> \
> If you want to set a custom field, it should always follow the pattern of \`custom\_\` followed by the name of the custom field.\
> \
> Most parameters are optional but depending on the presence of other parameters.

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer":{"post":{"tags":["Customer"],"summary":"index","description":"**Creates a new customer.**\n\nIf you want to set a custom field, it should always follow the pattern of `custom_` followed by the name of the custom field.\n\nMost parameters are optional but depending on the presence of other parameters.","operationId":"customerIndexPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["brand_id"],"properties":{"channel_id":{"description":"Name or the ID of the channel e.g. email or telephone.\n\nCan only be processed if `customer_link_channel` is set.","type":"string","pattern":"^([0-9]+|email|telephone|facebook|twitter)$","minLength":1},"customer_link_channel":{"description":"The name of the address, depending on the channel e.g. a phone number or an email address.","type":"string"},"search_customer_channel_value":{"description":"If `enable customer search by channels` is enabled on the brand, this can be used instead of `primary_id`","type":"string","minLength":1},"brand_id":{"type":"number"},"primary_id":{"description":"The external primary ID of the customer. \n\nNot needed if `enable customer search by channels` is enabled on this brand. This will take precedent if it is included.","type":"string","minLength":1},"noSync":{"description":"Does not update the ticket with the new linked channel(s) if sent along with the request.","type":"boolean"},"firstname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1,"default":""},"lastname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1,"default":""},"ticket_id":{"description":"Allows for instant linking the new customer to a ticket.","type":"number"},"extra_email":{"type":"string","format":"email"},"extra_telephone":{"type":"string","pattern":"^\\+[0-9]+$","minLength":12},"custom_testfield":{"description":"This is a custom customer field. See the endpoint description for further explanation.","type":"string"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## index

> \*\*Updates this customer's name.\*\*\
> \
> If you want to update a custom field, it should always follow the pattern of \`custom\_\` followed by the name of the custom field.\
> \
> PrimaryID, brandID and customerID are all optional, but dependent on the presence of at least one.

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer":{"put":{"tags":["Customer"],"summary":"index","description":"**Updates this customer's name.**\n\nIf you want to update a custom field, it should always follow the pattern of `custom_` followed by the name of the custom field.\n\nPrimaryID, brandID and customerID are all optional, but dependent on the presence of at least one.","operationId":"customerIndexPUT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"primaryID":{"type":"string","minLength":1},"brandID":{"type":"number"},"customerID":{"type":"number"},"firstname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1,"default":""},"lastname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1,"default":""},"custom_testfield":{"description":"This is a custom customer field. See the endpoint description for further explanation.","type":"string"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## item

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/{id}":{"get":{"tags":["Customer"],"summary":"item","description":"**Returns all the data of this customer.**","operationId":"customerItemGET","parameters":[{"name":"brandID","in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":""}}}}}}
```

## 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.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"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.","operationId":"customerItemPUT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["brandID"],"properties":{"brandID":{"type":"number"},"firstname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1,"default":""},"lastname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1,"default":""},"custom_testfield":{"description":"This is a custom customer field. Any custom fields you want to update start with `custom_` followed by the name of the custom field.","type":"string"},"customerChannelType_0":{"description":"This is how you would add/update multiple customer channels at once. the `0` would be incremental if you add/update multiple. This should always be the channel type.","type":"string"},"customerChannelValue_0":{"description":"This is how you add the value to the customer channel you want to add. The same goes for how the `customerChannelType` gets added, only this would be the value.","type":"string"}}}}}},"responses":{"200":{"description":"Successful example","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"}}}}}}}}}}}
```

## item

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/{id}":{"delete":{"tags":["Customer"],"summary":"item","description":"**Permanently deletes this customer.**","operationId":"customerItemDELETE","responses":{"200":{"description":""}}}}}}
```

## searchByPrimaryExternalID

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/SearchByPrimaryExternalID":{"post":{"tags":["Customer"],"summary":"searchByPrimaryExternalID","description":"**Searches for this customer by primary external ID.**","operationId":"searchByPrimaryExternalIDPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["primary_id","brand_id"],"properties":{"primary_id":{"description":"The external primary ID of the customer.","type":"string","minLength":1},"brand_id":{"type":"number"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## searchByCustomerChannelValue

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/SearchByCustomerChannelValue":{"post":{"tags":["Customer"],"summary":"searchByCustomerChannelValue","description":"**Searches for this customer by channel value.**","operationId":"searchByCustomerChannelValuePOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["customerChannelValue","brand_id"],"properties":{"customerChannelValue":{"description":"The channel value of the customer.","type":"string","minLength":1},"brand_id":{"type":"number"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## addChannelOnly

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/addChannelOnly":{"post":{"tags":["Customer"],"summary":"addChannelOnly","description":"**Adds a channel to a customer.**","operationId":"addChannelOnlyPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["brand_id"],"properties":{"customer_id":{"type":"number"},"primary_id":{"type":"string","minLength":1},"brand_id":{"type":"number"},"extra_email":{"type":"string","format":"email","minLength":1},"extra_telephone":{"type":"string","pattern":"^\\+[0-9]+$","minLength":1},"extra_twitter":{"type":"string","pattern":"^[a-zA-Z0-9_ ]+$","minLength":1},"extra_facebook":{"type":"number"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## updateCustomer

> \*\*Updates the fields of this customer.\*\*\
> \
> Similar to how \`PUT\` item works.\
> \
> If you want to update a custom field, it should always follow the pattern of \`custom\_\` followed by the name of the custom field.

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"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 a custom field, it should always follow the pattern of `custom_` followed by the name of the custom field.","operationId":"updateCustomerPUT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["externalPrimaryID","brandID","firstname","lastname"],"properties":{"externalPrimaryID":{"type":"string","minLength":1},"brandID":{"type":"number"},"firstname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1},"lastname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\' ]+$","minLength":1},"custom_testfield":{"description":"This is a custom customer field. Any custom fields you want to update start with `custom_` followed by the name of the custom field.","type":"string"},"customerChannelType_0":{"description":"This is how you would add/update multiple customer channels at once. the `0` would be incremental if you add/update multiple. This should always be the channel type.","type":"string"},"customerChannelValue_0":{"description":"This is how you add the value to the customer channel you want to add. The same goes for how the `customerChannelType` gets added, only this would be the value.","type":"string"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## itemChannel

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/channel/{id}":{"delete":{"tags":["Customer"],"summary":"itemChannel","description":"**Permanently deletes a channel endpoint of this customer.**","operationId":"customerItemChannelDELETE","responses":{"200":{"description":""}}}}}}
```

## timelineByCustomerExternalID

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/timelineByCustomerExternalID":{"get":{"tags":["Customer"],"summary":"timelineByCustomerExternalID","description":"**Returns the timeline from this customer by external primary ID.**","operationId":"timelineByCustomerExternalIDGET","parameters":[{"name":"brand_id","in":"query","required":true,"schema":{"type":"number","minLength":1}},{"name":"external_id","description":"External primary ID of the customer.","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"getTicketHistory","description":"Include this with any value to also return ticket history for the customer.","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":""}}}}}}
```

## itemPurgeData

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/purgeData/{id}":{"delete":{"tags":["Customer"],"summary":"itemPurgeData","description":"**Permanently deletes customer data and related items/tickets.**","operationId":"customerItemPurgeDataDELETE","responses":{"200":{"description":""}}}}}}
```

## externalEvent

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"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.**","operationId":"externalEventPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["brand_id","initiated_by","message","source_url"],"properties":{"customer_id":{"type":"number"},"external_id":{"description":"The external primary ID of the customer.","type":"string","minLength":1},"brand_id":{"type":"number"},"initiated_by":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"source_url":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":""}}}}}}
```

## syncWithCRM

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"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.**","operationId":"syncWithCRMPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["brandID"],"properties":{"brandID":{"type":"number"},"channel":{"type":"string","enum":["phoneNumber","email"]},"address":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":""}}}}}}
```

## createCustomerCRUD

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/customer/createCustomerCRUD":{"post":{"tags":["Customer"],"summary":"createCustomerCRUD","description":"**Creates a customer using the CRUD.**","operationId":"createCustomerCRUDPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["primaryID"],"properties":{"primaryID":{"description":"The external primary ID of the customer.","type":"string","minLength":1},"brandID":{"type":"number"},"firstname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\'' ]+$","minLength":1},"lastname":{"type":"string","pattern":"^[a-zA-ZÀ-ÖØ-Þß-öø-ÿŠš\\.\\-\\'' ]+$","minLength":1},"custom_testfield":{"description":"This is a custom customer field. Any custom fields you want to update start with `custom_` followed by the name of the custom field.","type":"string"},"customerChannelType_0":{"description":"This is how you would add/update multiple customer channels at once. the `0` would be incremental if you add/update multiple. This should always be the channel type.","type":"string"},"customerChannelValue_0":{"description":"This is how you add the value to the customer channel you want to add. The same goes for how the `customerChannelType` gets added, only this would be the value.","type":"string"}}}}}},"responses":{"200":{"description":""}}}}}}
```
