Block or Unblock Contact
curl --request PUT \
--url http://localhost:8080/api/v1/contacts/{id}/block \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": false
}
'import requests
url = "http://localhost:8080/api/v1/contacts/{id}/block"
payload = { "enabled": False }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: false})
};
fetch('http://localhost:8080/api/v1/contacts/{id}/block', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/contacts/{id}/block",
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([
'enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/api/v1/contacts/{id}/block"
payload := strings.NewReader("{\n \"enabled\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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("http://localhost:8080/api/v1/contacts/{id}/block")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/contacts/{id}/block")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"type": "<string>",
"availability_status": "<string>",
"avatar_url": "<string>",
"phone_number": "<string>",
"phone_number_country_code": "<string>",
"custom_attributes": {},
"enabled": true,
"last_active_at": "2023-11-07T05:31:56Z",
"last_login_at": "2023-11-07T05:31:56Z",
"roles": [
"<string>"
],
"permissions": [
"<string>"
],
"teams": [
{}
],
"api_key": "<string>",
"api_key_last_used_at": "2023-11-07T05:31:56Z"
}
}Contacts
Block or Unblock Contact
PUT
/
api
/
v1
/
contacts
/
{id}
/
block
Block or Unblock Contact
curl --request PUT \
--url http://localhost:8080/api/v1/contacts/{id}/block \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": false
}
'import requests
url = "http://localhost:8080/api/v1/contacts/{id}/block"
payload = { "enabled": False }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: false})
};
fetch('http://localhost:8080/api/v1/contacts/{id}/block', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/contacts/{id}/block",
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([
'enabled' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/api/v1/contacts/{id}/block"
payload := strings.NewReader("{\n \"enabled\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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("http://localhost:8080/api/v1/contacts/{id}/block")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/contacts/{id}/block")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"type": "<string>",
"availability_status": "<string>",
"avatar_url": "<string>",
"phone_number": "<string>",
"phone_number_country_code": "<string>",
"custom_attributes": {},
"enabled": true,
"last_active_at": "2023-11-07T05:31:56Z",
"last_login_at": "2023-11-07T05:31:56Z",
"roles": [
"<string>"
],
"permissions": [
"<string>"
],
"teams": [
{}
],
"api_key": "<string>",
"api_key_last_used_at": "2023-11-07T05:31:56Z"
}
}Authorizations
basicAuthtokenAuth
Basic authentication using base64 encoded API key and secret. Format: Authorization: Basic <base64(api_key:api_secret)>
Path Parameters
Body
application/json
Update the contact's block status.
Set to false to block, true to unblock
Example:
false
Was this page helpful?
⌘I

