Zone Operations / Text
Text
Read and mutate text on any text-bearing object, including styling.
POST
/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit
Canonical text mutation API for replace/insert/delete/split/merge operations
Canonical text mutation API for replace/insert/delete/split/merge operations
OperationCREATE
Rate limit60 requests / minute · per user
OAuth scopes
Vani.spaces.CREATEPath parameters edition_id · space_id · zone_id
| Name | Type | Description |
|---|---|---|
| edition_idREQUIRED | string | The unique identifier of the edition |
| space_idREQUIRED | string | The unique identifier of the space |
| zone_idREQUIRED | string | The unique identifier of the zone |
Request body application/json
Tick a field to put it in the sample payload, and set what it carries in the Value column. Every field is optional unless it is marked REQUIRED, and those are always sent.
| Field | Type | Description | Value |
|---|---|---|---|
| payload REQUIRED | object | EditText payload | |
| cursor | object | Cursor-scoped insert/delete mutation one of one of these — choosing this clears the others | |
| cursor_index REQUIRED | integer | Cursor index on flattened text | |
| text | string | Text to insert (required when operation=CURSOR_TEXT_OPERATION_INSERT_TEXT) (max length 500000) | |
| operation REQUIRED | string |
Cursor mutation operation (max length 50)
CURSOR_TEXT_OPERATION_UNSPECIFIEDCURSOR_TEXT_OPERATION_INSERT_TEXTCURSOR_TEXT_OPERATION_INSERT_NEWLINECURSOR_TEXT_OPERATION_DELETE_NEWLINE
|
|
| all_text | object | Full-text replace/delete mutation one of one of these — choosing this clears the others | |
| replacement_text | string | Replacement text (required when operation=ALL_TEXT_OPERATION_REPLACE) (max length 500000) | |
| operation REQUIRED | string |
Full-text mutation operation (max length 50)
ALL_TEXT_OPERATION_UNSPECIFIEDALL_TEXT_OPERATION_REPLACEALL_TEXT_OPERATION_DELETE
|
|
| range | object | Range-scoped replace/delete mutation one of one of these — choosing this clears the others | |
| replacement_text | string | Replacement text (required when operation=RANGE_TEXT_OPERATION_REPLACE) (max length 500000) | |
| range REQUIRED | object | Target range in flattened text | |
| start_index REQUIRED | integer | Inclusive start index on flattened text (>= 0) | |
| end_index REQUIRED | integer | Exclusive end index on flattened text (> start_index) | |
| operation REQUIRED | string |
Range mutation operation (max length 50)
RANGE_TEXT_OPERATION_UNSPECIFIEDRANGE_TEXT_OPERATION_REPLACERANGE_TEXT_OPERATION_DELETE
|
|
| object REQUIRED | object | Target text-bearing object | |
| zone_id | string | Zone containing the object (max length 200) | |
| object_id | string | Object id in the frame (max length 200) | |
| frame_id | string | Frame containing the object (max length 200) |
Request
POST
curl -X POST "https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit" \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"payload": {
"cursor": {
"cursor_index": 1,
"operation": "CURSOR_TEXT_OPERATION_UNSPECIFIED",
"text": "Hello Vani"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}'import requests
url = "https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit"
headers = {
"Authorization": "Zoho-oauthtoken YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
data = {
"payload": {
"cursor": {
"cursor_index": 1,
"operation": "CURSOR_TEXT_OPERATION_UNSPECIFIED",
"text": "Hello Vani"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)const https = require('https');
const url = require('url');
const options = {
...url.parse('https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit'),
method: 'POST',
headers: {
'Authorization': 'Zoho-oauthtoken YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
const result = JSON.parse(data);
// Process the response data
});
});
req.write(JSON.stringify({
"payload": {
"cursor": {
"cursor_index": 1,
"operation": "CURSOR_TEXT_OPERATION_UNSPECIFIED",
"text": "Hello Vani"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}));
req.end();import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.time.Duration;
public class ApiClient {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit"))
.header("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN")
.timeout(Duration.ofSeconds(30));
.header("Content-Type", "application/json")
String requestBody = "{\"payload\":{\"cursor\":{\"cursor_index\":1,\"operation\":\"CURSOR_TEXT_OPERATION_UNSPECIFIED\",\"text\":\"Hello Vani\"}},\"object\":{\"zone_id\":\"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\"object_id\":\"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\"frame_id\":\"f47ac10b-58cc-4372-a567-0e02b2c3d479\"}}";
HttpRequest request = requestBuilder
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}info "Making API request to: https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit";
headers = Map();
headers.put("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN");
headers.put("Content-Type", "application/json");
requestData = {"payload": {"cursor": {"cursor_index": 1, "operation": "CURSOR_TEXT_OPERATION_UNSPECIFIED", "text": "Hello Vani"}}, "object": {"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"}};
response = invokeurl
[
url: "https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit"
type: POST
headers: headers
parameters: requestData
];
if (response.get("status_code") == 200) {
info "Request successful";
responseData = response.get("response");
info responseData;
} else {
info "Request failed with status: " + response.get("status_code");
info response.get("response");
}{
"payload": {
"cursor": {
"cursor_index": 1,
"operation": "CURSOR_TEXT_OPERATION_UNSPECIFIED",
"text": "Hello Vani"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}
Response
Successful response
{
"status": "success",
"data": {},
"message": "Request completed successfully",
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit"
}
Invalid request - validation failed
{
"error": {
"details": {
"error_code": "IAM1031",
"message": "Invalid request - validation failed"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit",
"status": "error"
}
Unauthorized - missing or invalid access token
{
"error": {
"details": {
"error_code": "IAM1100",
"message": "Unauthorized - missing or invalid access token"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit",
"status": "error"
}
Not found - a resource named in the path does not exist, or is not visible to the caller
{
"error": {
"details": {
"error_code": "IAM1001",
"message": "Not found - a resource named in the path does not exist, or is not visible to the caller"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit",
"status": "error"
}
Rate limit exceeded - this operation allows 60 requests per minute per user
{
"error": {
"details": {
"error_code": "IAM1055",
"message": "Rate limit exceeded - this operation allows 60 requests per minute per user"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit",
"status": "error"
}
Internal server error - the request was well-formed but could not be completed
{
"error": {
"details": {
"error_code": "U1001",
"message": "Internal server error - the request was well-formed but could not be completed"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/edit",
"status": "error"
}
Errors
5 status codes
400 Invalid request - validation failed 401 Unauthorized - missing or invalid access token 404 Not found - a resource named in the path does not exist, or is not visible to the caller 429 Rate limit exceeded - this operation allows 60 requests per minute per user 500 Internal server error - the request was well-formed but could not be completed
POST
/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style
Apply portion and or paragraph style to selected text scope
Apply portion and or paragraph style to selected text scope
OperationCREATE
Rate limit60 requests / minute · per user
OAuth scopes
Vani.spaces.CREATEPath parameters edition_id · space_id · zone_id
| Name | Type | Description |
|---|---|---|
| edition_idREQUIRED | string | The unique identifier of the edition |
| space_idREQUIRED | string | The unique identifier of the space |
| zone_idREQUIRED | string | The unique identifier of the zone |
Request body application/json
Tick a field to put it in the sample payload, and set what it carries in the Value column. Every field is optional unless it is marked REQUIRED, and those are always sent.
| Field | Type | Description | Value |
|---|---|---|---|
| payload REQUIRED | object | ApplyTextStyle payload | |
| all_text | boolean | Apply style to entire flattened text when true | |
| portion_style | object | Optional portion style patch | |
| fontweight | string |
Optional font weight token (max length 100)
THINEXTRA_LIGHTLIGHTNORMALMEDIUMDEMI_BOLDBOLDHEAVYBLACK
|
|
| size | number | Optional portion font size | |
| color | object | Optional text color patch | |
| hsb | object | HSB color value one of one of these — choosing this clears the others | |
| saturation | number | Saturation 0-1 | |
| brightness | number | Brightness 0-1 | |
| hue | number | Hue in degrees | |
| hex | object | Hex color value one of one of these — choosing this clears the others | |
| value | string | Hex color literal such as #8B4513 (max length 50) | |
| rgb | object | RGB color value one of one of these — choosing this clears the others | |
| red | integer | Red channel 0-255 | |
| green | integer | Green channel 0-255 | |
| blue | integer | Blue channel 0-255 | |
| underline | boolean | Optional underline toggle | |
| strike | boolean | Optional strike toggle | |
| italic | boolean | Optional italic toggle | |
| font_name | object | Optional font family/style patch | |
| name | string | Font display name (max length 500) | |
| style | string | Optional font style token (max length 200) | |
| range | object | Apply style within selected range | |
| start_index REQUIRED | integer | Inclusive start index on flattened text (>= 0) | |
| end_index REQUIRED | integer | Exclusive end index on flattened text (> start_index) | |
| paragraph_style | object | Optional paragraph style patch | |
| spacing | object | Optional paragraph spacing patch | |
| before | integer | Optional space before paragraph, in points (>= 0) | |
| line | number | Optional line-height multiplier (e.g. 1.5 = 150%) | |
| after | integer | Optional space after paragraph, in points (>= 0) | |
| level | integer | Optional paragraph level | |
| halign | string |
Optional paragraph alignment token (max length 50)
LEFTCENTERRIGHTJUSTIFY
|
|
| object REQUIRED | object | Target text-bearing object | |
| zone_id | string | Zone containing the object (max length 200) | |
| object_id | string | Object id in the frame (max length 200) | |
| frame_id | string | Frame containing the object (max length 200) |
Request
POST
curl -X POST "https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style" \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"payload": {
"all_text": true,
"portion_style": {
"fontweight": "THIN",
"size": 1.5,
"color": {
"hsb": {
"saturation": 1.5,
"brightness": 1.5,
"hue": 1.5
}
},
"underline": true,
"strike": true,
"italic": true,
"font_name": {
"name": "Sample name",
"style": "string"
}
},
"range": {
"start_index": 1,
"end_index": 1
},
"paragraph_style": {
"spacing": {
"before": 1,
"line": 1.5,
"after": 1
},
"level": 1,
"halign": "LEFT"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}'import requests
url = "https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style"
headers = {
"Authorization": "Zoho-oauthtoken YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
data = {
"payload": {
"all_text": true,
"portion_style": {
"fontweight": "THIN",
"size": 1.5,
"color": {
"hsb": {
"saturation": 1.5,
"brightness": 1.5,
"hue": 1.5
}
},
"underline": true,
"strike": true,
"italic": true,
"font_name": {
"name": "Sample name",
"style": "string"
}
},
"range": {
"start_index": 1,
"end_index": 1
},
"paragraph_style": {
"spacing": {
"before": 1,
"line": 1.5,
"after": 1
},
"level": 1,
"halign": "LEFT"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}
response = requests.post(url, headers=headers, json=data)
data = response.json()
print(data)const https = require('https');
const url = require('url');
const options = {
...url.parse('https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style'),
method: 'POST',
headers: {
'Authorization': 'Zoho-oauthtoken YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
const result = JSON.parse(data);
// Process the response data
});
});
req.write(JSON.stringify({
"payload": {
"all_text": true,
"portion_style": {
"fontweight": "THIN",
"size": 1.5,
"color": {
"hsb": {
"saturation": 1.5,
"brightness": 1.5,
"hue": 1.5
}
},
"underline": true,
"strike": true,
"italic": true,
"font_name": {
"name": "Sample name",
"style": "string"
}
},
"range": {
"start_index": 1,
"end_index": 1
},
"paragraph_style": {
"spacing": {
"before": 1,
"line": 1.5,
"after": 1
},
"level": 1,
"halign": "LEFT"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}));
req.end();import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.time.Duration;
public class ApiClient {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style"))
.header("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN")
.timeout(Duration.ofSeconds(30));
.header("Content-Type", "application/json")
String requestBody = "{\"payload\":{\"all_text\":true,\"portion_style\":{\"fontweight\":\"THIN\",\"size\":1.5,\"color\":{\"hsb\":{\"saturation\":1.5,\"brightness\":1.5,\"hue\":1.5}},\"underline\":true,\"strike\":true,\"italic\":true,\"font_name\":{\"name\":\"Sample name\",\"style\":\"string\"}},\"range\":{\"start_index\":1,\"end_index\":1},\"paragraph_style\":{\"spacing\":{\"before\":1,\"line\":1.5,\"after\":1},\"level\":1,\"halign\":\"LEFT\"}},\"object\":{\"zone_id\":\"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\"object_id\":\"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\"frame_id\":\"f47ac10b-58cc-4372-a567-0e02b2c3d479\"}}";
HttpRequest request = requestBuilder
.POST(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}info "Making API request to: https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style";
headers = Map();
headers.put("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN");
headers.put("Content-Type", "application/json");
requestData = {"payload": {"all_text": true, "portion_style": {"fontweight": "THIN", "size": 1.5, "color": {"hsb": {"saturation": 1.5, "brightness": 1.5, "hue": 1.5}}, "underline": true, "strike": true, "italic": true, "font_name": {"name": "Sample name", "style": "string"}}, "range": {"start_index": 1, "end_index": 1}, "paragraph_style": {"spacing": {"before": 1, "line": 1.5, "after": 1}, "level": 1, "halign": "LEFT"}}, "object": {"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"}};
response = invokeurl
[
url: "https://api.app.vanihq.com/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style"
type: POST
headers: headers
parameters: requestData
];
if (response.get("status_code") == 200) {
info "Request successful";
responseData = response.get("response");
info responseData;
} else {
info "Request failed with status: " + response.get("status_code");
info response.get("response");
}{
"payload": {
"all_text": true,
"portion_style": {
"fontweight": "THIN",
"size": 1.5,
"color": {
"hsb": {
"saturation": 1.5,
"brightness": 1.5,
"hue": 1.5
}
},
"underline": true,
"strike": true,
"italic": true,
"font_name": {
"name": "Sample name",
"style": "string"
}
},
"range": {
"start_index": 1,
"end_index": 1
},
"paragraph_style": {
"spacing": {
"before": 1,
"line": 1.5,
"after": 1
},
"level": 1,
"halign": "LEFT"
}
},
"object": {
"zone_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"object_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"frame_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
}
Response
Successful response
{
"status": "success",
"data": {},
"message": "Request completed successfully",
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style"
}
Invalid request - validation failed
{
"error": {
"details": {
"error_code": "IAM1031",
"message": "Invalid request - validation failed"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style",
"status": "error"
}
Unauthorized - missing or invalid access token
{
"error": {
"details": {
"error_code": "IAM1100",
"message": "Unauthorized - missing or invalid access token"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style",
"status": "error"
}
Not found - a resource named in the path does not exist, or is not visible to the caller
{
"error": {
"details": {
"error_code": "IAM1001",
"message": "Not found - a resource named in the path does not exist, or is not visible to the caller"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style",
"status": "error"
}
Rate limit exceeded - this operation allows 60 requests per minute per user
{
"error": {
"details": {
"error_code": "IAM1055",
"message": "Rate limit exceeded - this operation allows 60 requests per minute per user"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style",
"status": "error"
}
Internal server error - the request was well-formed but could not be completed
{
"error": {
"details": {
"error_code": "U1001",
"message": "Internal server error - the request was well-formed but could not be completed"
}
},
"request_uri": "/sdk/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/text/style",
"status": "error"
}
Errors
5 status codes
400 Invalid request - validation failed 401 Unauthorized - missing or invalid access token 404 Not found - a resource named in the path does not exist, or is not visible to the caller 429 Rate limit exceeded - this operation allows 60 requests per minute per user 500 Internal server error - the request was well-formed but could not be completed