Zoho CRM Data Sharing

Data Sharing. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 2 operation(s).

OpenAPI Specification

zoho-crm-data-sharing-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Data Sharing",
    "description": "Data Sharing",
    "version": "8.0"
  },
  "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"
        }
      }
    }
  ],
  "paths": {
    "/settings/data_sharing": {
      "get": {
        "operationId": "getDataSharing",
        "summary": "Get Data Sharing",
        "description": "Get the data sharing settings configured.API exposed to customers",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.data_sharing.READ"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.data_sharing.ALL"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Data Sharing Get Response",
                  "properties": {
                    "data_sharing": {
                      "type": "array",
                      "description": "List of Data Sharing Settings",
                      "maxItems": 50,
                      "items": {
                        "type": "object",
                        "description": "Data Sharing Setting",
                        "properties": {
                          "share_type": {
                            "type": "string",
                            "description": "Stores the module-level data sharing permission type",
                            "enum": [
                              "private",
                              "public_read_write",
                              "public",
                              "public_read_only"
                            ]
                          },
                          "public_in_portals": {
                            "type": "boolean",
                            "description": "Indicates whether the module is made as public in portals"
                          },
                          "module": {
                            "type": "object",
                            "description": "Module Information",
                            "properties": {
                              "api_name": {
                                "type": "string",
                                "description": "API Name of the Module",
                                "maxLength": 100
                              },
                              "id": {
                                "type": "string",
                                "description": "ID of the Module",
                                "maxLength": 20
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "api_name",
                              "id"
                            ]
                          },
                          "rule_computation_running": {
                            "type": "boolean",
                            "description": "Indicates whether the sharing rules computation is currently running for the module"
                          }
                        },
                        "additionalProperties": false,
                        "required": [
                          "share_type",
                          "public_in_portals",
                          "module",
                          "rule_computation_running"
                        ]
                      }
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "data_sharing"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "User does not have sufficient permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Data sharing get forbidden",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "Error Code",
                      "enum": [
                        "NO_PERMISSION"
                      ]
                    },
                    "details": {
                      "type": "object",
                      "description": "Error Details",
                      "properties": {
                        "permissions": {
                          "type": "array",
                          "description": "List of missing permissions",
                          "maxItems": 1,
                          "items": {
                            "type": "string",
                            "description": "Permission Name",
                            "enum": [
                              "Crm_Implied_Manage_Data_Sharing"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "permissions"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "Error Message",
                      "enum": [
                        "permission denied"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "description": "Error Status",
                      "enum": [
                        "error"
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "code",
                    "details",
                    "message",
                    "status"
                  ]
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateDataSharing",
        "summary": "Update Data Sharing",
        "description": "Update the data sharing settings configured.API exposed to customers",
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.data_sharing.UPDATE"
            ]
          },
          {
            "iam-oauth2-schema": [
              "ZohoCRM.settings.data_sharing.ALL"
            ]
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Update Data Sharing Request Body",
                "properties": {
                  "data_sharing": {
                    "type": "array",
                    "maxItems": 100,
                    "description": "List of Data Sharing Settings to be updated",
                    "items": {
                      "type": "object",
                      "description": "Data Sharing Setting to be updated",
                      "properties": {
                        "share_type": {
                          "type": "string",
                          "description": "Stores the module-level data sharing permission type",
                          "enum": [
                            "private",
                            "public_read_write",
                            "public",
                            "public_read_only"
                          ]
                        },
                        "module": {
                          "type": "object",
                          "description": "Module Information",
                          "properties": {
                            "api_name": {
                              "type": "string",
                              "description": "API Name of the Module",
                              "maxLength": 100
                            },
                            "id": {
                              "type": "string",
                              "description": "ID of the Module",
                              "maxLength": 20
                            }
                          },
                          "additionalProperties": false,
                          "required": [
                            "id"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "share_type",
                        "module"
                      ]
                    }
                  }
                },
                "additionalProperties": false,
                "required": [
                  "data_sharing"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Update Data Sharing Response",
                  "properties": {
                    "data_sharing": {
                      "type": "array",
                      "maxItems": 100,
                      "description": "List of Update Status for Data Sharing Settings",
                      "items": {
                        "type": "object",
                        "description": "Update Status for Data Sharing Setting",
                        "properties": {
                          "status": {
                            "type": "string",
                            "description": "Update Status",
                            "enum": [
                              "success"
                            ]
                          },
                          "code": {
                            "type": "string",
                            "description": "Update Code",
                            "enum": [
                              "SUCCESS"
                            ]
                          },
                          "message": {
                            "type": "string",
                            "description": "Update Message",
                            "enum": [
                              "data sharing settings updated successfully"
                            ]
                          },
                          "details": {
                            "type": "object",
                            "description": "Additional Details",
                            "properties": {
                              "module": {
                                "type": "string",
                                "description": "Module API Name",
                                "maxLength": 100
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false,
                        "required": [
                          "status",
                          "code",
                          "message",
                          "details"
                        ]
                      }
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "data_sharing"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Update Data Sharing Error Details Response",
                      "properties": {
                        "data_sharing": {
                          "type": "array",
                          "maxItems": 100,
                          "description": "List of Error Details for Data Sharing Settings",
                          "items": {
                            "type": "object",
                            "description": "Error Detail for Data Sharing Setting",
                            "properties": {
                              "status": {
                                "type": "string",
                                "description": "Error Status",
                                "enum": [
                                  "error"
                                ]
                              },
                              "code": {
                                "type": "string",
                                "description": "Error Code",
                                "enum": [
                                  "INVALID_DATA",
                                  "NOT_ALLOWED"
                                ]
                              },
                              "message": {
                                "type": "string",
                                "description": "Error Message",
                                "enum": [
                                  "invalid data",
                                  "Cannot change the data sharing setting as module is made public in portals"
                                ]
                              },
                              "details": {
                                "type": "object",
                                "description": "Additional Details",
                                "properties": {
                                  "api_name": {
                                    "type": "string",
                                    "description": "API Name of the field causing error",
                                    "maxLength": 100
                                  },
                                  "json_path": {
                                    "type": "string",
                                    "maxLength": 2147483647,
                                    "description": "JSON Path of the field causing error"
                                  },
                                  "regex": {
                                    "type": "string",
                                    "description": "Expected Regex Pattern",
                                    "enum": [
                                      "private|public_read_only|public_read_write|public"
                                    ]
                                  },
                                  "expected_data_type": {
                                    "type": "string",
                                    "description": "Expected Data Type",
                                    "enum": [
                                      "text",
                                      "bigint"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "status",
                              "code",
                              "message",
                              "details"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "description": "Update Data Sharing Error Response",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Error Status",
                          "enum": [
                            "error"
                          ]
                        },
                        "code": {
                          "type": "string",
                          "description": "Error Code",
                          "enum": [
                            "INVALID_DATA"
                          ]
                        },
                        "message": {
                          "type": "string",
                          "description": "Error Message",
                          "enum": [
                            "invalid data"
                          ]
                        },
                        "details": {
                          "type": "object",
                          "description": "Additional Details",
                          "properties": {
                            "api_name": {
                              "type": "string",
                              "description": "API Name of the field causing error",
                              "maxLength": 100
                            },
                            "json_path": {
                              "type": "string",
                              "maxLength": 2147483647,
                              "description": "JSON Path of the field causing error"
                            },
                            "maximum_length": {
                              "type": "integer",
                              "format": "int32",
                              "description": "Maximum Length Allowed"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "User does not have sufficient permission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Permission Denied Response",
                  "properties": {
                    "status": {
                      "type": "string",
                      "description": "Response Status",
                      "enum": [
                        "error"
                      ]
                    },
                    "code": {
                      "type": "string",
                      "description": "Response Code",
                      "enum": [
                        "NO_PERMISSION"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": "Response Message",
                      "enum": [
                        "permission denied"
                      ]
                    },
                    "details": {
                      "type": "object",
                      "description": "Additional Details",
                      "properties": {
                        "permissions": {
                          "type": "array",
                          "maxItems": 1,
                          "description": "List of Required Permissions",
                          "items": {
                            "type": "string",
                            "description": "Permission Name",
                            "enum": [
                              "Crm_Implied_Manage_Data_Sharing"
                            ]
                          }
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "permissions"
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "status",
                    "code",
                    "message",
                    "details"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "iam-oauth2-schema": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth",
            "tokenUrl": "https://accounts.zoho.com/oauth/v2/token",
            "refreshUrl": "https://accounts.zoho.com/oauth/v2/token",
            "scopes": {
              "ZohoCRM.settings.data_sharing.READ": "Read access to Data Sharing settings",
              "ZohoCRM.settings.data_sharing.UPDATE": "Update access to Data Sharing settings",
              "ZohoCRM.settings.data_sharing.ALL": "Full access to Data Sharing settings"
            }
          }
        }
      }
    }
  }
}