# Customers

## GET /v1/crm/customers

> List all users.

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ListUsersApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ListUsers_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ListUsers_Data":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/UserMap"}},"next":{"type":"string"},"query":{"$ref":"#/components/schemas/ListQueryResult_a9067b59"}},"required":["users"]},"UserMap":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"phone":{"type":"string"},"phoneCountry":{"type":"string"},"phoneCountryCalling":{"type":"string"},"number":{"type":"string"},"cityId":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"gender":{"type":"object"},"unsubscribed":{"type":"boolean","nullable":true},"internalNote":{"type":"string","nullable":true},"archivedAt":{"type":"string","nullable":true},"archivedBy":{"type":"string","nullable":true},"archivedVia":{"type":"string","nullable":true},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"},"id":{"type":"string"}},"required":["firstName","phone","phoneCountry","phoneCountryCalling","number","id"]},"ListQueryResult_a9067b59":{"type":"object","properties":{}}}},"paths":{"/v1/crm/customers":{"get":{"operationId":"Customers_list","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUsersApiResponse"}}}}},"summary":"List all users.","tags":["Customers"]}}}}
```

## POST /v1/crm/customers

> Creates a new user.

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"CreateUserApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/CreateUser_Params"}},"required":["params"]},"CreateUser_Params":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"phone":{"type":"string"},"phoneCallingCode":{"type":"string"},"cityId":{"type":"string"},"birthDate":{"type":"string"},"gender":{"type":"string","enum":["F","M"]},"passcode":{"type":"string"},"number":{"type":"string"},"unsubscribed":{"type":"boolean"},"internalNote":{"type":"string","nullable":true}},"required":["firstName","phone"]},"CreateUserApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/CreateUser_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"CreateUser_Data":{"type":"object","properties":{"succeed":{"type":"boolean"},"id":{"type":"string"}},"required":["succeed","id"]},"CreateUserApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/CreateUser_Error"}},"required":["error"]},"CreateUser_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/CreateUser_ErrorCodes_enum"}]}},"required":["code"]},"CreateUser_ErrorCodes_enum":{"type":"string","enum":["DUPLICATE_PHONE"]}}},"paths":{"/v1/crm/customers":{"post":{"operationId":"Customers_create","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserApiError"}}}}},"summary":"Creates a new user.","tags":["Customers"]}}}}
```

## GET /v1/crm/customers/{uid}

> Returns a specific user.

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"GetUserApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/GetUser_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"GetUser_Data":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/GetUser_Data_User"}},"required":["user"]},"GetUser_Data_User":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"phone":{"type":"string"},"phoneCountry":{"type":"string"},"phoneCountryCalling":{"type":"string"},"number":{"type":"string"},"cityId":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"gender":{"type":"object"},"unsubscribed":{"type":"boolean","nullable":true},"internalNote":{"type":"string","nullable":true},"archivedAt":{"type":"string","nullable":true},"archivedBy":{"type":"string","nullable":true},"archivedVia":{"type":"string","nullable":true},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"},"id":{"type":"string"}},"required":["firstName","phone","phoneCountry","phoneCountryCalling","number","id"]},"GetUserApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/GetUser_Error"}},"required":["error"]},"GetUser_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/GetUser_ErrorCodes_enum"}]}},"required":["code"]},"GetUser_ErrorCodes_enum":{"type":"string","enum":["COMPACT_INACTIVE","MISSING_ID","NO_CREATE_ACTION","NotFound"]}}},"paths":{"/v1/crm/customers/{uid}":{"get":{"operationId":"Customers_get","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserApiError"}}}}},"summary":"Returns a specific user.","tags":["Customers"]}}}}
```

## DELETE /v1/crm/customers/{uid}

> Deletes a new user.

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"DeleteUserApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/DeleteUser_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"DeleteUser_Data":{"type":"object","properties":{"succeed":{"type":"boolean"}},"required":["succeed"]}}},"paths":{"/v1/crm/customers/{uid}":{"delete":{"operationId":"Customers_delete","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteUserApiResponse"}}}}},"summary":"Deletes a new user.","tags":["Customers"]}}}}
```

## PATCH /v1/crm/customers/{uid}

> Updates a specific user.

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"UpdateUserApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/UpdateUser_Params"}},"required":["params"]},"UpdateUser_Params":{"type":"object","properties":{"id":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"cityId":{"type":"string","nullable":true},"birthDate":{"type":"string"},"gender":{"type":"string","enum":["F","M"]},"passcode":{"type":"string"},"number":{"type":"string"},"unsubscribed":{"type":"boolean"},"internalNote":{"type":"string","nullable":true}},"required":["id"]},"UpdateUserApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/UpdateUser_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"UpdateUser_Data":{"type":"object","properties":{"succeed":{"type":"boolean"}},"required":["succeed"]},"UpdateUserApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdateUser_Error"}},"required":["error"]},"UpdateUser_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/UpdateUser_ErrorCodes_enum"}]}},"required":["code"]},"UpdateUser_ErrorCodes_enum":{"type":"string","enum":["NoChanges"]}}},"paths":{"/v1/crm/customers/{uid}":{"patch":{"operationId":"Customers_update","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserApiError"}}}}},"summary":"Updates a specific user.","tags":["Customers"]}}}}
```

## GET /v1/crm/customers/export

> Exports all users with support for incremental fetching.

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ExportUsersApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ExportUsers_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ExportUsers_Data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UserMap"}},"next":{"type":"string"}},"required":["items"]},"UserMap":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"phone":{"type":"string"},"phoneCountry":{"type":"string"},"phoneCountryCalling":{"type":"string"},"number":{"type":"string"},"cityId":{"type":"string","nullable":true},"birthDate":{"type":"string","nullable":true},"gender":{"type":"object"},"unsubscribed":{"type":"boolean","nullable":true},"internalNote":{"type":"string","nullable":true},"archivedAt":{"type":"string","nullable":true},"archivedBy":{"type":"string","nullable":true},"archivedVia":{"type":"string","nullable":true},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"},"id":{"type":"string"}},"required":["firstName","phone","phoneCountry","phoneCountryCalling","number","id"]}}},"paths":{"/v1/crm/customers/export":{"get":{"operationId":"Customers_export","parameters":[{"name":"updatedSince","required":false,"in":"query","schema":{"type":"string"}},{"name":"offset","required":false,"in":"query","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportUsersApiResponse"}}}}},"summary":"Exports all users with support for incremental fetching.","tags":["Customers"]}}}}
```
