### Create User Response Example (JSON) Source: https://crm.pachca.com/dev/users/new An example JSON response after successfully creating a user. It shows the detailed structure of the created user object, including assigned properties and system fields. ```json { "data": { "id": 12, "first_name": "Олег", "last_name": "Петров", "nickname": "", "email": "olegp@example.com", "phone_number": "", "department": "Продукт", "title": "", "role": "admin", "suspended": false, "invite_status": "confirmed", "list_tags": [ "Product", "Design" ], "custom_properties": [ { "id": 1678, "name": "Город", "data_type": "string", "value": "Санкт-Петербург" } ], "user_status": null, "bot": false, "sso": false, "created_at": "2023-06-08T09:31:17.000Z", "last_activity_at": null, "time_zone": "Europe/Moscow", "image_url": null } } ``` -------------------------------- ### Create User Request Example (JSON) Source: https://crm.pachca.com/dev/users/new An example JSON payload for creating a new user in the CRM system. It includes basic user information and custom properties. ```json { "user": { "first_name": "Олег", "last_name": "Петров", "email": "olegp@example.com", "department": "Продукт", "list_tags": [ "Product", "Design" ], "custom_properties": [ { "id": 1678, "value": "Санкт-Петербург" } ] }, "skip_email_notify": true } ``` -------------------------------- ### cURL Example: Get User Login Events Source: https://crm.pachca.com/dev/audit-events This cURL command demonstrates how to retrieve all 'user_login' events within a specified date range. It includes parameters for start time, end time, event key, and the desired limit for the number of results. ```bash curl --location 'https://api.pachca.com/api/shared/v1/audit_events' \ --header 'Authorization: ••••••' \ --data-urlencode 'start_time=2025-05-01T00:00:00Z' \ --data-urlencode 'end_time=2025-05-02T00:00:00Z' \ --data-urlencode 'event_key=user_login' \ --data-urlencode 'limit=50' ``` -------------------------------- ### Get Message Reactions API Request Example Source: https://crm.pachca.com/dev/reactions/list This example demonstrates how to structure a request to the Pachca API to get message reactions. It specifies the message ID in the URL and includes query parameters for pagination and results per page. ```HTTP GET https://api.pachca.com/api/shared/v1/messages/{id}/reactions?per=7&page=2 ``` -------------------------------- ### Update User Example Request (JSON) Source: https://crm.pachca.com/dev/users/update This is an example JSON payload for updating a user's information. It specifies the user's nickname, role, and a list of tags. The user ID is expected to be in the URL. ```json { "user": { "nickname": "olegpetrov", "role": "user", "list_tags": [ "Product" ] } } ``` -------------------------------- ### Get Thread Information Example Request and Response (JSON) Source: https://crm.pachca.com/dev/threads/get This snippet shows an example of how to make a GET request to the Pachca API to retrieve thread information and the corresponding JSON response. The request includes the thread ID in the URL, and the response provides details about the thread. ```json { "data": { "id": 265142, "chat_id": 2637266155, "message_id": 154332686, "message_chat_id": 2637266154, "updated_at": "2023-02-01T19:20:47.204Z" } } ``` -------------------------------- ### Chat Members List Response Example Source: https://crm.pachca.com/dev/members/users/list Provides an example of the JSON response structure for a list of chat members. It includes metadata for pagination and a 'data' array containing detailed information for each member. ```json { "meta": { "paginate": { "next_page": "eyJpZCI6MiwiZGlyIjoiYXNjIn0" } }, "data": [ { "id": 12, "first_name": "Олег", "last_name": "Петров", "nickname": "olegpetrov", "email": "olegp@example.com", "phone_number": "", "department": "Продукт", "title": "CIO", "role": "admin", "suspended": false, "invite_status": "confirmed", "list_tags": [ "Product", "Design" ], "custom_properties": [ { "id": 1678, "name": "Город", "data_type": "string", "value": "Санкт-Петербург" } ], "user_status": null, "bot": false, "sso": false, "created_at": "2020-06-08T09:10:11.000Z", "last_activity_at": "2025-01-20T13:40:07.000Z", "time_zone": "Europe/Moscow", "image_url": null } ] } ``` -------------------------------- ### Example Message Creation Request Source: https://crm.pachca.com/dev/messages/new Provides an example JSON payload for creating a new message within the CRM system. This includes specifying the message entity type, ID, and content. ```json { "message": { "entity_type": "discussion", "entity_id": 198, "content": "Вчера мы продали 756 футболок (что на 10% больше, чем в прошлое воскресенье)" } } ``` -------------------------------- ### Example API Request and Response (JSON) Source: https://crm.pachca.com/dev/threads/new Demonstrates how to construct the API request URL with a message ID and provides an example of a successful JSON response upon creating a new thread. ```bash POST https://api.pachca.com/api/shared/v1/messages/{id}/thread Example URL: /messages/154332686/thread ``` ```json { "data": { "id": 265142, "chat_id": 2637266155, "message_id": 154332686, "message_chat_id": 2637266154, "updated_at": "2023-02-01T19:20:47.204Z" } } ``` -------------------------------- ### Example Request for Custom Properties Source: https://crm.pachca.com/dev/common/fields This example demonstrates how to construct a GET request to retrieve custom properties. The 'entity_type' parameter, specifying either 'User' or 'Task', is appended to the base URL. No request body is required. ```http GET https://api.pachca.com/api/shared/v1/custom_properties?entity_type=User ``` -------------------------------- ### Project Data Example Source: https://crm.pachca.com/dev/chats/new This section provides an example of a successful response when retrieving project data. It outlines the structure of the returned JSON, including project ID, name, timestamps, ownership, member information, and meeting room details. ```APIDOC ## GET /websites/crm_pachca_dev ### Description Retrieves detailed information about a specific CRM project. ### Method GET ### Endpoint /websites/crm_pachca_dev ### Parameters This endpoint does not have any path, query, or request body parameters described in the provided text. ### Request Example This endpoint does not have a request example provided in the provided text. ### Response #### Success Response (200) - **data** (object) - Contains the project details. - **id** (integer) - The unique identifier for the project. - **name** (string) - The name of the project. - **created_at** (string) - The timestamp when the project was created. - **owner_id** (integer) - The ID of the user who owns the project. - **member_ids** (array) - A list of user IDs who are members of the project. - **group_tag_ids** (array) - A list of group tag IDs associated with the project. - **channel** (boolean) - Indicates if the project is a channel. - **personal** (boolean) - Indicates if the project is personal. - **public** (boolean) - Indicates if the project is public. - **last_message_at** (string) - The timestamp of the last message in the project. - **meet_room_url** (string) - The URL for the project's meeting room. #### Response Example ```json { "data": { "id": 334, "name": "🤿 aqua", "created_at": "2021-08-28T15:56:53.000Z", "owner_id": 185, "member_ids": [ 185, 186, 187 ], "group_tag_ids": [], "channel": true, "personal": false, "public": false, "last_message_at": "2021-08-28T15:56:53.000Z", "meet_room_url": "https://meet.pachca.com/aqua-94bb21b5" } } ``` ``` -------------------------------- ### JSON Response Example for Messages Source: https://crm.pachca.com/dev/messages/list An example of a successful JSON response when retrieving messages. It includes an array of message objects, each with details like ID, content, timestamps, and associated chat information. ```json { "data": [ { "id": 1194277, "entity_type": "discussion", "entity_id": 198, "chat_id": 198, "content": "Это сообщение тоже попадёт в экспорт", "user_id": 12, "created_at": "2023-09-18T13:43:32.000Z", "url": "https://app.pachca.com/chats/198?message=1194277", "files": [], "buttons": [], "thread": { "id": 2633, "chat_id": 44997 }, "forwarding": null, "parent_message_id": null, "display_avatar_url": null, "display_name": null }, { "id": 1194276, "entity_type": "discussion", "entity_id": 198, "chat_id": 198, "content": "**Andrew** добавил **Export bot** в беседу", "user_id": 12, "created_at": "2023-09-18T13:43:27.000Z", "url": "https://app.pachca.com/chats/198?message=1194276", "files": [], "buttons": [], "thread": null, "forwarding": null, "parent_message_id": null, "display_avatar_url": null, "display_name": null }, { "id": 1194275, "entity_type": "discussion", "entity_id": 198, "chat_id": 198, "content": "**Andrew** создал беседу", "user_id": 12, "created_at": "2023-09-18T13:43:19.000Z", "url": "https://app.pachca.com/chats/198?message=1194275", "files": [], "buttons": [], "thread": null, "forwarding": null, "parent_message_id": null, "display_avatar_url": null, "display_name": null } ] } ``` -------------------------------- ### Request Body Example for Message Read List Source: https://crm.pachca.com/dev/read_members/list An example of the JSON request body used to specify the number of entities per page and the page number for retrieving the list of users who read a message. ```json { "per": 5, "page": 2 } ``` -------------------------------- ### Request Example for Leaving a Chat/Channel Source: https://crm.pachca.com/dev/members/users/leave This example demonstrates how to construct a request URL to leave a specific chat or channel. The chat/channel ID is appended to the '/chats/' path, followed by '/leave'. For instance, to leave chat with ID 553, the URL would be /chats/553/leave. ```bash DELETE https://api.pachca.com/api/shared/v1/chats/{id}/leave Example: DELETE https://api.pachca.com/api/shared/v1/chats/553/leave ``` -------------------------------- ### Response Body Example for Message Read List Source: https://crm.pachca.com/dev/read_members/list An example of a successful JSON response body containing an array of user IDs who have read the message. This is returned when the API call is successful. ```json { "data": [ 12, 13, 14, 15, 16 ] } ``` -------------------------------- ### Example Response for Employee Group Tags (JSON) Source: https://crm.pachca.com/dev/group_tags/list An example JSON response from the /group_tags endpoint, illustrating the structure of the returned employee tag data. Each tag object includes its ID, name, and the count of users associated with it. ```json { "data": [ { "id": 9111, "name": "Design", "users_count": 6 }, { "id": 9113, "name": "iOS", "users_count": 4 }, { "id": 9114, "name": "Android", "users_count": 36 }, { "id": 9115, "name": "Backend", "users_count": 15 }, { "id": 9510, "name": "Frontend", "users_count": 5 } ] } ``` -------------------------------- ### API Request Example (New User) Source: https://crm.pachca.com/dev/getting-started/requests-and-responses This example demonstrates a POST request to create a new user via the API. It includes the necessary `Authorization` and `Content-Type` headers, and a JSON payload with user details. The server expects UTF-8 encoded JSON at the specified base URL. ```http POST /users HTTP/1.1 Authorization: Bearer Pm7gdycNeHV_F1y4_tjWWIutC0Aq0gwl9wRnX-KBuHw Content-Type: application/json; charset=utf-8 Host: api.pachca.com Connection: close User-Agent: Paw/3.1.10 (Macintosh; OS X/10.15.3) GCDHTTPRequest Content-Length: 219 {"user":{"first_name":"Олег","last_name":"Петров","email":"olegp@example.com","department":"Продукт","list_tags":["Product","Design"],"custom_properties":[{"id":1678,"value":"Санкт-Петербург"}]},"skip_email_notify":true} ``` -------------------------------- ### API Response Example (New User Created) Source: https://crm.pachca.com/dev/getting-started/requests-and-responses This example shows a successful API response (HTTP 201 Created) for creating a new user. The response is in JSON format and UTF-8 encoded, containing a `data` array with the newly created user's details. ```http HTTP/1.1 201 Created Server: nginx/1.14.2 Date: Wed, 22 Apr 2020 12:32:29 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: close ETag: W/"4d63aae1430a3bbd35e95e3db6b364df" Cache-Control: max-age=0, private, must-revalidate X-Request-Id: 12f8a05c-c5cf-4a79-8d2f-f82cc477c410 X-Runtime: 0.117503 Vary: Origin X-Rack-CORS: miss; no-origin {"data":{"id":12,"first_name":"Олег","last_name":"Петров","nickname":"","email":"olegp@example.com","phone_number":"","department":"Продукт","role":"admin","suspended":false,"invite_status":"confirmed","list_tags":["Product","Design"],"custom_properties":[{"id":1678,"name":"Город","data_type":"string","value":"Санкт-Петербург"}]}} ``` -------------------------------- ### Get Profile Status API Response Example Source: https://crm.pachca.com/dev/profile/status/get Example JSON response for the GET /profile/status endpoint. This demonstrates the structure of a successful response, including the 'data' object containing 'emoji', 'title', and 'expires_at' fields. The 'expires_at' field may be null if no expiration is set. ```json { "data": { "emoji": "🎮", "title": "Очень занят", "expires_at": "2024-04-08T10:00:00.000Z" } } ``` -------------------------------- ### cURL Example: Get Events for a Specific User Source: https://crm.pachca.com/dev/audit-events This cURL example shows how to fetch all events associated with a particular user, identified by their 'actor_id' and 'actor_type'. It also specifies a time range for the audit logs. ```bash curl --location 'https://api.pachca.com/api/shared/v1/audit_events' \ --header 'Authorization: ••••••' \ --data-urlencode 'actor_id=133321' \ --data-urlencode 'actor_type=User' \ --data-urlencode 'start_time=2025-05-01T00:00:00Z' \ --data-urlencode 'end_time=2025-05-02T00:00:00Z' ``` -------------------------------- ### API Request Example for Chat Members Source: https://crm.pachca.com/dev/members/users/list Illustrates how to request a list of chat members by specifying the chat ID and optional parameters like 'role' and 'limit' in the URL. ```http /chats/334/members?role=admin&limit=1 ``` -------------------------------- ### Create Reminder API Response Example Source: https://crm.pachca.com/dev/tasks/new This snippet shows the JSON response received after successfully creating a reminder. It includes the reminder's ID, status, creation timestamp, performer IDs, and formatted custom properties. The 'due_at' field is presented in UTC format. ```json { "data": { "id": 22283, "kind": "reminder", "content": "Забрать со склада 21 заказ", "due_at": "2020-06-05T09:00:00.000Z", "priority": 2, "user_id": 12, "status": "undone", "created_at": "2020-06-04T10:37:57.000Z", "performer_ids": [ 12 ], "custom_properties": [ { "id": 78, "name": "Место", "data_type": "string", "value": "Синий склад" } ] } } ``` -------------------------------- ### Pachca API Response for Message Reactions Source: https://crm.pachca.com/dev/reactions/list This is an example of a successful response from the Pachca API when requesting message reactions. It contains an array of reaction objects, each with user ID, creation timestamp, and the emoji code. ```json { "data": [ { "user_id": 76243, "created_at": "2023-09-11T14:59:35.000Z", "code": "👍" }, { "user_id": 10764, "created_at": "2023-09-11T15:00:31.000Z", "code": "👍" }, { "user_id": 27494, "created_at": "2023-09-11T15:01:27.000Z", "code": "👍" }, { "user_id": 27494, "created_at": "2023-09-11T15:01:47.000Z", "code": "🔥" }, { "user_id": 11887, "created_at": "2023-09-11T15:12:49.000Z", "code": "👍" }, { "user_id": 11887, "created_at": "2023-09-11T15:13:46.000Z", "code": "⭐" }, { "user_id": 11887, "created_at": "2023-09-11T15:13:47.000Z", "code": "🔥" } ] } ``` -------------------------------- ### Example API Response (JSON) Source: https://crm.pachca.com/dev/users/list Demonstrates a typical JSON response from the CRM Pachca API when fetching a list of users. It includes pagination metadata and an array of user objects, each conforming to the defined user data structure. ```json { "meta": { "paginate": { "next_page": "eyJxZCO2MiwiZGlyIjomSNYjIn3" } }, "data": [ { "id": 12, "first_name": "Олег", "last_name": "Петров", "nickname": "olegpetrov", "email": "olegp@example.com", "phone_number": "", "department": "Продукт", "title": "CIO", "role": "admin", "suspended": false, "invite_status": "confirmed", "list_tags": [ "Product", "Design" ], "custom_properties": [ { "id": 1678, "name": "Город", "data_type": "string", "value": "Санкт-Петербург" } ], "user_status": null, "bot": false, "sso": false, "created_at": "2020-06-08T09:10:11.000Z", "last_activity_at": "2025-01-20T13:40:07.000Z", "time_zone": "Europe/Moscow", "image_url": null }, { "id": 13, "first_name": "Сергей", "last_name": "Кузнецов", "nickname": "skuz", "email": "sergkuzn@example.com", "phone_number": "", "department": "Разработка", "title": "iOS Developer", "role": "user", "suspended": false, "invite_status": "confirmed", "list_tags": [ "Development", "Android" ], "custom_properties": [ { "id": 1678, "name": "Город", "data_type": "string", "value": "Москва" } ], "user_status": { "emoji": "🎮", "title": "Очень занят", "expires_at": "2024-04-08T10:00:00.000Z" }, "bot": false, "sso": false, "created_at": "2020-06-08T09:31:17.000Z", "last_activity_at": "2025-01-20T07:00:32.000Z", "time_zone": "Europe/Moscow", "image_url": null }, { "id": 14, "first_name": "Дмитрий", "last_name": "Смирнов", "nickname": "dsmir", "email": "ds@example.com", "phone_number": "", "department": "Разработка", "title": "Android Developer", "role": "user", "suspended": false, "invite_status": "confirmed", "list_tags": [ "Development", "Frontend" ], "custom_properties": [ { "id": 1678, "name": "Город", "data_type": "string", "value": "Санкт-Петербург" } ], "user_status": { "emoji": "🚀", "title": "Лечу", "expires_at": null }, "bot": false, "sso": false, "created_at": "2020-06-08T09:32:57.000Z", "last_activity_at": "2025-01-20T13:51:25.000Z", "time_zone": "Europe/Moscow", "image_url": null } ] } ``` -------------------------------- ### cURL Example: Get Chat Permission Change Events Source: https://crm.pachca.com/dev/audit-events This cURL command illustrates how to retrieve all 'chat_permission_changed' events within a specified date range. It uses the 'event_key' parameter to filter for this specific type of event. ```bash curl --location 'https://api.pachca.com/api/shared/v1/audit_events' \ --header 'Authorization: ••••••' \ --data-urlencode 'event_key=chat_permission_changed' \ --data-urlencode 'start_time=2025-05-01T00:00:00Z' \ --data-urlencode 'end_time=2025-05-08T00:00:00Z' ``` -------------------------------- ### GET /api/shared/v1/chats/{id}/members Source: https://crm.pachca.com/dev/members/users/list Retrieves the current list of members for a specific chat. Space owners can get members of any chat, while admins and bots can only get members of chats they are part of or that are public. ```APIDOC ## GET /api/shared/v1/chats/{id}/members ### Description Retrieves the current list of members for a specific chat. Space owners can get members of any chat, while admins and bots can only get members of chats they are part of or that are public. ### Method GET ### Endpoint https://api.pachca.com/api/shared/v1/chats/{id}/members ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the chat to retrieve members from. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **members** (array) - A list of chat members. - **user_id** (string) - The ID of the user. - **role** (string) - The role of the user in the chat (e.g., 'owner', 'admin', 'member'). - **joined_at** (string) - The timestamp when the user joined the chat. #### Response Example ```json { "members": [ { "user_id": "user123", "role": "owner", "joined_at": "2023-10-27T10:00:00Z" }, { "user_id": "user456", "role": "member", "joined_at": "2023-10-27T10:05:00Z" } ] } ``` ``` -------------------------------- ### Retrieve Audit Events Logs (OpenAPI) Source: https://crm.pachca.com/dev/audit-events This snippet defines the OpenAPI specification for the Audit Events API GET method. It outlines the available query parameters for filtering events, including start and end times, event keys, actor IDs and types, entity IDs and types, and pagination cursors. The API returns a JSON object containing event data and pagination metadata. ```yaml openapi: 3.1.0 info: title: Пачка Audit Events API Доступно только на тарифе «Корпорация» version: 1.0.0 servers: - url: https://api.pachca.com/api/shared/v1 paths: /audit-events: get: summary: получить логи событий на основе указанных фильтров tags: - Audit Events parameters: - name: start_time in: query required: false schema: type: string description: Начальная метка времени (включительно), например,2025-05-01T09:11:00Z - name: end_time in: query required: false schema: type: string description: Конечная метка времени (исключительно), например,2025-05-02T09:11:00Z - name: event_key in: query required: false schema: type: string description: Фильтр по конкретному типу события, например,user_login - name: actor_id in: query required: false schema: type: string description: ID пользователя, выполнившего действие - name: actor_type in: query required: false schema: type: string description: Тип актора, например,User - name: entity_id in: query required: false schema: type: string description: ID затронутой сущности - name: entity_type in: query required: false schema: type: string description: Тип сущности, например,Chat - name: limit in: query required: false schema: type: string description: Количество записей для возврата (по умолчанию:50, максимум:50) - name: cursor in: query required: false schema: type: string description: Курсор для пагинации из meta.paginate.next_page responses: '200': description: Успешный ответ ``` -------------------------------- ### GET /api/shared/v1/messages/{id}/reactions Source: https://crm.pachca.com/dev/reactions/list Retrieves the current list of reactions for a given message. ```APIDOC ## GET /api/shared/v1/messages/{id}/reactions ### Description This endpoint allows you to fetch a list of reactions applied to a specific message. You can control the number of results and the page number for pagination. ### Method GET ### Endpoint https://api.pachca.com/api/shared/v1/messages/{id}/reactions ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the message for which to retrieve reactions. #### Query Parameters - **per** (integer) - Optional - The number of entities to return per request. Defaults to 50, maximum is 50. - **page** (integer) - Optional - The page number for the result set. Defaults to 1. #### Request Body This endpoint does not use a request body for standard GET requests. The `per` and `page` parameters are typically passed as query parameters, or in the context of the provided example, as a JSON object which might imply a specific client-side implementation or a variation not standard for a pure GET request. ### Request Example To get reactions for message ID 7231942: ```json { "per": 7, "page": 2 } ``` ### Response #### Success Response (200) - **data** (array) - An array containing reaction objects. - **user_id** (integer) - The ID of the user who added the reaction. - **created_at** (string) - The date and time the reaction was added in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sssZ). - **code** (string) - The emoji character representing the reaction. #### Response Example ```json { "data": [ { "user_id": 76243, "created_at": "2023-09-11T14:59:35.000Z", "code": "👍" }, { "user_id": 10764, "created_at": "2023-09-11T15:00:31.000Z", "code": "👍" }, { "user_id": 27494, "created_at": "2023-09-11T15:01:27.000Z", "code": "👍" }, { "user_id": 27494, "created_at": "2023-09-11T15:01:47.000Z", "code": "🔥" }, { "user_id": 11887, "created_at": "2023-09-11T15:12:49.000Z", "code": "👍" }, { "user_id": 11887, "created_at": "2023-09-11T15:13:46.000Z", "code": "⭐" }, { "user_id": 11887, "created_at": "2023-09-11T15:13:47.000Z", "code": "🔥" } ] } ``` #### Error Response (4XX) - **exclusion** (string) - Indicates an invalid value for a field. - **not_found** (string) - Indicates that the requested resource could not be found. ``` -------------------------------- ### Create Reminder API Request Example Source: https://crm.pachca.com/dev/tasks/new This snippet demonstrates the JSON payload structure required to create a new reminder. It includes essential fields like 'kind', 'content', 'due_at', 'priority', and 'custom_properties'. Ensure all required fields are present and correctly formatted. ```json { "task": { "kind": "reminder", "content": "Забрать со склада 21 заказ", "due_at": "2020-06-05T12:00:00.000+0300", "priority": 2, "custom_properties": [ { "id": 78, "value": "Синий склад" } ] } } ``` -------------------------------- ### GET /api/shared/v1/profile - Get Profile Information Source: https://crm.pachca.com/dev/profile/get Retrieves detailed information about the currently authenticated user's profile. ```APIDOC ## GET /api/shared/v1/profile ### Description This endpoint retrieves information about the current user's profile. ### Method GET ### Endpoint https://api.pachca.com/api/shared/v1/profile ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **data** (object) - Contains the user's profile information. - **id** (integer) - User identifier. - **first_name** (string) - First name. - **last_name** (string) - Last name. - **nickname** (string) - Username. - **email** (string) - Email address. - **phone_number** (string) - Phone number. - **department** (string) - Department. - **title** (string) - Job title. - **role** (string) - Access level: admin (administrator), user (employee), multi_guest (multi-guest). - **suspended** (boolean) - User deactivation status. True if the user is deactivated. - **invite_status** (string) - Invitation status: confirmed (accepted), sent (sent). - **list_tags** (array of strings) - Array of tags associated with the employee. - **custom_properties** (array of objects) - Employee custom properties. - **id** (integer) - Field identifier. - **name** (string) - Field name. - **data_type** (string) - Field type (string, number, date, or link). - **value** (string) - Field value. - **user_status** (object or null) - User status. - **emoji** (string) - Status emoji. - **title** (string) - Status text. - **expires_at** (string or null) - Status expiration date (ISO-8601, UTC+0) in YYYY-MM-DDThh:mm:ss.sssZ format. Null if not set. - **bot** (boolean) - Type: user (false) or bot (true). - **created_at** (string) - Creation date (ISO-8601, UTC+0) in YYYY-MM-DDThh:mm:ss.sssZ format. - **last_activity_at** (string) - Date of last user activity (ISO-8601, UTC+0) in YYYY-MM-DDThh:mm:ss.sssZ format. - **time_zone** (string) - User's time zone. - **image_url** (string or null) - Link to download the user's avatar. #### Response Example ```json { "data": { "id": 12345, "first_name": "Иван", "last_name": "Петров", "nickname": "ivan.petrov", "email": "ivan.petrov@example.com", "phone_number": "+79123456789", "department": "IT", "title": "Software Engineer", "role": "user", "suspended": false, "invite_status": "confirmed", "list_tags": ["backend", "python"], "custom_properties": [ { "id": 1, "name": "Project Code", "data_type": "string", "value": "CRM-DEV" } ], "user_status": { "emoji": "🚀", "title": "Working on a new feature", "expires_at": null }, "bot": false, "created_at": "2023-01-15T10:30:00.000Z", "last_activity_at": "2023-10-27T15:45:00.000Z", "time_zone": "Europe/Moscow", "image_url": "https://api.pachca.com/api/v1/images/avatars/12345.jpg" } } ``` ``` -------------------------------- ### Create New User (OpenAPI) Source: https://crm.pachca.com/dev/users/new Defines the OpenAPI specification for creating a new employee via the '/users' POST endpoint. It specifies the required request body parameters, including user details like name, email, role, and custom properties, as well as an option to skip email notifications. The response schema for a successful creation is also detailed. ```yaml openapi: 3.1.0 info: title: Новый сотрудник version: 1.0.0 servers: - url: https://api.pachca.com/api/shared/v1 paths: /users: post: summary: создание нового сотрудника tags: - Users requestBody: required: true content: application/json: schema: type: object properties: user: type: object properties: first_name: type: string description: Имя last_name: type: string description: Фамилия nickname: type: string description: Имя пользователя email: type: string description: Электронная почта phone_number: type: string description: Телефон department: type: string description: Департамент title: type: string description: Должность role: type: string description: 'Уровень доступа: admin (администратор), user (сотрудник), multi_guest (мульти-гость)' suspended: type: boolean description: Деактивация пользователя. При значении true пользователь является деактивированным. list_tags: type: array items: type: string description: Массив тегов, привязываемых к сотруднику custom_properties: type: array items: type: object properties: id: type: integer description: Идентификатор поля value: type: string description: Устанавливаемое значение description: Задаваемые дополнительные поля required: - email description: Собранный объект параметров создаваемого сотрудника skip_email_notify: type: boolean description: >- Пропуск этапа отправки приглашения сотруднику (при значении true сотруднику не будет отправлено письмо на электронную почту с приглашением создать аккаунт). Данный параметр полезен в случае предварительного создания аккаунтов сотрудникам перед их входом через SSO. required: - user responses: '200': description: Успешный ответ content: application/json: schema: type: object properties: data: type: object properties: id: type: integer description: Идентификатор созданного пользователя first_name: type: string description: Имя last_name: type: string description: Фамилия nickname: type: string description: Имя пользователя email: type: string description: Электронная почта phone_number: type: string description: Телефон department: type: string description: Департамент title: type: string description: Должность role: type: string description: 'Уровень доступа: admin (администратор), user (сотрудник), multi_guest (мульти-гость)' suspended: type: boolean description: Деактивация пользователя. При значении true пользователь является деактивированным. invite_status: type: string description: 'Статус пришлашения: confirmed (принято), sent (отправлено)' list_tags: type: array items: type: string description: Массив тегов, привязанных к сотруднику ``` -------------------------------- ### Pin Message API Request Example Source: https://crm.pachca.com/dev/messages/pin/new Example of how to structure the URL for pinning a message. The message ID is a required parameter passed in the URL path. ```http POST https://api.pachca.com/api/shared/v1/messages/7231942/pin ```