Skip to main content
PUT
/
api
/
contact
Actualizar Contacto
curl --request PUT \
  --url https://api.plazbot.com/api/contact \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '
{
  "name": "<string>",
  "lastname": "<string>",
  "email": "<string>",
  "stageId": "<string>",
  "segmentationId": "<string>",
  "tags": [
    "<string>"
  ],
  "customFields": [
    {
      "code": "<string>",
      "value": "<string>"
    }
  ]
}
'
import requests

url = "https://api.plazbot.com/api/contact"

payload = {
"name": "<string>",
"lastname": "<string>",
"email": "<string>",
"stageId": "<string>",
"segmentationId": "<string>",
"tags": ["<string>"],
"customFields": [
{
"code": "<string>",
"value": "<string>"
}
]
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
lastname: '<string>',
email: '<string>',
stageId: '<string>',
segmentationId: '<string>',
tags: ['<string>'],
customFields: [{code: '<string>', value: '<string>'}]
})
};

fetch('https://api.plazbot.com/api/contact', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.plazbot.com/api/contact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'lastname' => '<string>',
'email' => '<string>',
'stageId' => '<string>',
'segmentationId' => '<string>',
'tags' => [
'<string>'
],
'customFields' => [
[
'code' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.plazbot.com/api/contact"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"lastname\": \"<string>\",\n \"email\": \"<string>\",\n \"stageId\": \"<string>\",\n \"segmentationId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customFields\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.plazbot.com/api/contact")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"lastname\": \"<string>\",\n \"email\": \"<string>\",\n \"stageId\": \"<string>\",\n \"segmentationId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customFields\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.plazbot.com/api/contact")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"lastname\": \"<string>\",\n \"email\": \"<string>\",\n \"stageId\": \"<string>\",\n \"segmentationId\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"customFields\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "code": 123,
  "errorCode": "<string>",
  "message": "<string>",
  "data": {
    "id": "<string>",
    "contact": {
      "id": "<string>",
      "creationDate": "2023-11-07T05:31:56Z",
      "assignedAgentId": "<string>",
      "assignedAgentName": "<string>",
      "segmentationId": "<string>",
      "lastMessage": "<string>",
      "lastMessageDate": "2023-11-07T05:31:56Z",
      "platformSenderId": "<string>",
      "platformSenderName": "<string>",
      "platformSenderPhone": "<string>",
      "platformSenderEmail": "<string>",
      "isRead": true,
      "isBotEnabled": true,
      "isManuallyAdded": true,
      "avatarColor": "<string>",
      "orderInCards": 123,
      "orderInCardsLastUpdated": "2023-11-07T05:31:56Z",
      "tags": [
        {
          "id": "<string>",
          "name": "<string>",
          "color": "<string>",
          "assignmentDate": "2023-11-07T05:31:56Z"
        }
      ],
      "customFields": [
        {
          "code": "<string>",
          "value": "<string>"
        }
      ],
      "files": [
        "<string>"
      ],
      "isSolved": true,
      "workspaceId": "<string>",
      "name": "<string>",
      "lastname": "<string>",
      "email": "<string>",
      "platformId": 123,
      "stageId": "<string>",
      "internalWhatsappNumber": "<string>",
      "blocked": true
    }
  }
}
{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}
{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}
{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}
{
"success": true,
"code": 123,
"message": "<string>",
"errorCode": "<string>"
}

Authorizations

Authorization
string
header
required

Token de autenticacion Bearer. Obtenga el token usando el endpoint /api/user/login

Headers

x-workspace-id
string
required

Identificador del workspace

Query Parameters

id
string
required

ID del contacto a actualizar

workspaceId
string
required

Identificador del workspace

Body

application/json
name
string

Nombre del contacto

lastname
string

Apellido del contacto

email
string | null

Correo electronico

stageId
string | null

ID de la etapa del contacto

segmentationId
string | null

ID de segmentacion

tags
string[]

IDs de etiquetas

customFields
object[]

Campos personalizados

Response

Contacto actualizado exitosamente

success
boolean
required

Indica si la operacion fue exitosa

code
integer
required

Codigo HTTP de la respuesta

errorCode
string | null
required

Codigo de error, null si no hay error

message
string
required

Mensaje descriptivo del resultado

data
object
required