Zoho CRM Contact Roles

Contact role API. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 7 operation(s).

OpenAPI Specification

zoho-crm-contact-roles-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Contact Roles",
    "description": "Contact role API",
    "version": "8"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au"
          ],
          "default": "com",
          "description": "API Server URL TLD"
        },
        "version": {
          "default": "v8",
          "description": "API Version"
        }
      }
    }
  ],
  "security": [
    {
      "iam-oauth2-schema": [
        "ZohoCRM.modules.ALL",
        "ZohoCRM.modules.contacts.READ",
        "ZohoCRM.modules.contacts.CREATE",
        "ZohoCRM.modules.contacts.UPDATE",
        "ZohoCRM.modules.contacts.DELETE",
        "ZohoCRM.modules.contacts.WRITE"
      ]
    }
  ],
  "paths": {
    "/contacts/roles": {
      "get": {
        "summary": "Get Contact Roles",
        "description": "Retrieves a list of contact roles",
        "operationId": "getContactRoles",
        "responses": {
          "200": {
            "description": "Contact roles retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Response containing contact roles",
                  "additionalProperties": false,
                  "properties": {
                    "contact_roles": {
                      "type": "array",
                      "description": "Array of contact roles",
                      "maxItems": 100,
                      "items": {
                        "type": "object",
                        "description": "Contact role details",
                        "additionalProperties": false,
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Name of the contact role",
                            "pattern": "[A-Za-z0-9 ]",
                            "maxLength": 50
                          },
                          "id": {
                            "type": "string",
                            "description": "Unique identifier for the contact role",
                            "maxLength": 19
                          },
                          "sequence_number": {
                            "type": "number",
                            "description": "Sequence number for ordering"
                          }
                        },
                        "required": [
                          "name",
                          "id",
                          "sequence_number"
                        ]
                      }
                    }
                  },
                  "required": [
                    "contact_roles"
                  ]
                }
              }
            }
          },
          "204": {
            "description": "No contact roles found"
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.contacts.READ"
            ]
          }
        ]
      },
      "post": {
        "summary": "Create Contact Roles",
        "description": "Creates one or more contact roles.",
        "operationId": "createRoles",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Request body for creating contact roles",
                "additionalProperties": false,
                "properties": {
                  "contact_roles": {
                    "type": "array",
                    "description": "Array of contact roles to create",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "description": "Contact role details",
                      "additionalProperties": false,
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Name of the contact role",
                          "pattern": "[A-Za-z0-9 ]{1,50}",
                          "maxLength": 50
                        },
                        "sequence_number": {
                          "type": "number",
                          "description": "Sequence number for ordering"
                        }
                      },
                      "required": [
                        "name",
                        "sequence_number"
                      ]
                    }
                  }
                },
                "required": [
                  "contact_roles"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contact Role created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Response object for successful contact role creation.",
                  "additionalProperties": false,
                  "properties": {
                    "contact_roles": {
                      "type": "array",
                      "description": "Array of contact role creation results",
                      "maxItems": 100,
                      "items": {
                        "type": "object",
                        "description": "Contact role creation result details.",
                        "additionalProperties": false,
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Status code for the operation.",
                            "enum": [
                              "SUCCESS"
                            ]
                          },
                          "details": {
                            "type": "object",
                            "description": "Details of the created contact role.",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Unique identifier for the created contact role.",
                                "maxLength": 19
                              }
                            },
                            "required": [
                              "id"
                            ]
                          },
                          "message": {
                            "type": "string",
                            "description": "Operation message.",
                            "maxLength": 255
                          },
                          "status": {
                            "type": "string",
                            "description": "Operation status.",
                            "enum": [
                              "success"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "details",
                          "message",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "contact_roles"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error in creating contact roles",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Error response with array of contact role errors.",
                      "additionalProperties": false,
                      "properties": {
                        "contact_roles": {
                          "type": "array",
                          "description": "Array of error responses for contact roles.",
                          "maxItems": 100,
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "description": "Invalid data error.",
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "description": "Error code.",
                                    "enum": [
                                      "INVALID_DATA"
                                    ]
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "Error message.",
                                    "maxLength": 255
                                  },
                                  "details": {
                                    "type": "object",
                                    "description": "Error details.",
                                    "additionalProperties": false,
                                    "properties": {
                                      "api_name": {
                                        "type": "string",
                                        "description": "API name of the field.",
                                        "maxLength": 100
                                      },
                                      "json_path": {
                                        "type": "string",
                                        "description": "JSON path to the field.",
                                        "maxLength": 255
                                      },
                                      "expected_data_type": {
                                        "type": "string",
                                        "description": "Expected data type for the field.",
                                        "maxLength": 100
                                      }
                                    },
                                    "required": [
                                      "api_name",
                                      "json_path",
                                      "expected_data_type"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "description": "Error status.",
                                    "enum": [
                                      "error"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "details",
                                  "status"
                                ]
                              },
                              {
                                "type": "object",
                                "description": "Mandatory field not found error.",
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "description": "Error code.",
                                    "enum": [
                                      "MANDATORY_NOT_FOUND"
                                    ]
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "Error message.",
                                    "maxLength": 255
                                  },
                                  "details": {
                                    "type": "object",
                                    "description": "Error details.",
                                    "additionalProperties": false,
                                    "properties": {
                                      "api_name": {
                                        "type": "string",
                                        "description": "API name of the field.",
                                        "maxLength": 100
                                      },
                                      "json_path": {
                                        "type": "string",
                                        "description": "JSON path to the field.",
                                        "maxLength": 255
                                      }
                                    },
                                    "required": [
                                      "api_name",
                                      "json_path"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "description": "Error status.",
                                    "enum": [
                                      "error"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "details",
                                  "status"
                                ]
                              },
                              {
                                "type": "object",
                                "description": "Duplicate data error.",
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "description": "Error code.",
                                    "enum": [
                                      "DUPLICATE_DATA"
                                    ]
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "Error message.",
                                    "maxLength": 255
                                  },
                                  "details": {
                                    "type": "object",
                                    "description": "Error details.",
                                    "additionalProperties": false,
                                    "properties": {
                                      "api_name": {
                                        "type": "string",
                                        "description": "API name of the field.",
                                        "maxLength": 100
                                      },
                                      "json_path": {
                                        "type": "string",
                                        "description": "JSON path to the field.",
                                        "maxLength": 255
                                      }
                                    },
                                    "required": [
                                      "api_name",
                                      "json_path"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "description": "Error status.",
                                    "enum": [
                                      "error"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "details",
                                  "status"
                                ]
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "contact_roles"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.modules.contacts.WRITE"
            ]
          }
        ]
      },
      "put": {
        "summary": "Update Contact Roles",
        "description": "Updates one or more contact roles.",
        "operationId": "updateRoles",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Response containing a list of contact roles.",
                "additionalProperties": false,
                "properties": {
                  "contact_roles": {
                    "type": "array",
                    "description": "Array of contact role objects.",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "description": "Contact role details.",
                      "additionalProperties": false,
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Name of the contact role.",
                          "pattern": "[A-Za-z0-9 ]{1,50}",
                          "maxLength": 50
                        },
                        "id": {
                          "type": "string",
                          "description": "Unique identifier for the contact role.",
                          "maxLength": 19
                        },
                        "sequence_number": {
                          "type": "number",
                          "description": "Sequence number for ordering, can be object or null."
                        }
                      },
                      "required": [
                        "name",
                        "id"
                      ]
                    }
                  }
                },
                "required": [
                  "contact_roles"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contact role updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Response object for successful contact role update.",
                  "additionalProperties": false,
                  "properties": {
                    "contact_roles": {
                      "type": "array",
                      "description": "Array of contact role update results",
                      "maxItems": 100,
                      "items": {
                        "type": "object",
                        "description": "Contact role update result details.",
                        "additionalProperties": false,
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Status code for the operation.",
                            "enum": [
                              "SUCCESS"
                            ]
                          },
                          "details": {
                            "type": "object",
                            "description": "Details of the updated contact role.",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Unique identifier for the updated contact role.",
                                "maxLength": 19
                              }
                            },
                            "required": [
                              "id"
                            ]
                          },
                          "message": {
                            "type": "string",
                            "description": "Operation message.",
                            "maxLength": 255
                          },
                          "status": {
                            "type": "string",
                            "description": "Operation status.",
                            "enum": [
                              "success"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "details",
                          "message",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "contact_roles"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error in updating contact roles",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Error response wrapper for contact role update failures",
                      "additionalProperties": false,
                      "properties": {
                        "contact_roles": {
                          "type": "array",
                          "description": "Array of error responses for contact roles",
                          "maxItems": 100,
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "description": "Mandatory field not found error.",
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "description": "Error code.",
                                    "enum": [
                                      "MANDATORY_NOT_FOUND"
                                    ]
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "Error message.",
                                    "maxLength": 255
                                  },
                                  "details": {
                                    "type": "object",
                                    "description": "Error details.",
                                    "additionalProperties": false,
                                    "properties": {
                                      "api_name": {
                                        "type": "string",
                                        "description": "API name of the field.",
                                        "maxLength": 100
                                      },
                                      "json_path": {
                                        "type": "string",
                                        "description": "JSON path to the field.",
                                        "maxLength": 255
                                      }
                                    },
                                    "required": [
                                      "api_name",
                                      "json_path"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "description": "Error status.",
                                    "enum": [
                                      "error"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "details",
                                  "status"
                                ]
                              },
                              {
                                "type": "object",
                                "description": "Invalid data error.",
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "description": "Error code.",
                                    "enum": [
                                      "INVALID_DATA"
                                    ]
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "Error message.",
                                    "maxLength": 255
                                  },
                                  "details": {
                                    "type": "object",
                                    "description": "Error details.",
                                    "additionalProperties": false,
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "description": "ID of the invalid record.",
                                        "maxLength": 19
                                      },
                                      "api_name": {
                                        "type": "string",
                                        "description": "API name of the field.",
                                        "maxLength": 100
                                      },
                                      "json_path": {
                                        "type": "string",
                                        "description": "JSON path to the field.",
                                        "maxLength": 255
                                      }
                                    },
                                    "required": [
                                      "api_name",
                                      "json_path"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "description": "Error status.",
                                    "enum": [
                                      "error"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "details",
                                  "status"
                                ]
                              },
                              {
                                "type": "object",
                                "description": "Duplicate data error.",
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string",
                                    "description": "Error code.",
                                    "enum": [
                                      "DUPLICATE_DATA"
                                    ]
                                  },
                                  "message": {
                                    "type": "string",
                                    "description": "Error message.",
                                    "maxLength": 255
                                  },
                                  "details": {
                                    "type": "object",
                                    "description": "Error details.",
                                    "additionalProperties": false,
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "description": "ID of the duplicate record.",
                                        "maxLength": 19
                                      },
                                      "api_name": {
                                        "type": "string",
                                        "description": "API name of the field.",
                                        "maxLength": 100
                                      },
                                      "json_path": {
                                        "type": "string",
                                        "description": "JSON path to the field.",
                                        "maxLength": 255
                                      }
                                    },
                                    "required": [
                                      "api_name",
                                      "json_path"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "description": "Error status.",
                                    "enum": [
                                      "error"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "message",
                                  "details",
                                  "status"
                                ]
                              },
                              {
                                "type": "array",
                                "description": "Array of duplicate data errors",
                                "maxItems": 100,
                                "items": {
                                  "type": "object",
                                  "description": "Duplicate data error details",
                                  "additionalProperties": false,
                                  "properties": {
                                    "status": {
                                      "type": "string",
                                      "description": "Error status",
                                      "enum": [
                                        "error"
                                      ]
                                    },
                                    "code": {
                                      "type": "string",
                                      "description": "Error code",
                                      "enum": [
                                        "DUPLICATE_DATA"
                                      ]
                                    },
                                    "message": {
                                      "type": "string",
                                      "description": "Error

# --- truncated at 32 KB (70 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/zoho-crm/refs/heads/main/openapi/zoho-crm-contact-roles-openapi.json