---
updatedAt: 2025-12-08T08:34:18.000Z
agentTools:
  projectIndex: https://es-developers.kommo.com/llms.txt
---

# Vincular el chat a un contacto

The method allows you to link an existing chat to a contact.

# Parámetros de respuesta

| Parámetro   | Tipo de dato | Descripción                                           |
| :---------- | :----------- | :---------------------------------------------------- |
| chat\_id    | string       | ID del chat en la API de Chat de Kommo.               |
| contact\_id | int          | ID del contacto en Kommo.                             |
| id          | int          | ID del enlace entre el chat y el contacto.            |
| request\_id | string       | Número de la solicitud dentro del arreglo de entrada. |

**Encabezado de tipo de datos cuando la solicitud es exitosa/en caso de un error**\
Content-Type: application/json.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "kommo-api",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://{subdominio}.kommo.com",
      "variables": {
        "subdominio": {
          "default": "subdominio"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/api/v4/contacts/chats": {
      "post": {
        "summary": "Paso 4: Vincular el chat a un contacto",
        "description": "The method allows you to link an existing chat to a contact.",
        "operationId": "paso-4-vincular-el-chat-a-un-contacto",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "application/json"
              ],
              "default": "application/json"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "contact_id": {
                          "type": "string",
                          "description": "ID del contacto en Kommo"
                        },
                        "chat_id": {
                          "type": "string",
                          "description": "ID del chat en la API de Chats de Kommo"
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": [
                    {
                      "contact_id": 111111111,
                      "chat_id": "XXXXXXXX-369e-48f6-87d2-562e77bc59e6"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Entidades vinculadas con éxito": {
                    "value": "{\n   \"_total_items\": 1,\n   \"_embedded\": {\n       \"chats\": [\n           {\n               \"chat_id\": \"XXXXXXX-369e-48f6-87d2-562e77bc59e6\",\n               \"contact_id\": 1111111,\n               \"id\": 2222222,\n               \"request_id\": \"0\"\n           }\n       ]\n   }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_total_items": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "_embedded": {
                      "type": "object",
                      "properties": {
                        "chats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "chat_id": {
                                "type": "string",
                                "example": "XXXXXXX-369e-48f6-87d2-562e77bc59e6"
                              },
                              "contact_id": {
                                "type": "integer",
                                "example": 1111111,
                                "default": 0
                              },
                              "id": {
                                "type": "integer",
                                "example": 2222222,
                                "default": 0
                              },
                              "request_id": {
                                "type": "string",
                                "example": "0"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Datos transmitidos inválidos. Detalles disponibles en el cuerpo de la respuesta": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "El usuario no está autorizado": {
                    "value": "{\n  \"title\": \"Unauthorized\",\n  \"type\": \"https://httpstatus.es/401\",\n  \"status\": 401,\n  \"detail\": \"Nombre de usuario o contraseña incorrectos\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "type": {
                      "type": "string",
                      "example": "https://httpstatus.es/401"
                    },
                    "status": {
                      "type": "integer",
                      "example": 401,
                      "default": 0
                    },
                    "detail": {
                      "type": "string",
                      "example": "Nombre de usuario o contraseña incorrectos"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "examples": {
                  "No tienes los derechos suficientes para llamar a este método": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```