{ "openapi": "3.1.0", "info": { "description": "This is a Zoho Mail API OpenAPI 3.0 specification", "title": "Zoho Mail API", "version": "1.0.0" }, "tags": [ { "name": "labels", "description": "The Label APIs help you to get and update information about the label details of a particular user account.", "externalDocs": { "url": "https://www.zoho.com/mail/help/api/labels-api.html", "description": "Find out more" } } ], "paths": { "/api/accounts/{accountId}/labels": { "post": { "tags": [ "labels" ], "x-mcp-group": [ "Labels" ], "summary": "Create a New Label", "description": "The API creates a new label in the specified account.", "operationId": "createLabel", "x-command": "create", "parameters": [ { "name": "accountId", "in": "path", "description": "This parameter is used to identify the account whose details are retrieved. This parameter can be retrieved from the Get User Account Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--account" ] }, "x-custom-input-handler": { "handlerMethod": "getAccountId", "handlerType2": true } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateLabelRequest" } } } }, "responses": { "201": { "description": "Successfully created new label", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateLabelResponse" } } } } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.tags.ALL", "ZohoMail.tags.CREATE" ] } ] }, "get": { "tags": [ "labels" ], "x-mcp-group": [ "Labels" ], "summary": "Get All Label Details", "description": "This API retrieves all label details for the specified account based on the account ID provided in the request.", "operationId": "getAllLabelDetails", "x-command": "list", "parameters": [ { "name": "accountId", "in": "path", "description": "This parameter is used to identify the account whose details are retrieved. This parameter can be retrieved from the Get User Account Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--account" ] }, "x-custom-input-handler": { "handlerMethod": "getAccountId", "handlerType2": true } }, { "name": "fields", "in": "query", "required": true, "description": "Comma-separated list of fields to include in the response. Allowed values: labelId, displayName, color, tagId, sequence, URI. Default: fields=labelId,displayName", "schema": { "type": "string", "default": "labelId,displayName" } } ], "responses": { "200": { "description": "Successfully retrieved all label details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetAllLabelsResponse" } } } } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.tags.ALL", "ZohoMail.tags.READ" ] } ] } }, "/api/accounts/{accountId}/labels/{labelId}": { "get": { "tags": [ "labels" ], "x-mcp-group": [ "Labels" ], "summary": "Get a Specific Label Details", "description": "This API retrieves the details of a specific label based on the Account ID and the Label ID provided in the request.", "operationId": "getSpecificLabelDetails", "x-command": "inspect", "parameters": [ { "name": "accountId", "in": "path", "description": "This parameter is used to identify the account whose details are retrieved. This parameter can be retrieved from the Get User Account Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--account" ] }, "x-custom-input-handler": { "handlerMethod": "getAccountId", "handlerType2": true } }, { "name": "labelId", "in": "path", "description": "This parameter is used to identify the label whose details are retrieved. This parameter can be retrieved from the Get All Label Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--label-id" ] } } ], "responses": { "200": { "description": "Successfully retrieved specific label details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetSpecificLabelResponse" } } } } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.tags.ALL", "ZohoMail.tags.READ" ] } ] }, "put": { "tags": [ "labels" ], "x-mcp-group": [ "Labels" ], "summary": "Update Label Details", "description": "This API updates the particular Label with the given display name and colour.", "operationId": "updateLabelDetails", "x-command": "update", "parameters": [ { "name": "accountId", "in": "path", "description": "This parameter is used to identify the account whose details are retrieved. This parameter can be retrieved from the Get User Account Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--account" ] }, "x-custom-input-handler": { "handlerMethod": "getAccountId", "handlerType2": true } }, { "name": "labelId", "in": "path", "description": "This parameter is used to identify the label whose details are retrieved. This parameter can be retrieved from the Get All Label Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--label-id" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateLabelRequest" } } } }, "responses": { "200": { "description": "Successfully updated label details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.tags.ALL", "ZohoMail.tags.UPDATE" ] } ] }, "delete": { "tags": [ "labels" ], "x-mcp-group": [ "Labels" ], "summary": "Delete a Label", "description": "This API deletes the label and removes the label from all the associated messages.", "operationId": "deleteLabel", "x-command": "delete", "parameters": [ { "name": "accountId", "in": "path", "description": "This parameter is used to identify the account whose details are retrieved. This parameter can be retrieved from the Get User Account Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--account" ] }, "x-custom-input-handler": { "handlerMethod": "getAccountId", "handlerType2": true } }, { "name": "labelId", "in": "path", "description": "This parameter is used to identify the label whose details are retrieved. This parameter can be retrieved from the Get All Label Details API.", "required": true, "schema": { "type": "string" }, "x-option-meta": { "names": [ "--label-id" ] } } ], "responses": { "200": { "description": "Successfully deleted the label", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NoDataResponse" } } } } }, "security": [ { "iam-oauth2-schema": [ "ZohoMail.tags.ALL", "ZohoMail.tags.DELETE" ] } ] } } }, "components": { "schemas": { "Status": { "type": "object", "properties": { "code": { "type": "integer", "examples": [ 200 ] }, "description": { "type": "string", "examples": [ "success" ] } } }, "NoDataResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" } } }, "CreateLabelRequest": { "type": "object", "required": [ "displayName" ], "properties": { "displayName": { "type": "string", "description": "Specify a name to the label.", "x-option-meta": { "names": [ "--display-name" ] } }, "color": { "type": "string", "description": "Specify a color for the label using its hexadecimal value. Default color will be #ffd700.", "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "example": "#FFD700", "x-option-meta": { "names": [ "--color" ] } } } }, "CreateLabelResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" }, "data": { "$ref": "#/components/schemas/LabelDetails" } } }, "GetAllLabelsResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/LabelDetails" } } } }, "LabelDetails": { "type": "object", "properties": { "sequence": { "type": "integer", "example": 1 }, "labelId": { "type": "string", "example": "2674552000000009027" }, "color": { "type": "string", "example": "#96ccf5" }, "tagId": { "type": "string", "example": "2674552000000009027" }, "displayName": { "type": "string", "example": "testing" }, "URI": { "type": "string", "example": "https://mail.zoho.com/api/accounts/12345678/labels/2674552000000009027" } } }, "GetSpecificLabelResponse": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" }, "data": { "$ref": "#/components/schemas/LabelDetails" } } }, "UpdateLabelRequest": { "type": "object", "properties": { "displayName": { "type": "string", "description": "Specify a name to the label.", "x-option-meta": { "names": [ "--display-name" ] } }, "color": { "type": "string", "description": "Specifies a colour for the label using its hexadecimal value.", "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", "example": "#FFD700", "x-option-meta": { "names": [ "--color" ] } } } } }, "securitySchemes": { "iam-oauth2-schema": { "type": "oauth2", "flows": { "authorizationCode": { "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth", "tokenUrl": "https://accounts.zoho.com/oauth/v2/token", "scopes": { "ZohoMail.tags.ALL": "Full access to labels", "ZohoMail.tags.READ": "Read access to labels", "ZohoMail.tags.CREATE": "Create access to labels", "ZohoMail.tags.UPDATE": "Update access to labels", "ZohoMail.tags.DELETE": "Delete access to labels" } } } } } } }