From 409b97cb52162e387cb98226dab756209cc20248 Mon Sep 17 00:00:00 2001 From: Sean Matthews Date: Mon, 2 Jun 2025 23:23:44 -0400 Subject: [PATCH 1/2] Well, there you have it. Some prompted generation based on API specs. Let's see how these do live, and then let's settle on some ways to adjust and get a standard set of files for context so everyone generates the same. I'm sure I want something different like we need all of our thigns to be both human and LLM ingestible so they're used everywhere. --- package-lock.json | 3041 ++- packages/v1-ready/openphone/CHANGELOG.md | 16 + packages/v1-ready/openphone/README.md | 12 + packages/v1-ready/openphone/api.js | 298 + .../v1-ready/openphone/defaultConfig.json | 14 + packages/v1-ready/openphone/definition.js | 50 + packages/v1-ready/openphone/index.js | 9 + packages/v1-ready/openphone/jest-setup.js | 3 + packages/v1-ready/openphone/jest-teardown.js | 2 + packages/v1-ready/openphone/jest.config.js | 20 + packages/v1-ready/openphone/package.json | 27 + .../v1-ready/openphone/specs/openAPI.json | 15866 ++++++++++++++++ .../v1-ready/openphone/tests/ManagerTest.js | 75 + packages/v1-ready/openphone/tests/api.test.js | 951 + .../v1-ready/openphone/tests/auther.test.js | 139 + packages/v1-ready/pipedrive/.eslintrc.json | 3 + packages/v1-ready/pipedrive/CHANGELOG.md | 209 + packages/v1-ready/pipedrive/LICENSE.md | 16 + packages/v1-ready/pipedrive/README.md | 6 + packages/v1-ready/pipedrive/api.js | 453 + .../v1-ready/pipedrive/defaultConfig.json | 11 + packages/v1-ready/pipedrive/definition.js | 54 + packages/v1-ready/pipedrive/index.js | 13 + packages/v1-ready/pipedrive/jest-setup.js | 2 + packages/v1-ready/pipedrive/jest-teardown.js | 2 + packages/v1-ready/pipedrive/jest.config.js | 20 + packages/v1-ready/pipedrive/manager.js | 193 + packages/v1-ready/pipedrive/manager.test.js | 26 + .../mocks/activities/createActivity.js | 172 + .../mocks/activities/deleteActivity.js | 3 + .../mocks/activities/listActivities.js | 1538 ++ .../mocks/activities/updateActivity.js | 172 + packages/v1-ready/pipedrive/mocks/apiMock.js | 30 + .../pipedrive/mocks/deals/listDeals.js | 236 + .../v1-ready/pipedrive/models/credential.js | 21 + packages/v1-ready/pipedrive/models/entity.js | 9 + packages/v1-ready/pipedrive/package.json | 26 + .../v1-ready/pipedrive/specs/openAPI.yaml | 11129 +++++++++++ packages/v1-ready/pipedrive/test/Api.test.js | 157 + .../v1-ready/pipedrive/test/Manager.test.js | 138 + packages/v1-ready/zoho-crm/api.js | 628 +- packages/v1-ready/zoho-crm/definition.js | 29 +- packages/v1-ready/zoho-crm/package.json | 4 +- .../zoho-crm/specs/openAPI/v8.0/README.md | 11 + .../zoho-crm/specs/openAPI/v8.0/apis.json | 270 + .../openAPI/v8.0/appointment_preference.json | 445 + .../specs/openAPI/v8.0/assignment_rules.json | 731 + .../specs/openAPI/v8.0/associate_email.json | 511 + .../specs/openAPI/v8.0/attachments.json | 731 + .../specs/openAPI/v8.0/audit_log_export.json | 738 + .../openAPI/v8.0/available_currencies.json | 146 + .../zoho-crm/specs/openAPI/v8.0/backup.json | 776 + .../specs/openAPI/v8.0/blueprint.json | 949 + .../specs/openAPI/v8.0/bulk_read.json | 1037 + .../specs/openAPI/v8.0/bulk_write.json | 711 + .../specs/openAPI/v8.0/business_hours.json | 637 + .../zoho-crm/specs/openAPI/v8.0/cadences.json | 307 + .../openAPI/v8.0/cadences_execution.json | 638 + .../specs/openAPI/v8.0/call_preferences.json | 369 + .../specs/openAPI/v8.0/cancel_meetings.json | 420 + .../specs/openAPI/v8.0/change_owner.json | 778 + .../zoho-crm/specs/openAPI/v8.0/common.json | 1165 ++ .../specs/openAPI/v8.0/contact_roles.json | 836 + .../specs/openAPI/v8.0/conversion_option.json | 217 + .../specs/openAPI/v8.0/convert_lead.json | 649 + .../zoho-crm/specs/openAPI/v8.0/coql.json | 403 + .../specs/openAPI/v8.0/currencies.json | 1014 + .../specs/openAPI/v8.0/custom_views.json | 1457 ++ .../openAPI/v8.0/download_attachments.json | 187 + .../openAPI/v8.0/download_inline_images.json | 176 + .../v8.0/duplicate_check_preference.json | 712 + .../specs/openAPI/v8.0/email_compose.json | 654 + .../specs/openAPI/v8.0/email_drafts.json | 866 + .../openAPI/v8.0/email_related_records.json | 637 + .../openAPI/v8.0/email_sharing_details.json | 165 + .../specs/openAPI/v8.0/email_templates.json | 400 + .../specs/openAPI/v8.0/entity_scores.json | 537 + .../zoho-crm/specs/openAPI/v8.0/features.json | 367 + .../specs/openAPI/v8.0/field_attachments.json | 171 + .../openAPI/v8.0/field_map_dependency.json | 902 + .../zoho-crm/specs/openAPI/v8.0/fields.json | 2161 +++ .../zoho-crm/specs/openAPI/v8.0/files.json | 375 + .../specs/openAPI/v8.0/find_and_merge.json | 670 + .../specs/openAPI/v8.0/fiscal_year.json | 362 + .../specs/openAPI/v8.0/from_addresses.json | 154 + .../specs/openAPI/v8.0/global_picklists.json | 1093 ++ .../zoho-crm/specs/openAPI/v8.0/holidays.json | 1068 ++ .../specs/openAPI/v8.0/inventory_convert.json | 654 + .../openAPI/v8.0/inventory_mass_convert.json | 1164 ++ .../openAPI/v8.0/inventory_templates.json | 385 + .../zoho-crm/specs/openAPI/v8.0/layouts.json | 1432 ++ .../specs/openAPI/v8.0/mail_merge.json | 604 + .../specs/openAPI/v8.0/mass_change_owner.json | 498 + .../specs/openAPI/v8.0/mass_convert.json | 508 + .../specs/openAPI/v8.0/mass_delete_tags.json | 668 + .../zoho-crm/specs/openAPI/v8.0/modules.json | 1443 ++ .../zoho-crm/specs/openAPI/v8.0/notes.json | 1075 ++ .../specs/openAPI/v8.0/notifications.json | 679 + .../zoho-crm/specs/openAPI/v8.0/org.json | 795 + .../specs/openAPI/v8.0/pick_list_values.json | 263 + .../zoho-crm/specs/openAPI/v8.0/pipeline.json | 1203 ++ .../specs/openAPI/v8.0/portal_invite.json | 644 + .../specs/openAPI/v8.0/portal_user_type.json | 695 + .../zoho-crm/specs/openAPI/v8.0/portals.json | 739 + .../specs/openAPI/v8.0/portals_meta.json | 215 + .../zoho-crm/specs/openAPI/v8.0/profiles.json | 1212 ++ .../openAPI/v8.0/python/sample_api_runner.py | 98 + .../zoho-crm/specs/openAPI/v8.0/record.json | 2732 +++ .../specs/openAPI/v8.0/record_locking.json | 918 + .../v8.0/record_locking_configuration.json | 1125 ++ .../openAPI/v8.0/record_share_email.json | 1006 + .../specs/openAPI/v8.0/recycle_bin.json | 1096 ++ .../specs/openAPI/v8.0/related_lists.json | 334 + .../specs/openAPI/v8.0/related_records.json | 974 + .../openAPI/v8.0/reschedule_history.json | 1104 ++ .../zoho-crm/specs/openAPI/v8.0/roles.json | 547 + .../specs/openAPI/v8.0/scoring_rules.json | 1707 ++ .../specs/openAPI/v8.0/send_mail.json | 710 + .../openAPI/v8.0/service_preference.json | 345 + .../specs/openAPI/v8.0/share_records.json | 553 + .../specs/openAPI/v8.0/shift_hours.json | 1135 ++ .../zoho-crm/specs/openAPI/v8.0/tags.json | 1652 ++ .../specs/openAPI/v8.0/territories.json | 1208 ++ .../specs/openAPI/v8.0/territory_users.json | 544 + .../specs/openAPI/v8.0/timelines.json | 541 + .../specs/openAPI/v8.0/unblock_email.json | 342 + .../specs/openAPI/v8.0/unsubscribe_links.json | 889 + .../specs/openAPI/v8.0/user_groups.json | 1472 ++ .../specs/openAPI/v8.0/user_type_users.json | 530 + .../zoho-crm/specs/openAPI/v8.0/users.json | 1602 ++ .../specs/openAPI/v8.0/users_territories.json | 620 + .../openAPI/v8.0/users_transfer_delete.json | 667 + .../openAPI/v8.0/users_unavailability.json | 936 + .../specs/openAPI/v8.0/variable_groups.json | 255 + .../specs/openAPI/v8.0/variables.json | 978 + .../zoho-crm/specs/openAPI/v8.0/wizards.json | 949 + .../openAPI/v8.0/zia_org_enrichment.json | 972 + .../openAPI/v8.0/zia_people_enrichment.json | 1098 ++ 138 files changed, 107370 insertions(+), 571 deletions(-) create mode 100644 packages/v1-ready/openphone/CHANGELOG.md create mode 100644 packages/v1-ready/openphone/README.md create mode 100644 packages/v1-ready/openphone/api.js create mode 100644 packages/v1-ready/openphone/defaultConfig.json create mode 100644 packages/v1-ready/openphone/definition.js create mode 100644 packages/v1-ready/openphone/index.js create mode 100644 packages/v1-ready/openphone/jest-setup.js create mode 100644 packages/v1-ready/openphone/jest-teardown.js create mode 100644 packages/v1-ready/openphone/jest.config.js create mode 100644 packages/v1-ready/openphone/package.json create mode 100644 packages/v1-ready/openphone/specs/openAPI.json create mode 100644 packages/v1-ready/openphone/tests/ManagerTest.js create mode 100644 packages/v1-ready/openphone/tests/api.test.js create mode 100644 packages/v1-ready/openphone/tests/auther.test.js create mode 100644 packages/v1-ready/pipedrive/.eslintrc.json create mode 100644 packages/v1-ready/pipedrive/CHANGELOG.md create mode 100644 packages/v1-ready/pipedrive/LICENSE.md create mode 100644 packages/v1-ready/pipedrive/README.md create mode 100644 packages/v1-ready/pipedrive/api.js create mode 100644 packages/v1-ready/pipedrive/defaultConfig.json create mode 100644 packages/v1-ready/pipedrive/definition.js create mode 100644 packages/v1-ready/pipedrive/index.js create mode 100644 packages/v1-ready/pipedrive/jest-setup.js create mode 100644 packages/v1-ready/pipedrive/jest-teardown.js create mode 100644 packages/v1-ready/pipedrive/jest.config.js create mode 100644 packages/v1-ready/pipedrive/manager.js create mode 100644 packages/v1-ready/pipedrive/manager.test.js create mode 100644 packages/v1-ready/pipedrive/mocks/activities/createActivity.js create mode 100644 packages/v1-ready/pipedrive/mocks/activities/deleteActivity.js create mode 100644 packages/v1-ready/pipedrive/mocks/activities/listActivities.js create mode 100644 packages/v1-ready/pipedrive/mocks/activities/updateActivity.js create mode 100644 packages/v1-ready/pipedrive/mocks/apiMock.js create mode 100644 packages/v1-ready/pipedrive/mocks/deals/listDeals.js create mode 100644 packages/v1-ready/pipedrive/models/credential.js create mode 100644 packages/v1-ready/pipedrive/models/entity.js create mode 100644 packages/v1-ready/pipedrive/package.json create mode 100644 packages/v1-ready/pipedrive/specs/openAPI.yaml create mode 100644 packages/v1-ready/pipedrive/test/Api.test.js create mode 100644 packages/v1-ready/pipedrive/test/Manager.test.js create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/README.md create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/apis.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/appointment_preference.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/assignment_rules.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/associate_email.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/attachments.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/audit_log_export.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/available_currencies.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/backup.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/blueprint.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_read.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_write.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/business_hours.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences_execution.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/call_preferences.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cancel_meetings.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/change_owner.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/common.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/contact_roles.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/conversion_option.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/convert_lead.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/coql.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/currencies.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/custom_views.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_attachments.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_inline_images.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/duplicate_check_preference.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_compose.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_drafts.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_related_records.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_sharing_details.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_templates.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/entity_scores.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/features.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_attachments.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_map_dependency.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fields.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/files.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/find_and_merge.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fiscal_year.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/from_addresses.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/global_picklists.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/holidays.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_convert.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_mass_convert.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_templates.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/layouts.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mail_merge.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_change_owner.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_convert.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_delete_tags.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/modules.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notes.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notifications.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/org.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pick_list_values.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pipeline.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_invite.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_user_type.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals_meta.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/profiles.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/python/sample_api_runner.py create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking_configuration.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_share_email.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/recycle_bin.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_lists.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_records.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/reschedule_history.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/roles.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/scoring_rules.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/send_mail.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/service_preference.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/share_records.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/shift_hours.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/tags.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territories.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territory_users.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/timelines.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unblock_email.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unsubscribe_links.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_groups.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_type_users.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_territories.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_transfer_delete.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_unavailability.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variable_groups.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variables.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/wizards.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_org_enrichment.json create mode 100644 packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_people_enrichment.json diff --git a/package-lock.json b/package-lock.json index 7de2c90..cccc5a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,6 @@ }, "node_modules/@ampproject/remapping": { "version": "2.3.0", - "dev": true, "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -1451,7 +1450,6 @@ }, "node_modules/@babel/code-frame": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/highlight": "^7.24.7", @@ -1463,7 +1461,6 @@ }, "node_modules/@babel/compat-data": { "version": "7.25.2", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1471,7 +1468,6 @@ }, "node_modules/@babel/core": { "version": "7.25.2", - "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", @@ -1500,7 +1496,6 @@ }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1508,7 +1503,6 @@ }, "node_modules/@babel/eslint-parser": { "version": "7.25.1", - "dev": true, "license": "MIT", "dependencies": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", @@ -1525,7 +1519,6 @@ }, "node_modules/@babel/eslint-parser/node_modules/semver": { "version": "6.3.1", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1533,7 +1526,6 @@ }, "node_modules/@babel/generator": { "version": "7.25.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.25.0", @@ -1547,7 +1539,6 @@ }, "node_modules/@babel/helper-compilation-targets": { "version": "7.25.2", - "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^7.25.2", @@ -1562,7 +1553,6 @@ }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.1", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1570,7 +1560,6 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/traverse": "^7.24.7", @@ -1582,7 +1571,6 @@ }, "node_modules/@babel/helper-module-transforms": { "version": "7.25.2", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.24.7", @@ -1599,7 +1587,6 @@ }, "node_modules/@babel/helper-plugin-utils": { "version": "7.24.8", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1607,7 +1594,6 @@ }, "node_modules/@babel/helper-simple-access": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/traverse": "^7.24.7", @@ -1619,7 +1605,6 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.24.8", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1627,7 +1612,6 @@ }, "node_modules/@babel/helper-validator-identifier": { "version": "7.24.7", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1635,7 +1619,6 @@ }, "node_modules/@babel/helper-validator-option": { "version": "7.24.8", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -1643,7 +1626,6 @@ }, "node_modules/@babel/helpers": { "version": "7.25.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.25.0", @@ -1655,7 +1637,6 @@ }, "node_modules/@babel/highlight": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.24.7", @@ -1669,7 +1650,6 @@ }, "node_modules/@babel/highlight/node_modules/ansi-styles": { "version": "3.2.1", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -1680,7 +1660,6 @@ }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -1693,7 +1672,6 @@ }, "node_modules/@babel/highlight/node_modules/color-convert": { "version": "1.9.3", - "dev": true, "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -1701,12 +1679,10 @@ }, "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", - "dev": true, "license": "MIT" }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" @@ -1714,7 +1690,6 @@ }, "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -1722,7 +1697,6 @@ }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -1733,7 +1707,6 @@ }, "node_modules/@babel/parser": { "version": "7.25.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.25.2" @@ -1747,7 +1720,6 @@ }, "node_modules/@babel/plugin-syntax-async-generators": { "version": "7.8.4", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1758,7 +1730,6 @@ }, "node_modules/@babel/plugin-syntax-bigint": { "version": "7.8.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1769,7 +1740,6 @@ }, "node_modules/@babel/plugin-syntax-class-properties": { "version": "7.12.13", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" @@ -1780,7 +1750,6 @@ }, "node_modules/@babel/plugin-syntax-class-static-block": { "version": "7.14.5", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" @@ -1794,7 +1763,6 @@ }, "node_modules/@babel/plugin-syntax-import-attributes": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.24.7" @@ -1808,7 +1776,6 @@ }, "node_modules/@babel/plugin-syntax-import-meta": { "version": "7.10.4", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" @@ -1819,7 +1786,6 @@ }, "node_modules/@babel/plugin-syntax-json-strings": { "version": "7.8.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1830,7 +1796,6 @@ }, "node_modules/@babel/plugin-syntax-jsx": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.24.7" @@ -1844,7 +1809,6 @@ }, "node_modules/@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" @@ -1855,7 +1819,6 @@ }, "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { "version": "7.8.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1866,7 +1829,6 @@ }, "node_modules/@babel/plugin-syntax-numeric-separator": { "version": "7.10.4", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" @@ -1877,7 +1839,6 @@ }, "node_modules/@babel/plugin-syntax-object-rest-spread": { "version": "7.8.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1888,7 +1849,6 @@ }, "node_modules/@babel/plugin-syntax-optional-catch-binding": { "version": "7.8.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1899,7 +1859,6 @@ }, "node_modules/@babel/plugin-syntax-optional-chaining": { "version": "7.8.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" @@ -1910,7 +1869,6 @@ }, "node_modules/@babel/plugin-syntax-private-property-in-object": { "version": "7.14.5", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" @@ -1924,7 +1882,6 @@ }, "node_modules/@babel/plugin-syntax-top-level-await": { "version": "7.14.5", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" @@ -1938,7 +1895,6 @@ }, "node_modules/@babel/plugin-syntax-typescript": { "version": "7.24.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.24.7" @@ -1969,7 +1925,6 @@ }, "node_modules/@babel/template": { "version": "7.25.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.24.7", @@ -1982,7 +1937,6 @@ }, "node_modules/@babel/traverse": { "version": "7.25.3", - "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.24.7", @@ -1999,7 +1953,6 @@ }, "node_modules/@babel/types": { "version": "7.25.2", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.24.8", @@ -2136,7 +2089,6 @@ }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", - "dev": true, "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.3.0" @@ -2150,7 +2102,6 @@ }, "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { "version": "3.4.3", - "dev": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2161,7 +2112,6 @@ }, "node_modules/@eslint-community/regexpp": { "version": "4.11.0", - "dev": true, "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -2201,7 +2151,6 @@ }, "node_modules/@eslint/eslintrc": { "version": "2.1.4", - "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", @@ -2223,7 +2172,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.24.0", - "dev": true, "license": "MIT", "dependencies": { "type-fest": "^0.20.2" @@ -2237,7 +2185,6 @@ }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", - "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -2248,7 +2195,6 @@ }, "node_modules/@eslint/js": { "version": "8.57.0", - "dev": true, "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2364,6 +2310,14 @@ "resolved": "packages/needs-updating/microsoft-teams", "link": true }, + "node_modules/@friggframework/api-module-openphone": { + "resolved": "packages/v1-ready/openphone", + "link": true + }, + "node_modules/@friggframework/api-module-pipedrive": { + "resolved": "packages/v1-ready/pipedrive", + "link": true + }, "node_modules/@friggframework/api-module-salesforce": { "resolved": "packages/v1-ready/salesforce", "link": true @@ -2562,7 +2516,6 @@ }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", - "dev": true, "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^2.0.2", @@ -2575,7 +2528,6 @@ }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=12.22" @@ -2587,7 +2539,6 @@ }, "node_modules/@humanwhocodes/object-schema": { "version": "2.0.3", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@humanwhocodes/retry": { @@ -2612,7 +2563,6 @@ }, "node_modules/@inquirer/checkbox": { "version": "2.4.7", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2627,7 +2577,6 @@ }, "node_modules/@inquirer/confirm": { "version": "3.1.22", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2639,7 +2588,6 @@ }, "node_modules/@inquirer/core": { "version": "9.0.10", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/figures": "^1.0.5", @@ -2662,7 +2610,6 @@ }, "node_modules/@inquirer/core/node_modules/signal-exit": { "version": "4.1.0", - "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -2673,7 +2620,6 @@ }, "node_modules/@inquirer/editor": { "version": "2.1.22", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2686,7 +2632,6 @@ }, "node_modules/@inquirer/expand": { "version": "2.1.22", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2699,7 +2644,6 @@ }, "node_modules/@inquirer/figures": { "version": "1.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -2707,7 +2651,6 @@ }, "node_modules/@inquirer/input": { "version": "2.2.9", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2719,7 +2662,6 @@ }, "node_modules/@inquirer/number": { "version": "1.0.10", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2731,7 +2673,6 @@ }, "node_modules/@inquirer/password": { "version": "2.1.22", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2744,7 +2685,6 @@ }, "node_modules/@inquirer/prompts": { "version": "5.3.8", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/checkbox": "^2.4.7", @@ -2764,7 +2704,6 @@ }, "node_modules/@inquirer/rawlist": { "version": "2.2.4", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2777,7 +2716,6 @@ }, "node_modules/@inquirer/search": { "version": "1.0.7", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2791,7 +2729,6 @@ }, "node_modules/@inquirer/select": { "version": "2.4.7", - "dev": true, "license": "MIT", "dependencies": { "@inquirer/core": "^9.0.10", @@ -2806,7 +2743,6 @@ }, "node_modules/@inquirer/type": { "version": "1.5.2", - "dev": true, "license": "MIT", "dependencies": { "mute-stream": "^1.0.0" @@ -2912,7 +2848,6 @@ }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", - "dev": true, "license": "ISC", "dependencies": { "camelcase": "^5.3.1", @@ -2927,7 +2862,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { "version": "1.0.10", - "dev": true, "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" @@ -2935,7 +2869,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -2947,7 +2880,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.1", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^1.0.7", @@ -2959,7 +2891,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -2970,7 +2901,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { "version": "2.3.0", - "dev": true, "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -2984,7 +2914,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -2995,7 +2924,6 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { "version": "5.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -3003,12 +2931,10 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/sprintf-js": { "version": "1.0.3", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -3277,7 +3203,7 @@ }, "node_modules/@jest/schemas": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.24.1" @@ -3375,7 +3301,7 @@ }, "node_modules/@jest/types": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jest/schemas": "^28.1.3", @@ -3391,7 +3317,6 @@ }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", @@ -3404,7 +3329,6 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", - "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -3412,7 +3336,6 @@ }, "node_modules/@jridgewell/set-array": { "version": "1.2.1", - "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -3420,12 +3343,10 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", - "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -4210,7 +4131,6 @@ }, "node_modules/@mongodb-js/saslprep": { "version": "1.1.8", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -4229,7 +4149,6 @@ }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", - "dev": true, "license": "MIT", "dependencies": { "eslint-scope": "5.1.1" @@ -4237,7 +4156,6 @@ }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -4249,7 +4167,6 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -4257,7 +4174,6 @@ }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", - "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -5252,7 +5168,7 @@ }, "node_modules/@sinclair/typebox": { "version": "0.24.51", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@sindresorhus/is": { @@ -6165,7 +6081,6 @@ }, "node_modules/@types/graceful-fs": { "version": "4.1.9", - "dev": true, "license": "MIT", "dependencies": { "@types/node": "*" @@ -6173,12 +6088,10 @@ }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", - "dev": true, "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" @@ -6186,7 +6099,6 @@ }, "node_modules/@types/istanbul-reports": { "version": "3.0.4", - "dev": true, "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" @@ -6216,7 +6128,6 @@ }, "node_modules/@types/mdast": { "version": "3.0.15", - "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^2" @@ -6235,7 +6146,6 @@ }, "node_modules/@types/mute-stream": { "version": "0.0.4", - "dev": true, "license": "MIT", "dependencies": { "@types/node": "*" @@ -6278,7 +6188,6 @@ }, "node_modules/@types/stack-utils": { "version": "2.0.3", - "dev": true, "license": "MIT" }, "node_modules/@types/tough-cookie": { @@ -6295,7 +6204,6 @@ }, "node_modules/@types/unist": { "version": "2.0.10", - "dev": true, "license": "MIT" }, "node_modules/@types/webidl-conversions": { @@ -6312,7 +6220,6 @@ }, "node_modules/@types/wrap-ansi": { "version": "3.0.0", - "dev": true, "license": "MIT" }, "node_modules/@types/ws": { @@ -6324,7 +6231,6 @@ }, "node_modules/@types/yargs": { "version": "17.0.33", - "dev": true, "license": "MIT", "dependencies": { "@types/yargs-parser": "*" @@ -6332,12 +6238,10 @@ }, "node_modules/@types/yargs-parser": { "version": "21.0.3", - "dev": true, "license": "MIT" }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", - "dev": true, "license": "ISC" }, "node_modules/@yarnpkg/lockfile": { @@ -6431,7 +6335,6 @@ }, "node_modules/acorn": { "version": "8.12.1", - "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -6462,7 +6365,6 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", - "dev": true, "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -6510,7 +6412,6 @@ }, "node_modules/ajv": { "version": "6.12.6", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -6649,7 +6550,6 @@ }, "node_modules/anymatch": { "version": "3.1.3", - "dev": true, "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", @@ -6672,7 +6572,6 @@ }, "node_modules/argparse": { "version": "2.0.1", - "dev": true, "license": "Python-2.0" }, "node_modules/array-back": { @@ -6799,7 +6698,6 @@ }, "node_modules/async-mutex": { "version": "0.3.2", - "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.3.1" @@ -6807,7 +6705,6 @@ }, "node_modules/async-mutex/node_modules/tslib": { "version": "2.6.3", - "dev": true, "license": "0BSD" }, "node_modules/asynckit": { @@ -6927,7 +6824,6 @@ }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", @@ -6956,7 +6852,6 @@ }, "node_modules/babel-preset-current-node-syntax": { "version": "1.1.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -6996,7 +6891,6 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -7314,7 +7208,6 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -7323,7 +7216,6 @@ }, "node_modules/braces": { "version": "3.0.3", - "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -7339,7 +7231,6 @@ }, "node_modules/browserslist": { "version": "4.23.3", - "dev": true, "funding": [ { "type": "opencollective", @@ -7370,7 +7261,6 @@ }, "node_modules/bser": { "version": "2.1.1", - "dev": true, "license": "Apache-2.0", "dependencies": { "node-int64": "^0.4.0" @@ -7419,7 +7309,6 @@ }, "node_modules/buffer-crc32": { "version": "0.2.13", - "dev": true, "license": "MIT", "engines": { "node": "*" @@ -7431,7 +7320,6 @@ }, "node_modules/buffer-from": { "version": "1.1.2", - "dev": true, "license": "MIT" }, "node_modules/bundle-name": { @@ -7574,7 +7462,6 @@ }, "node_modules/callsites": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -7582,7 +7469,6 @@ }, "node_modules/camelcase": { "version": "5.3.1", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -7606,7 +7492,6 @@ }, "node_modules/caniuse-lite": { "version": "1.0.30001651", - "dev": true, "funding": [ { "type": "opencollective", @@ -7639,7 +7524,6 @@ }, "node_modules/char-regex": { "version": "1.0.2", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -7647,7 +7531,6 @@ }, "node_modules/character-entities": { "version": "1.2.4", - "dev": true, "license": "MIT", "funding": { "type": "github", @@ -7656,7 +7539,6 @@ }, "node_modules/character-entities-legacy": { "version": "1.1.4", - "dev": true, "license": "MIT", "funding": { "type": "github", @@ -7665,7 +7547,6 @@ }, "node_modules/character-reference-invalid": { "version": "1.1.4", - "dev": true, "license": "MIT", "funding": { "type": "github", @@ -7693,7 +7574,6 @@ }, "node_modules/ci-info": { "version": "3.9.0", - "dev": true, "funding": [ { "type": "github", @@ -7707,7 +7587,6 @@ }, "node_modules/cjs-module-lexer": { "version": "1.3.1", - "dev": true, "license": "MIT" }, "node_modules/clean-stack": { @@ -7720,7 +7599,6 @@ }, "node_modules/cli": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "exit": "0.1.2", @@ -7752,7 +7630,6 @@ }, "node_modules/cli-width": { "version": "4.1.0", - "dev": true, "license": "ISC", "engines": { "node": ">= 12" @@ -7840,7 +7717,6 @@ }, "node_modules/collect-v8-coverage": { "version": "1.0.2", - "dev": true, "license": "MIT" }, "node_modules/color-convert": { @@ -8089,7 +7965,6 @@ }, "node_modules/commander": { "version": "12.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -8110,7 +7985,6 @@ }, "node_modules/commondir": { "version": "1.0.1", - "dev": true, "license": "MIT" }, "node_modules/compare-func": { @@ -8124,7 +7998,6 @@ }, "node_modules/concat-map": { "version": "0.0.1", - "dev": true, "license": "MIT" }, "node_modules/concat-stream": { @@ -8144,7 +8017,6 @@ }, "node_modules/console-browserify": { "version": "1.1.0", - "dev": true, "dependencies": { "date-now": "^0.1.4" } @@ -8372,7 +8244,6 @@ }, "node_modules/convert-source-map": { "version": "2.0.0", - "dev": true, "license": "MIT" }, "node_modules/cookie": { @@ -8406,7 +8277,6 @@ }, "node_modules/core-util-is": { "version": "1.0.3", - "dev": true, "license": "MIT" }, "node_modules/cors": { @@ -9212,7 +9082,6 @@ }, "node_modules/cross-spawn": { "version": "7.0.6", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -9363,8 +9232,7 @@ } }, "node_modules/date-now": { - "version": "0.1.4", - "dev": true + "version": "0.1.4" }, "node_modules/dateformat": { "version": "3.0.3", @@ -9444,7 +9312,6 @@ }, "node_modules/deep-is": { "version": "0.1.4", - "dev": true, "license": "MIT" }, "node_modules/deepmerge": { @@ -9506,7 +9373,6 @@ }, "node_modules/define-lazy-prop": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -9573,7 +9439,6 @@ }, "node_modules/detect-newline": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -9633,7 +9498,6 @@ }, "node_modules/doctrine": { "version": "3.0.0", - "dev": true, "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -9795,12 +9659,10 @@ }, "node_modules/electron-to-chromium": { "version": "1.5.7", - "dev": true, "license": "ISC" }, "node_modules/emittery": { "version": "0.13.1", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -9841,7 +9703,6 @@ }, "node_modules/end-of-stream": { "version": "1.4.4", - "dev": true, "license": "MIT", "dependencies": { "once": "^1.4.0" @@ -10055,7 +9916,6 @@ }, "node_modules/escalade": { "version": "3.1.2", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -10067,7 +9927,6 @@ }, "node_modules/escape-string-regexp": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -10106,7 +9965,6 @@ }, "node_modules/eslint": { "version": "8.57.0", - "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -10160,7 +10018,6 @@ }, "node_modules/eslint-config-prettier": { "version": "8.10.0", - "dev": true, "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" @@ -10171,7 +10028,6 @@ }, "node_modules/eslint-plugin-json": { "version": "3.1.0", - "dev": true, "license": "MIT", "dependencies": { "lodash": "^4.17.21", @@ -10183,7 +10039,6 @@ }, "node_modules/eslint-plugin-markdown": { "version": "3.0.1", - "dev": true, "license": "MIT", "dependencies": { "mdast-util-from-markdown": "^0.8.5" @@ -10197,7 +10052,6 @@ }, "node_modules/eslint-plugin-no-only-tests": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=5.0.0" @@ -10205,7 +10059,6 @@ }, "node_modules/eslint-plugin-yaml": { "version": "0.5.0", - "dev": true, "license": "MIT", "dependencies": { "js-yaml": "^4.1.0", @@ -10217,7 +10070,6 @@ }, "node_modules/eslint-scope": { "version": "5.1.1", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -10229,7 +10081,6 @@ }, "node_modules/eslint-visitor-keys": { "version": "2.1.0", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10" @@ -10237,7 +10088,6 @@ }, "node_modules/eslint/node_modules/eslint-scope": { "version": "7.2.2", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -10252,7 +10102,6 @@ }, "node_modules/eslint/node_modules/eslint-visitor-keys": { "version": "3.4.3", - "dev": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -10263,7 +10112,6 @@ }, "node_modules/eslint/node_modules/estraverse": { "version": "5.3.0", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -10271,7 +10119,6 @@ }, "node_modules/eslint/node_modules/globals": { "version": "13.24.0", - "dev": true, "license": "MIT", "dependencies": { "type-fest": "^0.20.2" @@ -10285,7 +10132,6 @@ }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", - "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -10296,7 +10142,6 @@ }, "node_modules/espree": { "version": "9.6.1", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", @@ -10312,7 +10157,6 @@ }, "node_modules/espree/node_modules/eslint-visitor-keys": { "version": "3.4.3", - "dev": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -10323,7 +10167,6 @@ }, "node_modules/esprima": { "version": "4.0.1", - "dev": true, "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -10335,7 +10178,6 @@ }, "node_modules/esquery": { "version": "1.6.0", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" @@ -10346,7 +10188,6 @@ }, "node_modules/esquery/node_modules/estraverse": { "version": "5.3.0", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -10354,7 +10195,6 @@ }, "node_modules/esrecurse": { "version": "4.3.0", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" @@ -10365,7 +10205,6 @@ }, "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -10373,7 +10212,6 @@ }, "node_modules/estraverse": { "version": "4.3.0", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -10381,7 +10219,6 @@ }, "node_modules/esutils": { "version": "2.0.3", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -10431,7 +10268,6 @@ }, "node_modules/exit": { "version": "0.1.2", - "dev": true, "engines": { "node": ">= 0.8.0" } @@ -10526,7 +10362,6 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "dev": true, "license": "MIT" }, "node_modules/fast-glob": { @@ -10562,12 +10397,10 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", - "dev": true, "license": "MIT" }, "node_modules/fast-xml-parser": { @@ -10593,7 +10426,6 @@ }, "node_modules/fastq": { "version": "1.17.1", - "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -10626,7 +10458,6 @@ }, "node_modules/fb-watchman": { "version": "2.0.2", - "dev": true, "license": "Apache-2.0", "dependencies": { "bser": "2.1.1" @@ -10634,7 +10465,6 @@ }, "node_modules/fd-slicer": { "version": "1.1.0", - "dev": true, "license": "MIT", "dependencies": { "pend": "~1.2.0" @@ -10662,7 +10492,6 @@ }, "node_modules/file-entry-cache": { "version": "6.0.1", - "dev": true, "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" @@ -10723,7 +10552,6 @@ }, "node_modules/fill-range": { "version": "7.1.1", - "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -10761,7 +10589,6 @@ }, "node_modules/find-cache-dir": { "version": "3.3.2", - "dev": true, "license": "MIT", "dependencies": { "commondir": "^1.0.1", @@ -10777,7 +10604,6 @@ }, "node_modules/find-cache-dir/node_modules/make-dir": { "version": "3.1.0", - "dev": true, "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -10791,7 +10617,6 @@ }, "node_modules/find-cache-dir/node_modules/semver": { "version": "6.3.1", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -10810,7 +10635,6 @@ }, "node_modules/find-up": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "locate-path": "^6.0.0", @@ -10833,7 +10657,6 @@ }, "node_modules/flat-cache": { "version": "3.2.0", - "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.2.9", @@ -10846,7 +10669,6 @@ }, "node_modules/flatted": { "version": "3.3.1", - "dev": true, "license": "ISC" }, "node_modules/follow-redirects": { @@ -10991,7 +10813,6 @@ }, "node_modules/fs-constants": { "version": "1.0.0", - "dev": true, "license": "MIT" }, "node_modules/fs-extra": { @@ -11019,12 +10840,10 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "dev": true, "license": "ISC" }, "node_modules/fsevents": { "version": "2.3.3", - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -11070,7 +10889,6 @@ }, "node_modules/gensync": { "version": "1.0.0-beta.2", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -11117,7 +10935,6 @@ }, "node_modules/get-package-type": { "version": "0.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8.0.0" @@ -11242,7 +11059,6 @@ }, "node_modules/get-port": { "version": "5.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -11396,7 +11212,6 @@ }, "node_modules/glob": { "version": "7.2.3", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -11415,7 +11230,6 @@ }, "node_modules/glob-parent": { "version": "6.0.2", - "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.3" @@ -11426,7 +11240,6 @@ }, "node_modules/globals": { "version": "11.12.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -11492,7 +11305,6 @@ }, "node_modules/graphemer": { "version": "1.4.0", - "dev": true, "license": "MIT" }, "node_modules/graphql": { @@ -11757,7 +11569,6 @@ }, "node_modules/ignore": { "version": "5.3.2", - "dev": true, "license": "MIT", "engines": { "node": ">= 4" @@ -11812,7 +11623,6 @@ }, "node_modules/import-fresh": { "version": "3.3.0", - "dev": true, "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -11864,7 +11674,6 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -11880,7 +11689,6 @@ }, "node_modules/inflight": { "version": "1.0.6", - "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -11972,7 +11780,6 @@ }, "node_modules/is-alphabetical": { "version": "1.0.4", - "dev": true, "license": "MIT", "funding": { "type": "github", @@ -11981,7 +11788,6 @@ }, "node_modules/is-alphanumerical": { "version": "1.0.4", - "dev": true, "license": "MIT", "dependencies": { "is-alphabetical": "^1.0.0", @@ -12102,7 +11908,6 @@ }, "node_modules/is-core-module": { "version": "2.16.1", - "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.2" @@ -12147,7 +11952,6 @@ }, "node_modules/is-decimal": { "version": "1.0.4", - "dev": true, "license": "MIT", "funding": { "type": "github", @@ -12169,7 +11973,6 @@ }, "node_modules/is-extglob": { "version": "2.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -12219,7 +12022,6 @@ }, "node_modules/is-glob": { "version": "4.0.3", - "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -12230,7 +12032,6 @@ }, "node_modules/is-hexadecimal": { "version": "1.0.4", - "dev": true, "license": "MIT", "funding": { "type": "github", @@ -12291,7 +12092,6 @@ }, "node_modules/is-number": { "version": "7.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" @@ -12322,7 +12122,6 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -12532,7 +12331,6 @@ }, "node_modules/isexe": { "version": "2.0.0", - "dev": true, "license": "ISC" }, "node_modules/isobject": { @@ -12554,7 +12352,6 @@ }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=8" @@ -12562,7 +12359,6 @@ }, "node_modules/istanbul-lib-instrument": { "version": "5.2.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.12.3", @@ -12577,7 +12373,6 @@ }, "node_modules/istanbul-lib-instrument/node_modules/semver": { "version": "6.3.1", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -12925,7 +12720,6 @@ }, "node_modules/jest-docblock": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "detect-newline": "^3.0.0" @@ -12985,7 +12779,7 @@ }, "node_modules/jest-get-type": { "version": "28.0.2", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" @@ -12993,7 +12787,7 @@ }, "node_modules/jest-haste-map": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jest/types": "^28.1.3", @@ -13017,7 +12811,6 @@ }, "node_modules/jest-leak-detector": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3", @@ -13029,7 +12822,6 @@ }, "node_modules/jest-leak-detector/node_modules/@jest/schemas": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" @@ -13040,12 +12832,10 @@ }, "node_modules/jest-leak-detector/node_modules/@sinclair/typebox": { "version": "0.27.8", - "dev": true, "license": "MIT" }, "node_modules/jest-leak-detector/node_modules/ansi-styles": { "version": "5.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -13056,7 +12846,6 @@ }, "node_modules/jest-leak-detector/node_modules/jest-get-type": { "version": "29.6.3", - "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -13064,7 +12853,6 @@ }, "node_modules/jest-leak-detector/node_modules/pretty-format": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -13130,7 +12918,6 @@ }, "node_modules/jest-pnp-resolver": { "version": "1.2.3", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -13146,7 +12933,7 @@ }, "node_modules/jest-regex-util": { "version": "28.0.2", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" @@ -13154,7 +12941,7 @@ }, "node_modules/jest-resolve": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -13185,7 +12972,7 @@ }, "node_modules/jest-resolve/node_modules/slash": { "version": "3.0.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -13193,7 +12980,6 @@ }, "node_modules/jest-runner": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", @@ -13224,7 +13010,6 @@ }, "node_modules/jest-runner-groups": { "version": "2.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 10.14.2" @@ -13236,7 +13021,6 @@ }, "node_modules/jest-runner/node_modules/@jest/console": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -13252,7 +13036,6 @@ }, "node_modules/jest-runner/node_modules/@jest/environment": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/fake-timers": "^29.7.0", @@ -13266,7 +13049,6 @@ }, "node_modules/jest-runner/node_modules/@jest/expect": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "expect": "^29.7.0", @@ -13278,7 +13060,6 @@ }, "node_modules/jest-runner/node_modules/@jest/expect-utils": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "jest-get-type": "^29.6.3" @@ -13289,7 +13070,6 @@ }, "node_modules/jest-runner/node_modules/@jest/fake-timers": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -13305,7 +13085,6 @@ }, "node_modules/jest-runner/node_modules/@jest/globals": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", @@ -13319,7 +13098,6 @@ }, "node_modules/jest-runner/node_modules/@jest/schemas": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" @@ -13330,7 +13108,6 @@ }, "node_modules/jest-runner/node_modules/@jest/source-map": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", @@ -13343,7 +13120,6 @@ }, "node_modules/jest-runner/node_modules/@jest/test-result": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/console": "^29.7.0", @@ -13357,7 +13133,6 @@ }, "node_modules/jest-runner/node_modules/@jest/transform": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", @@ -13382,7 +13157,6 @@ }, "node_modules/jest-runner/node_modules/@jest/types": { "version": "29.6.3", - "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -13398,12 +13172,10 @@ }, "node_modules/jest-runner/node_modules/@sinclair/typebox": { "version": "0.27.8", - "dev": true, "license": "MIT" }, "node_modules/jest-runner/node_modules/@sinonjs/commons": { "version": "3.0.1", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "type-detect": "4.0.8" @@ -13411,7 +13183,6 @@ }, "node_modules/jest-runner/node_modules/@sinonjs/fake-timers": { "version": "10.3.0", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.0" @@ -13419,7 +13190,6 @@ }, "node_modules/jest-runner/node_modules/ansi-styles": { "version": "5.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -13430,7 +13200,6 @@ }, "node_modules/jest-runner/node_modules/camelcase": { "version": "6.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -13441,7 +13210,6 @@ }, "node_modules/jest-runner/node_modules/diff-sequences": { "version": "29.6.3", - "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -13449,7 +13217,6 @@ }, "node_modules/jest-runner/node_modules/expect": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/expect-utils": "^29.7.0", @@ -13464,7 +13231,6 @@ }, "node_modules/jest-runner/node_modules/jest-diff": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -13478,7 +13244,6 @@ }, "node_modules/jest-runner/node_modules/jest-environment-node": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", @@ -13494,7 +13259,6 @@ }, "node_modules/jest-runner/node_modules/jest-get-type": { "version": "29.6.3", - "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -13502,7 +13266,6 @@ }, "node_modules/jest-runner/node_modules/jest-haste-map": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -13526,7 +13289,6 @@ }, "node_modules/jest-runner/node_modules/jest-matcher-utils": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -13540,7 +13302,6 @@ }, "node_modules/jest-runner/node_modules/jest-message-util": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.12.13", @@ -13559,7 +13320,6 @@ }, "node_modules/jest-runner/node_modules/jest-mock": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -13572,7 +13332,6 @@ }, "node_modules/jest-runner/node_modules/jest-regex-util": { "version": "29.6.3", - "dev": true, "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -13580,7 +13339,6 @@ }, "node_modules/jest-runner/node_modules/jest-resolve": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.0.0", @@ -13599,7 +13357,6 @@ }, "node_modules/jest-runner/node_modules/jest-runtime": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", @@ -13631,7 +13388,6 @@ }, "node_modules/jest-runner/node_modules/jest-snapshot": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", @@ -13661,7 +13417,6 @@ }, "node_modules/jest-runner/node_modules/jest-util": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -13677,7 +13432,6 @@ }, "node_modules/jest-runner/node_modules/jest-validate": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/types": "^29.6.3", @@ -13693,7 +13447,6 @@ }, "node_modules/jest-runner/node_modules/jest-watcher": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/test-result": "^29.7.0", @@ -13711,7 +13464,6 @@ }, "node_modules/jest-runner/node_modules/jest-worker": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", @@ -13725,7 +13477,6 @@ }, "node_modules/jest-runner/node_modules/pretty-format": { "version": "29.7.0", - "dev": true, "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", @@ -13738,7 +13489,6 @@ }, "node_modules/jest-runner/node_modules/resolve.exports": { "version": "2.0.2", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -13746,7 +13496,6 @@ }, "node_modules/jest-runner/node_modules/slash": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -13754,7 +13503,6 @@ }, "node_modules/jest-runner/node_modules/supports-color": { "version": "8.1.1", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -13841,7 +13589,7 @@ }, "node_modules/jest-util": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jest/types": "^28.1.3", @@ -13857,7 +13605,7 @@ }, "node_modules/jest-validate": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jest/types": "^28.1.3", @@ -13873,7 +13621,7 @@ }, "node_modules/jest-validate/node_modules/camelcase": { "version": "6.3.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -13913,7 +13661,7 @@ }, "node_modules/jest-worker": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@types/node": "*", @@ -13926,7 +13674,7 @@ }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -13947,12 +13695,10 @@ }, "node_modules/js-tokens": { "version": "4.0.0", - "dev": true, "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -14056,7 +13802,6 @@ }, "node_modules/jsesc": { "version": "2.5.2", - "dev": true, "license": "MIT", "bin": { "jsesc": "bin/jsesc" @@ -14180,7 +13925,6 @@ }, "node_modules/jshint": { "version": "2.13.6", - "dev": true, "license": "MIT", "dependencies": { "cli": "~1.0.0", @@ -14197,7 +13941,6 @@ }, "node_modules/jshint/node_modules/dom-serializer": { "version": "0.2.2", - "dev": true, "license": "MIT", "dependencies": { "domelementtype": "^2.0.1", @@ -14206,7 +13949,6 @@ }, "node_modules/jshint/node_modules/dom-serializer/node_modules/domelementtype": { "version": "2.3.0", - "dev": true, "funding": [ { "type": "github", @@ -14217,7 +13959,6 @@ }, "node_modules/jshint/node_modules/dom-serializer/node_modules/entities": { "version": "2.2.0", - "dev": true, "license": "BSD-2-Clause", "funding": { "url": "https://github.com/fb55/entities?sponsor=1" @@ -14225,19 +13966,16 @@ }, "node_modules/jshint/node_modules/domelementtype": { "version": "1.3.1", - "dev": true, "license": "BSD-2-Clause" }, "node_modules/jshint/node_modules/domhandler": { "version": "2.3.0", - "dev": true, "dependencies": { "domelementtype": "1" } }, "node_modules/jshint/node_modules/domutils": { "version": "1.5.1", - "dev": true, "dependencies": { "dom-serializer": "0", "domelementtype": "1" @@ -14245,12 +13983,10 @@ }, "node_modules/jshint/node_modules/entities": { "version": "1.0.0", - "dev": true, "license": "BSD-like" }, "node_modules/jshint/node_modules/htmlparser2": { "version": "3.8.3", - "dev": true, "license": "MIT", "dependencies": { "domelementtype": "1", @@ -14262,12 +13998,10 @@ }, "node_modules/jshint/node_modules/isarray": { "version": "0.0.1", - "dev": true, "license": "MIT" }, "node_modules/jshint/node_modules/minimatch": { "version": "3.0.8", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -14278,7 +14012,6 @@ }, "node_modules/jshint/node_modules/readable-stream": { "version": "1.1.14", - "dev": true, "license": "MIT", "dependencies": { "core-util-is": "~1.0.0", @@ -14289,12 +14022,10 @@ }, "node_modules/jshint/node_modules/string_decoder": { "version": "0.10.31", - "dev": true, "license": "MIT" }, "node_modules/jshint/node_modules/strip-json-comments": { "version": "1.0.4", - "dev": true, "license": "MIT", "bin": { "strip-json-comments": "cli.js" @@ -14305,7 +14036,6 @@ }, "node_modules/json-buffer": { "version": "3.0.1", - "dev": true, "license": "MIT" }, "node_modules/json-fixer": { @@ -14337,12 +14067,10 @@ }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "dev": true, "license": "MIT" }, "node_modules/json-stringify-nice": { @@ -14361,7 +14089,6 @@ }, "node_modules/json5": { "version": "2.2.3", - "dev": true, "license": "MIT", "bin": { "json5": "lib/cli.js" @@ -14372,7 +14099,6 @@ }, "node_modules/jsonc-parser": { "version": "3.2.0", - "dev": true, "license": "MIT" }, "node_modules/jsonfile": { @@ -14488,7 +14214,6 @@ }, "node_modules/keyv": { "version": "4.5.4", - "dev": true, "license": "MIT", "dependencies": { "json-buffer": "3.0.1" @@ -15664,7 +15389,6 @@ }, "node_modules/leven": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -15672,7 +15396,6 @@ }, "node_modules/levn": { "version": "0.4.1", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", @@ -15813,7 +15536,6 @@ }, "node_modules/locate-path": { "version": "6.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-locate": "^5.0.0" @@ -15874,7 +15596,6 @@ }, "node_modules/lodash.merge": { "version": "4.6.2", - "dev": true, "license": "MIT" }, "node_modules/lodash.once": { @@ -15897,7 +15618,6 @@ }, "node_modules/lru-cache": { "version": "5.1.1", - "dev": true, "license": "ISC", "dependencies": { "yallist": "^3.0.2" @@ -15946,7 +15666,6 @@ }, "node_modules/makeerror": { "version": "1.0.12", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "tmpl": "1.0.5" @@ -15981,7 +15700,6 @@ }, "node_modules/md5-file": { "version": "5.0.0", - "dev": true, "license": "MIT", "bin": { "md5-file": "cli.js" @@ -15992,7 +15710,6 @@ }, "node_modules/mdast-util-from-markdown": { "version": "0.8.5", - "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^3.0.0", @@ -16008,7 +15725,6 @@ }, "node_modules/mdast-util-to-string": { "version": "2.0.0", - "dev": true, "license": "MIT", "funding": { "type": "opencollective", @@ -16218,7 +15934,6 @@ }, "node_modules/merge-stream": { "version": "2.0.0", - "dev": true, "license": "MIT" }, "node_modules/merge2": { @@ -16238,7 +15953,6 @@ }, "node_modules/micromark": { "version": "2.11.4", - "dev": true, "funding": [ { "type": "GitHub Sponsors", @@ -16257,7 +15971,6 @@ }, "node_modules/micromatch": { "version": "4.0.8", - "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -16311,7 +16024,6 @@ }, "node_modules/minimatch": { "version": "3.1.2", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -16511,7 +16223,6 @@ }, "node_modules/mongodb": { "version": "4.17.2", - "dev": true, "license": "Apache-2.0", "dependencies": { "bson": "^4.7.2", @@ -16547,7 +16258,6 @@ }, "node_modules/mongodb-memory-server": { "version": "8.16.1", - "dev": true, "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -16560,7 +16270,6 @@ }, "node_modules/mongodb-memory-server-core": { "version": "8.16.1", - "dev": true, "license": "MIT", "dependencies": { "async-mutex": "^0.3.2", @@ -16585,7 +16294,6 @@ }, "node_modules/mongodb-memory-server-core/node_modules/camelcase": { "version": "6.3.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -16596,12 +16304,10 @@ }, "node_modules/mongodb-memory-server-core/node_modules/tslib": { "version": "2.6.3", - "dev": true, "license": "0BSD" }, "node_modules/mongodb-memory-server-core/node_modules/uuid": { "version": "9.0.1", - "dev": true, "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -16613,7 +16319,6 @@ }, "node_modules/mongodb-memory-server/node_modules/tslib": { "version": "2.6.3", - "dev": true, "license": "0BSD" }, "node_modules/mongoose": { @@ -16705,7 +16410,6 @@ }, "node_modules/mute-stream": { "version": "1.0.0", - "dev": true, "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -16713,7 +16417,6 @@ }, "node_modules/natural-compare": { "version": "1.4.0", - "dev": true, "license": "MIT" }, "node_modules/negotiator": { @@ -16735,7 +16438,6 @@ }, "node_modules/new-find-package-json": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "debug": "^4.3.4" @@ -16905,7 +16607,6 @@ }, "node_modules/node-int64": { "version": "0.4.0", - "dev": true, "license": "MIT" }, "node_modules/node-machine-id": { @@ -16915,7 +16616,6 @@ }, "node_modules/node-releases": { "version": "2.0.18", - "dev": true, "license": "MIT" }, "node_modules/nopt": { @@ -16949,7 +16649,6 @@ }, "node_modules/normalize-path": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -17397,7 +17096,6 @@ }, "node_modules/once": { "version": "1.4.0", - "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -17418,7 +17116,6 @@ }, "node_modules/open": { "version": "8.4.2", - "dev": true, "license": "MIT", "dependencies": { "define-lazy-prop": "^2.0.0", @@ -17438,7 +17135,6 @@ }, "node_modules/optionator": { "version": "0.9.4", - "dev": true, "license": "MIT", "dependencies": { "deep-is": "^0.1.3", @@ -17515,7 +17211,6 @@ }, "node_modules/p-limit": { "version": "3.1.0", - "dev": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -17529,7 +17224,6 @@ }, "node_modules/p-locate": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-limit": "^3.0.2" @@ -17613,7 +17307,6 @@ }, "node_modules/p-try": { "version": "2.2.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -17671,7 +17364,6 @@ }, "node_modules/parent-module": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -17707,7 +17399,6 @@ }, "node_modules/parse-entities": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "character-entities": "^1.0.0", @@ -17800,7 +17491,6 @@ }, "node_modules/path-exists": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -17808,7 +17498,6 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -17816,7 +17505,6 @@ }, "node_modules/path-key": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -17824,7 +17512,6 @@ }, "node_modules/path-parse": { "version": "1.0.7", - "dev": true, "license": "MIT" }, "node_modules/path-scurry": { @@ -17872,17 +17559,14 @@ }, "node_modules/pend": { "version": "1.2.0", - "dev": true, "license": "MIT" }, "node_modules/picocolors": { "version": "1.0.1", - "dev": true, "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8.6" @@ -17904,7 +17588,6 @@ }, "node_modules/pirates": { "version": "4.0.6", - "dev": true, "license": "MIT", "engines": { "node": ">= 6" @@ -17985,7 +17668,6 @@ }, "node_modules/pkg-dir": { "version": "4.2.0", - "dev": true, "license": "MIT", "dependencies": { "find-up": "^4.0.0" @@ -17996,7 +17678,6 @@ }, "node_modules/pkg-dir/node_modules/find-up": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -18008,7 +17689,6 @@ }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", - "dev": true, "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -18019,7 +17699,6 @@ }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", - "dev": true, "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -18033,7 +17712,6 @@ }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -18064,7 +17742,6 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -18086,7 +17763,7 @@ }, "node_modules/pretty-format": { "version": "28.1.3", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@jest/schemas": "^28.1.3", @@ -18100,7 +17777,7 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -18301,7 +17978,6 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", - "dev": true, "funding": [ { "type": "github", @@ -18370,7 +18046,6 @@ }, "node_modules/react-is": { "version": "18.3.1", - "dev": true, "license": "MIT" }, "node_modules/read": { @@ -18682,7 +18357,6 @@ }, "node_modules/resolve": { "version": "1.22.8", - "dev": true, "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", @@ -18717,7 +18391,6 @@ }, "node_modules/resolve-from": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -18725,7 +18398,7 @@ }, "node_modules/resolve.exports": { "version": "1.1.1", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -18752,7 +18425,6 @@ }, "node_modules/reusify": { "version": "1.0.4", - "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -18761,7 +18433,6 @@ }, "node_modules/rimraf": { "version": "3.0.2", - "dev": true, "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -18797,7 +18468,6 @@ }, "node_modules/run-parallel": { "version": "1.2.0", - "dev": true, "funding": [ { "type": "github", @@ -19074,7 +18744,6 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -19085,7 +18754,6 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19377,7 +19045,6 @@ }, "node_modules/source-map": { "version": "0.6.1", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -19385,7 +19052,6 @@ }, "node_modules/source-map-support": { "version": "0.5.13", - "dev": true, "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", @@ -19464,7 +19130,6 @@ }, "node_modules/stack-utils": { "version": "2.0.6", - "dev": true, "license": "MIT", "dependencies": { "escape-string-regexp": "^2.0.0" @@ -19475,7 +19140,6 @@ }, "node_modules/stack-utils/node_modules/escape-string-regexp": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19509,7 +19173,6 @@ }, "node_modules/string-length": { "version": "4.0.2", - "dev": true, "license": "MIT", "dependencies": { "char-regex": "^1.0.2", @@ -19622,7 +19285,6 @@ }, "node_modules/strip-bom": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19649,7 +19311,6 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19714,7 +19375,6 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -19784,7 +19444,6 @@ }, "node_modules/tar-stream": { "version": "2.2.0", - "dev": true, "license": "MIT", "dependencies": { "bl": "^4.0.3", @@ -19858,7 +19517,6 @@ }, "node_modules/test-exclude": { "version": "6.0.0", - "dev": true, "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", @@ -19879,7 +19537,6 @@ }, "node_modules/text-table": { "version": "0.2.0", - "dev": true, "license": "MIT" }, "node_modules/through": { @@ -19911,12 +19568,10 @@ }, "node_modules/tmpl": { "version": "1.0.5", - "dev": true, "license": "BSD-3-Clause" }, "node_modules/to-fast-properties": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -19924,7 +19579,6 @@ }, "node_modules/to-regex-range": { "version": "5.0.1", - "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -20106,7 +19760,6 @@ }, "node_modules/type-check": { "version": "0.4.0", - "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" @@ -20117,7 +19770,6 @@ }, "node_modules/type-detect": { "version": "4.0.8", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -20306,7 +19958,6 @@ }, "node_modules/unist-util-stringify-position": { "version": "2.0.3", - "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^2.0.2" @@ -20347,7 +19998,6 @@ }, "node_modules/update-browserslist-db": { "version": "1.1.0", - "dev": true, "funding": [ { "type": "opencollective", @@ -20376,7 +20026,6 @@ }, "node_modules/uri-js": { "version": "4.4.1", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -20491,7 +20140,6 @@ }, "node_modules/vscode-json-languageservice": { "version": "4.2.1", - "dev": true, "license": "MIT", "dependencies": { "jsonc-parser": "^3.0.0", @@ -20503,22 +20151,18 @@ }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", - "dev": true, "license": "MIT" }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", - "dev": true, "license": "MIT" }, "node_modules/vscode-nls": { "version": "5.2.0", - "dev": true, "license": "MIT" }, "node_modules/vscode-uri": { "version": "3.0.8", - "dev": true, "license": "MIT" }, "node_modules/w3c-hr-time": { @@ -20548,7 +20192,6 @@ }, "node_modules/walker": { "version": "1.0.8", - "dev": true, "license": "Apache-2.0", "dependencies": { "makeerror": "1.0.12" @@ -20630,7 +20273,6 @@ }, "node_modules/which": { "version": "2.0.2", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -20743,7 +20385,6 @@ }, "node_modules/word-wrap": { "version": "1.2.5", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -20805,12 +20446,10 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "dev": true, "license": "ISC" }, "node_modules/write-file-atomic": { "version": "4.0.2", - "dev": true, "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", @@ -20967,7 +20606,6 @@ }, "node_modules/yallist": { "version": "3.1.1", - "dev": true, "license": "ISC" }, "node_modules/yaml": { @@ -21092,7 +20730,6 @@ }, "node_modules/yauzl": { "version": "2.10.0", - "dev": true, "license": "MIT", "dependencies": { "buffer-crc32": "~0.2.3", @@ -21109,7 +20746,6 @@ }, "node_modules/yocto-queue": { "version": "0.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -21120,7 +20756,6 @@ }, "node_modules/yoctocolors-cjs": { "version": "2.1.2", - "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -28082,93 +27717,2443 @@ "node": ">=12" } }, - "packages/v1-ready/salesforce": { - "name": "@friggframework/api-module-salesforce", - "version": "1.0.2", + "packages/v1-ready/openphone": { + "name": "@friggframework/api-module-openphone", + "version": "1.0.0", "license": "MIT", "dependencies": { - "@friggframework/core": "^1.1.6", - "jsforce": "^3.8.1" + "@friggframework/core": "^2.0.0-next.24", + "@friggframework/devtools": "^2.0.0-next.24", + "dotenv": "^16.0.0" }, "devDependencies": { - "@friggframework/devtools": "^1.1.6", - "@friggframework/test": "^1.1.6", - "dotenv": "^16.0.3", - "eslint": "^8.22.0", - "jest": "^28.1.3", - "jest-environment-jsdom": "^28.1.3", - "prettier": "^2.7.1" - } - }, - "packages/v1-ready/salesforce/node_modules/dotenv": { - "version": "16.4.5", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" + "jest": "^29.0.0" } }, - "packages/v1-ready/stripe": { - "name": "@friggframework/api-module-stripe", - "version": "1.0.0", + "packages/v1-ready/openphone/node_modules/@friggframework/core": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/core/-/core-2.0.0-next.24.tgz", + "integrity": "sha512-H1kETo3/Gxm5GQuYPVYdLKodfeI/+pSoDouG8+k5KavwD2HJAl7oNp2vLcbUm/snMnJCVlq0ScTHwBgbu/t7CA==", "license": "MIT", "dependencies": { - "@friggframework/core": "^1.2.2", - "stripe": "^16.7.0" - }, - "devDependencies": { - "@faker-js/faker": "^8.4.1", - "@friggframework/devtools": "^1.2.2", - "@friggframework/prettier-config": "^1.2.2", - "@friggframework/test": "^1.2.2", - "dotenv": "^16.4.5", - "eslint": "^9.9.0", - "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0", - "nock": "^13.5.4", - "prettier": "^3.3.3" + "@hapi/boom": "^10.0.1", + "aws-sdk": "^2.1200.0", + "bcryptjs": "^2.4.3", + "body-parser": "^1.20.2", + "common-tags": "^1.8.2", + "cors": "^2.8.5", + "dotenv": "^16.4.7", + "express": "^4.19.2", + "express-async-handler": "^1.2.0", + "form-data": "^4.0.0", + "fs-extra": "^11.2.0", + "lodash": "4.17.21", + "lodash.get": "^4.4.2", + "mongoose": "6.11.6", + "node-fetch": "^2.6.7", + "serverless-http": "^2.7.0", + "uuid": "^9.0.1" } }, - "packages/v1-ready/stripe/node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "dev": true, + "packages/v1-ready/openphone/node_modules/@friggframework/devtools": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/devtools/-/devtools-2.0.0-next.24.tgz", + "integrity": "sha512-s0dCeBZmKeGfDeyRhIYGZpWG+VPGTBiisaHZIlaWqAcHJM2aa3m8SzGA/dst29wGomuQYefJ6TAmRnFWJR1XiQ==", "license": "MIT", "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "@babel/eslint-parser": "^7.18.9", + "@babel/parser": "^7.25.3", + "@babel/traverse": "^7.25.3", + "@friggframework/test": "2.0.0-next.24", + "@hapi/boom": "^10.0.1", + "@inquirer/prompts": "^5.3.8", + "axios": "^1.7.2", + "body-parser": "^1.20.2", + "commander": "^12.1.0", + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "eslint": "^8.22.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-markdown": "^3.0.0", + "eslint-plugin-no-only-tests": "^3.0.0", + "eslint-plugin-yaml": "^0.5.0", + "express": "^4.19.2", + "express-async-handler": "^1.2.0", + "fs-extra": "^11.2.0", + "lodash": "4.17.21", + "serverless-http": "^2.7.0" }, - "funding": { - "url": "https://opencollective.com/eslint" + "bin": { + "frigg": "frigg-cli/index.js" } }, - "packages/v1-ready/stripe/node_modules/@eslint/js": { - "version": "9.24.0", - "dev": true, + "packages/v1-ready/openphone/node_modules/@friggframework/test": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/test/-/test-2.0.0-next.24.tgz", + "integrity": "sha512-Gcayu3UDw+rOsF3Ckqa3l5UzsrxyBhcvNc+s5EnNMlaUEYdsJtkJimF4P5jqD0Bu5KpICpqVxvFC0l/ikHEidA==", "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "dependencies": { + "@babel/eslint-parser": "^7.18.9", + "eslint": "^8.22.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-markdown": "^3.0.0", + "eslint-plugin-no-only-tests": "^3.0.0", + "eslint-plugin-yaml": "^0.5.0", + "jest-runner-groups": "^2.2.0", + "mongodb-memory-server": "^8.9.0", + "open": "^8.4.2" } }, - "packages/v1-ready/stripe/node_modules/@jest/core": { + "packages/v1-ready/openphone/node_modules/@jest/console": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/openphone/node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/openphone/node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "packages/v1-ready/openphone/node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "packages/v1-ready/openphone/node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "packages/v1-ready/openphone/node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "packages/v1-ready/openphone/node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/v1-ready/openphone/node_modules/dedent": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.6.0.tgz", + "integrity": "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "packages/v1-ready/openphone/node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/dotenv": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", + "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "packages/v1-ready/openphone/node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "packages/v1-ready/openphone/node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/openphone/node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/openphone/node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "packages/v1-ready/openphone/node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "packages/v1-ready/openphone/node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/mongodb": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.16.0.tgz", + "integrity": "sha512-0EB113Fsucaq1wsY0dOhi1fmZOwFtLOtteQkiqOXGklvWMnSH3g2QS53f0KTP+/6qOkuoXE2JksubSZNmxeI+g==", + "license": "Apache-2.0", + "dependencies": { + "bson": "^4.7.2", + "mongodb-connection-string-url": "^2.5.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">=12.9.0" + }, + "optionalDependencies": { + "@aws-sdk/credential-providers": "^3.186.0", + "saslprep": "^1.0.3" + } + }, + "packages/v1-ready/openphone/node_modules/mongoose": { + "version": "6.11.6", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.11.6.tgz", + "integrity": "sha512-CuVbeJrEbnxkPUNNFvXJhjVyqa5Ip7lkz6EJX6g7Lb3aFMTJ+LHOlUrncxzC3r20dqasaVIiwcA6Y5qC8PWQ7w==", + "license": "MIT", + "dependencies": { + "bson": "^4.7.2", + "kareem": "2.5.1", + "mongodb": "4.16.0", + "mpath": "0.9.0", + "mquery": "4.0.3", + "ms": "2.1.3", + "sift": "16.0.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "packages/v1-ready/openphone/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "packages/v1-ready/openphone/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/openphone/node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "packages/v1-ready/openphone/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/v1-ready/openphone/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "packages/v1-ready/openphone/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "packages/v1-ready/openphone/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "packages/v1-ready/openphone/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "packages/v1-ready/pipedrive": { + "name": "@friggframework/api-module-pipedrive", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@friggframework/core": "^2.0.0-next.24", + "@friggframework/devtools": "^2.0.0-next.24", + "dotenv": "^16.0.0" + }, + "devDependencies": { + "jest": "^29.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@friggframework/core": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/core/-/core-2.0.0-next.24.tgz", + "integrity": "sha512-H1kETo3/Gxm5GQuYPVYdLKodfeI/+pSoDouG8+k5KavwD2HJAl7oNp2vLcbUm/snMnJCVlq0ScTHwBgbu/t7CA==", + "license": "MIT", + "dependencies": { + "@hapi/boom": "^10.0.1", + "aws-sdk": "^2.1200.0", + "bcryptjs": "^2.4.3", + "body-parser": "^1.20.2", + "common-tags": "^1.8.2", + "cors": "^2.8.5", + "dotenv": "^16.4.7", + "express": "^4.19.2", + "express-async-handler": "^1.2.0", + "form-data": "^4.0.0", + "fs-extra": "^11.2.0", + "lodash": "4.17.21", + "lodash.get": "^4.4.2", + "mongoose": "6.11.6", + "node-fetch": "^2.6.7", + "serverless-http": "^2.7.0", + "uuid": "^9.0.1" + } + }, + "packages/v1-ready/pipedrive/node_modules/@friggframework/devtools": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/devtools/-/devtools-2.0.0-next.24.tgz", + "integrity": "sha512-s0dCeBZmKeGfDeyRhIYGZpWG+VPGTBiisaHZIlaWqAcHJM2aa3m8SzGA/dst29wGomuQYefJ6TAmRnFWJR1XiQ==", + "license": "MIT", + "dependencies": { + "@babel/eslint-parser": "^7.18.9", + "@babel/parser": "^7.25.3", + "@babel/traverse": "^7.25.3", + "@friggframework/test": "2.0.0-next.24", + "@hapi/boom": "^10.0.1", + "@inquirer/prompts": "^5.3.8", + "axios": "^1.7.2", + "body-parser": "^1.20.2", + "commander": "^12.1.0", + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "eslint": "^8.22.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-markdown": "^3.0.0", + "eslint-plugin-no-only-tests": "^3.0.0", + "eslint-plugin-yaml": "^0.5.0", + "express": "^4.19.2", + "express-async-handler": "^1.2.0", + "fs-extra": "^11.2.0", + "lodash": "4.17.21", + "serverless-http": "^2.7.0" + }, + "bin": { + "frigg": "frigg-cli/index.js" + } + }, + "packages/v1-ready/pipedrive/node_modules/@friggframework/test": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/test/-/test-2.0.0-next.24.tgz", + "integrity": "sha512-Gcayu3UDw+rOsF3Ckqa3l5UzsrxyBhcvNc+s5EnNMlaUEYdsJtkJimF4P5jqD0Bu5KpICpqVxvFC0l/ikHEidA==", + "license": "MIT", + "dependencies": { + "@babel/eslint-parser": "^7.18.9", + "eslint": "^8.22.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-markdown": "^3.0.0", + "eslint-plugin-no-only-tests": "^3.0.0", + "eslint-plugin-yaml": "^0.5.0", + "jest-runner-groups": "^2.2.0", + "mongodb-memory-server": "^8.9.0", + "open": "^8.4.2" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "packages/v1-ready/pipedrive/node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "packages/v1-ready/pipedrive/node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "packages/v1-ready/pipedrive/node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/v1-ready/pipedrive/node_modules/dedent": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.6.0.tgz", + "integrity": "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "packages/v1-ready/pipedrive/node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/dotenv": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", + "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "packages/v1-ready/pipedrive/node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/mongodb": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.16.0.tgz", + "integrity": "sha512-0EB113Fsucaq1wsY0dOhi1fmZOwFtLOtteQkiqOXGklvWMnSH3g2QS53f0KTP+/6qOkuoXE2JksubSZNmxeI+g==", + "license": "Apache-2.0", + "dependencies": { + "bson": "^4.7.2", + "mongodb-connection-string-url": "^2.5.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">=12.9.0" + }, + "optionalDependencies": { + "@aws-sdk/credential-providers": "^3.186.0", + "saslprep": "^1.0.3" + } + }, + "packages/v1-ready/pipedrive/node_modules/mongoose": { + "version": "6.11.6", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.11.6.tgz", + "integrity": "sha512-CuVbeJrEbnxkPUNNFvXJhjVyqa5Ip7lkz6EJX6g7Lb3aFMTJ+LHOlUrncxzC3r20dqasaVIiwcA6Y5qC8PWQ7w==", + "license": "MIT", + "dependencies": { + "bson": "^4.7.2", + "kareem": "2.5.1", + "mongodb": "4.16.0", + "mpath": "0.9.0", + "mquery": "4.0.3", + "ms": "2.1.3", + "sift": "16.0.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "packages/v1-ready/pipedrive/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "packages/v1-ready/pipedrive/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "packages/v1-ready/pipedrive/node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "packages/v1-ready/pipedrive/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "packages/v1-ready/pipedrive/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "packages/v1-ready/pipedrive/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "packages/v1-ready/pipedrive/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "packages/v1-ready/pipedrive/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "packages/v1-ready/salesforce": { + "name": "@friggframework/api-module-salesforce", + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "@friggframework/core": "^1.1.6", + "jsforce": "^3.8.1" + }, + "devDependencies": { + "@friggframework/devtools": "^1.1.6", + "@friggframework/test": "^1.1.6", + "dotenv": "^16.0.3", + "eslint": "^8.22.0", + "jest": "^28.1.3", + "jest-environment-jsdom": "^28.1.3", + "prettier": "^2.7.1" + } + }, + "packages/v1-ready/salesforce/node_modules/dotenv": { + "version": "16.4.5", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "packages/v1-ready/stripe": { + "name": "@friggframework/api-module-stripe", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@friggframework/core": "^1.2.2", + "stripe": "^16.7.0" + }, + "devDependencies": { + "@faker-js/faker": "^8.4.1", + "@friggframework/devtools": "^1.2.2", + "@friggframework/prettier-config": "^1.2.2", + "@friggframework/test": "^1.2.2", + "dotenv": "^16.4.5", + "eslint": "^9.9.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "nock": "^13.5.4", + "prettier": "^3.3.3" + } + }, + "packages/v1-ready/stripe/node_modules/@eslint/eslintrc": { + "version": "3.3.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "packages/v1-ready/stripe/node_modules/@eslint/js": { + "version": "9.24.0", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "packages/v1-ready/stripe/node_modules/@jest/core": { + "version": "29.7.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", "@jest/test-result": "^29.7.0", "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", @@ -29895,10 +31880,10 @@ "version": "1.0.2", "license": "MIT", "dependencies": { - "@friggframework/core": "^1.1.2" + "@friggframework/core": "^2.0.0-next.24" }, "devDependencies": { - "@friggframework/devtools": "^1.1.2", + "@friggframework/devtools": "^2.0.0-next.24", "@friggframework/test": "^1.1.2", "dotenv": "^16.0.3", "eslint": "^8.22.0", @@ -29907,9 +31892,88 @@ "prettier": "^2.7.1" } }, - "packages/v1-ready/zoho-crm/node_modules/dotenv": { - "version": "16.4.5", + "packages/v1-ready/zoho-crm/node_modules/@friggframework/core": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/core/-/core-2.0.0-next.24.tgz", + "integrity": "sha512-H1kETo3/Gxm5GQuYPVYdLKodfeI/+pSoDouG8+k5KavwD2HJAl7oNp2vLcbUm/snMnJCVlq0ScTHwBgbu/t7CA==", + "license": "MIT", + "dependencies": { + "@hapi/boom": "^10.0.1", + "aws-sdk": "^2.1200.0", + "bcryptjs": "^2.4.3", + "body-parser": "^1.20.2", + "common-tags": "^1.8.2", + "cors": "^2.8.5", + "dotenv": "^16.4.7", + "express": "^4.19.2", + "express-async-handler": "^1.2.0", + "form-data": "^4.0.0", + "fs-extra": "^11.2.0", + "lodash": "4.17.21", + "lodash.get": "^4.4.2", + "mongoose": "6.11.6", + "node-fetch": "^2.6.7", + "serverless-http": "^2.7.0", + "uuid": "^9.0.1" + } + }, + "packages/v1-ready/zoho-crm/node_modules/@friggframework/devtools": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/devtools/-/devtools-2.0.0-next.24.tgz", + "integrity": "sha512-s0dCeBZmKeGfDeyRhIYGZpWG+VPGTBiisaHZIlaWqAcHJM2aa3m8SzGA/dst29wGomuQYefJ6TAmRnFWJR1XiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/eslint-parser": "^7.18.9", + "@babel/parser": "^7.25.3", + "@babel/traverse": "^7.25.3", + "@friggframework/test": "2.0.0-next.24", + "@hapi/boom": "^10.0.1", + "@inquirer/prompts": "^5.3.8", + "axios": "^1.7.2", + "body-parser": "^1.20.2", + "commander": "^12.1.0", + "cors": "^2.8.5", + "dotenv": "^16.4.5", + "eslint": "^8.22.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-markdown": "^3.0.0", + "eslint-plugin-no-only-tests": "^3.0.0", + "eslint-plugin-yaml": "^0.5.0", + "express": "^4.19.2", + "express-async-handler": "^1.2.0", + "fs-extra": "^11.2.0", + "lodash": "4.17.21", + "serverless-http": "^2.7.0" + }, + "bin": { + "frigg": "frigg-cli/index.js" + } + }, + "packages/v1-ready/zoho-crm/node_modules/@friggframework/devtools/node_modules/@friggframework/test": { + "version": "2.0.0-next.24", + "resolved": "https://registry.npmjs.org/@friggframework/test/-/test-2.0.0-next.24.tgz", + "integrity": "sha512-Gcayu3UDw+rOsF3Ckqa3l5UzsrxyBhcvNc+s5EnNMlaUEYdsJtkJimF4P5jqD0Bu5KpICpqVxvFC0l/ikHEidA==", "dev": true, + "license": "MIT", + "dependencies": { + "@babel/eslint-parser": "^7.18.9", + "eslint": "^8.22.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-json": "^3.1.0", + "eslint-plugin-markdown": "^3.0.0", + "eslint-plugin-no-only-tests": "^3.0.0", + "eslint-plugin-yaml": "^0.5.0", + "jest-runner-groups": "^2.2.0", + "mongodb-memory-server": "^8.9.0", + "open": "^8.4.2" + } + }, + "packages/v1-ready/zoho-crm/node_modules/dotenv": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", + "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -29918,6 +31982,65 @@ "url": "https://dotenvx.com" } }, + "packages/v1-ready/zoho-crm/node_modules/mongodb": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.16.0.tgz", + "integrity": "sha512-0EB113Fsucaq1wsY0dOhi1fmZOwFtLOtteQkiqOXGklvWMnSH3g2QS53f0KTP+/6qOkuoXE2JksubSZNmxeI+g==", + "license": "Apache-2.0", + "dependencies": { + "bson": "^4.7.2", + "mongodb-connection-string-url": "^2.5.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">=12.9.0" + }, + "optionalDependencies": { + "@aws-sdk/credential-providers": "^3.186.0", + "saslprep": "^1.0.3" + } + }, + "packages/v1-ready/zoho-crm/node_modules/mongoose": { + "version": "6.11.6", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.11.6.tgz", + "integrity": "sha512-CuVbeJrEbnxkPUNNFvXJhjVyqa5Ip7lkz6EJX6g7Lb3aFMTJ+LHOlUrncxzC3r20dqasaVIiwcA6Y5qC8PWQ7w==", + "license": "MIT", + "dependencies": { + "bson": "^4.7.2", + "kareem": "2.5.1", + "mongodb": "4.16.0", + "mpath": "0.9.0", + "mquery": "4.0.3", + "ms": "2.1.3", + "sift": "16.0.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "packages/v1-ready/zoho-crm/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "packages/v1-ready/zoho-crm/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "packages/v1-ready/zoom": { "name": "@friggframework/api-module-zoom", "version": "1.0.0", diff --git a/packages/v1-ready/openphone/CHANGELOG.md b/packages/v1-ready/openphone/CHANGELOG.md new file mode 100644 index 0000000..d0e5470 --- /dev/null +++ b/packages/v1-ready/openphone/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to the `@friggframework/api-module-openphone` package will be documented in this file. + +## [1.0.0] - 2025-06-02 + +### Added +- Initial release +- Support for OpenPhone API key authentication +- Basic API operations for: + - Calls + - Messages + - Contacts + - Phone Numbers + - Users + - Webhooks \ No newline at end of file diff --git a/packages/v1-ready/openphone/README.md b/packages/v1-ready/openphone/README.md new file mode 100644 index 0000000..8160231 --- /dev/null +++ b/packages/v1-ready/openphone/README.md @@ -0,0 +1,12 @@ +# OpenPhone API Module + +This module provides an interface to the OpenPhone API. + +## Configuration + +Set the following environment variable: +- `OPENPHONE_API_KEY`: Your OpenPhone API key + +## Usage + +See the Frigg Framework documentation for usage instructions. \ No newline at end of file diff --git a/packages/v1-ready/openphone/api.js b/packages/v1-ready/openphone/api.js new file mode 100644 index 0000000..b7281e5 --- /dev/null +++ b/packages/v1-ready/openphone/api.js @@ -0,0 +1,298 @@ +const { ApiKeyRequester, get } = require('@friggframework/core'); + +class Api extends ApiKeyRequester { + constructor(params) { + super(params); + this.baseUrl = 'https://api.openphone.com'; + + // API key is expected to be passed as a parameter + this.api_key = get(params, 'api_key', null); + + this.URLs = { + // Calls endpoints + calls: '/v1/calls', + callById: (callId) => `/v1/calls/${callId}`, + callRecordings: (callId) => `/v1/call-recordings/${callId}`, + callSummary: (callId) => `/v1/call-summaries/${callId}`, + callTranscript: (callId) => `/v1/call-transcripts/${callId}`, + + // Messages endpoints + messages: '/v1/messages', + messageById: (messageId) => `/v1/messages/${messageId}`, + + // Contacts endpoints + contacts: '/v1/contacts', + contactById: (contactId) => `/v1/contacts/${contactId}`, + contactCustomFields: '/v1/contact-custom-fields', + + // Conversations endpoints + conversations: '/v1/conversations', + + // Phone Numbers endpoints + phoneNumbers: '/v1/phone-numbers', + + // Webhooks endpoints + webhooks: '/v1/webhooks', + webhookById: (webhookId) => `/v1/webhooks/${webhookId}`, + messageWebhooks: '/v1/webhooks/messages', + callWebhooks: '/v1/webhooks/calls', + callSummaryWebhooks: '/v1/webhooks/call-summaries', + callTranscriptWebhooks: '/v1/webhooks/call-transcripts', + }; + } + + // Calls API methods + async getCalls(options = {}) { + const query = this._cleanParams({ + phoneNumberId: options.phoneNumberId, + userId: options.userId, + participants: options.participants, + since: options.since, + createdAfter: options.createdAfter, + createdBefore: options.createdBefore, + maxResults: options.maxResults || 10, + pageToken: options.pageToken + }); + + return this._get({ + url: this.baseUrl + this.URLs.calls, + query + }); + } + + async getCallById(callId) { + return this._get({ + url: this.baseUrl + this.URLs.callById(callId) + }); + } + + async getCallRecordings(callId) { + return this._get({ + url: this.baseUrl + this.URLs.callRecordings(callId) + }); + } + + async getCallSummary(callId) { + return this._get({ + url: this.baseUrl + this.URLs.callSummary(callId) + }); + } + + async getCallTranscript(callId) { + return this._get({ + url: this.baseUrl + this.URLs.callTranscript(callId) + }); + } + + // Messages API methods + async getMessages(options = {}) { + const query = this._cleanParams({ + phoneNumberId: options.phoneNumberId, + userId: options.userId, + participants: options.participants, + since: options.since, + createdAfter: options.createdAfter, + createdBefore: options.createdBefore, + maxResults: options.maxResults || 10, + pageToken: options.pageToken + }); + + return this._get({ + url: this.baseUrl + this.URLs.messages, + query + }); + } + + async getMessageById(messageId) { + return this._get({ + url: this.baseUrl + this.URLs.messageById(messageId) + }); + } + + async sendMessage(body) { + return this._post({ + url: this.baseUrl + this.URLs.messages, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + // Contacts API methods + async getContacts(options = {}) { + const query = this._cleanParams({ + externalIds: options.externalIds, + sources: options.sources, + maxResults: options.maxResults || 10, + pageToken: options.pageToken + }); + + return this._get({ + url: this.baseUrl + this.URLs.contacts, + query + }); + } + + async getContactById(contactId) { + return this._get({ + url: this.baseUrl + this.URLs.contactById(contactId) + }); + } + + async createContact(body) { + return this._post({ + url: this.baseUrl + this.URLs.contacts, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updateContact(contactId, body) { + return this._patch({ + url: this.baseUrl + this.URLs.contactById(contactId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deleteContact(contactId) { + return this._delete({ + url: this.baseUrl + this.URLs.contactById(contactId) + }); + } + + async getContactCustomFields() { + return this._get({ + url: this.baseUrl + this.URLs.contactCustomFields + }); + } + + // Conversations API methods + async getConversations(options = {}) { + const query = this._cleanParams({ + phoneNumber: options.phoneNumber, + phoneNumbers: options.phoneNumbers, + userId: options.userId, + createdAfter: options.createdAfter, + createdBefore: options.createdBefore, + excludeInactive: options.excludeInactive, + updatedAfter: options.updatedAfter, + updatedBefore: options.updatedBefore, + maxResults: options.maxResults || 10, + pageToken: options.pageToken + }); + + return this._get({ + url: this.baseUrl + this.URLs.conversations, + query + }); + } + + // Phone Numbers API methods + async getPhoneNumbers(options = {}) { + const query = this._cleanParams({ + userId: options.userId + }); + + return this._get({ + url: this.baseUrl + this.URLs.phoneNumbers, + query + }); + } + + // Webhooks API methods + async getWebhooks(options = {}) { + const query = this._cleanParams({ + userId: options.userId + }); + + return this._get({ + url: this.baseUrl + this.URLs.webhooks, + query + }); + } + + async getWebhookById(webhookId) { + return this._get({ + url: this.baseUrl + this.URLs.webhookById(webhookId) + }); + } + + async deleteWebhook(webhookId) { + return this._delete({ + url: this.baseUrl + this.URLs.webhookById(webhookId) + }); + } + + async createMessageWebhook(body) { + return this._post({ + url: this.baseUrl + this.URLs.messageWebhooks, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async createCallWebhook(body) { + return this._post({ + url: this.baseUrl + this.URLs.callWebhooks, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async createCallSummaryWebhook(body) { + return this._post({ + url: this.baseUrl + this.URLs.callSummaryWebhooks, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async createCallTranscriptWebhook(body) { + return this._post({ + url: this.baseUrl + this.URLs.callTranscriptWebhooks, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + // Helper methods + async getCurrentUser() { + const phoneNumbers = await this.getPhoneNumbers(); + return phoneNumbers.data && phoneNumbers.data.length > 0 + ? phoneNumbers.data[0].users[0] + : null; + } + + _cleanParams(params) { + const cleaned = {}; + Object.keys(params).forEach(key => { + if (params[key] !== undefined && params[key] !== null) { + cleaned[key] = params[key]; + } + }); + return cleaned; + } + + addAuthHeaders(headers) { + if (this.api_key) { + headers.Authorization = this.api_key; + } + return headers; + } +} + +module.exports = { Api }; \ No newline at end of file diff --git a/packages/v1-ready/openphone/defaultConfig.json b/packages/v1-ready/openphone/defaultConfig.json new file mode 100644 index 0000000..825930b --- /dev/null +++ b/packages/v1-ready/openphone/defaultConfig.json @@ -0,0 +1,14 @@ +{ + "name": "openphone", + "label": "OpenPhone", + "productUrl": "https://openphone.com", + "apiDocs": "https://docs.openphone.com/api", + "logoUrl": "https://friggframework.org/assets/img/openphone-icon.png", + "categories": [ + "Communication", + "Phone", + "VoIP", + "Business Phone" + ], + "description": "OpenPhone is a modern business phone system built for startups and growing businesses" +} \ No newline at end of file diff --git a/packages/v1-ready/openphone/definition.js b/packages/v1-ready/openphone/definition.js new file mode 100644 index 0000000..15c58b0 --- /dev/null +++ b/packages/v1-ready/openphone/definition.js @@ -0,0 +1,50 @@ +require('dotenv').config(); +const { Api } = require('./api'); +const { get } = require('@friggframework/core'); +const config = require('./defaultConfig.json'); + +const Definition = { + API: Api, + getName: function () { + return config.name; + }, + moduleName: config.name, + modelName: 'OpenPhone', + requiredAuthMethods: { + getAuthorizationRequirements: async function (params) { + return { + type: 'api_key', + url: 'https://app.openphone.com/settings/integrations/api', + description: 'Generate an API key from your OpenPhone account settings.' + }; + }, + getCredentialDetails: async function (api, userId) { + const currentUser = await api.getCurrentUser(); + return { + identifiers: { externalId: currentUser.id, user: userId }, + details: {} + }; + }, + getEntityDetails: async function (api, callbackParams, tokenResponse, userId) { + const currentUser = await api.getCurrentUser(); + return { + identifiers: { externalId: currentUser.id, user: userId }, + details: { + name: `${currentUser.firstName} ${currentUser.lastName}`.trim() || currentUser.email + } + }; + }, + testAuthRequest: async function (api) { + return api.getCurrentUser(); + }, + apiPropertiesToPersist: { + credential: ['api_key'], + entity: [] + } + }, + env: { + api_key: process.env.OPENPHONE_API_KEY + } +}; + +module.exports = { Definition }; \ No newline at end of file diff --git a/packages/v1-ready/openphone/index.js b/packages/v1-ready/openphone/index.js new file mode 100644 index 0000000..2854829 --- /dev/null +++ b/packages/v1-ready/openphone/index.js @@ -0,0 +1,9 @@ +const { Api } = require('./api'); +const { Definition } = require('./definition'); +const Config = require('./defaultConfig'); + +module.exports = { + Api, + Config, + Definition +}; \ No newline at end of file diff --git a/packages/v1-ready/openphone/jest-setup.js b/packages/v1-ready/openphone/jest-setup.js new file mode 100644 index 0000000..9d3161d --- /dev/null +++ b/packages/v1-ready/openphone/jest-setup.js @@ -0,0 +1,3 @@ +const {globalSetup} = require('@friggframework/test'); +require('dotenv').config(); +module.exports = globalSetup; diff --git a/packages/v1-ready/openphone/jest-teardown.js b/packages/v1-ready/openphone/jest-teardown.js new file mode 100644 index 0000000..5bc7251 --- /dev/null +++ b/packages/v1-ready/openphone/jest-teardown.js @@ -0,0 +1,2 @@ +const {globalTeardown} = require('@friggframework/test'); +module.exports = globalTeardown; diff --git a/packages/v1-ready/openphone/jest.config.js b/packages/v1-ready/openphone/jest.config.js new file mode 100644 index 0000000..48f9fcc --- /dev/null +++ b/packages/v1-ready/openphone/jest.config.js @@ -0,0 +1,20 @@ +/* + * For a detailed explanation regarding each configuration property, visit: + * https://jestjs.io/docs/configuration + */ +module.exports = { + // preset: '@friggframework/test-environment', + coverageThreshold: { + global: { + statements: 13, + branches: 0, + functions: 1, + lines: 13, + }, + }, + // A path to a module which exports an async function that is triggered once before all test suites + globalSetup: './jest-setup.js', + + // A path to a module which exports an async function that is triggered once after all test suites + globalTeardown: './jest-teardown.js', +}; diff --git a/packages/v1-ready/openphone/package.json b/packages/v1-ready/openphone/package.json new file mode 100644 index 0000000..48aa229 --- /dev/null +++ b/packages/v1-ready/openphone/package.json @@ -0,0 +1,27 @@ +{ + "name": "@friggframework/api-module-openphone", + "version": "1.0.0", + "description": "OpenPhone API module for Frigg Framework", + "main": "index.js", + "scripts": { + "test": "jest --passWithNoTests" + }, + "keywords": [ + "frigg", + "api", + "openphone", + "voip", + "phone", + "communication" + ], + "author": "Frigg Framework Team", + "license": "MIT", + "dependencies": { + "@friggframework/core": "^2.0.0-next.24", + "@friggframework/devtools": "^2.0.0-next.24", + "dotenv": "^16.0.0" + }, + "devDependencies": { + "jest": "^29.0.0" + } +} diff --git a/packages/v1-ready/openphone/specs/openAPI.json b/packages/v1-ready/openphone/specs/openAPI.json new file mode 100644 index 0000000..6044562 --- /dev/null +++ b/packages/v1-ready/openphone/specs/openAPI.json @@ -0,0 +1,15866 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "OpenPhone Public API", + "version": "1.0.0", + "description": "API for connecting with OpenPhone.", + "contact": { + "name": "OpenPhone Support", + "email": "support@openphone.com", + "url": "https://support.openphone.com/hc/en-us" + }, + "termsOfService": "https://www.openphone.com/terms" + }, + "paths": { + "/v1/calls": { + "get": { + "tags": [ + "Calls" + ], + "summary": "List calls", + "description": "Fetch a paginated list of calls associated with a specific OpenPhone number and another number.", + "operationId": "listCalls_v1", + "parameters": [ + { + "in": "query", + "name": "phoneNumberId", + "required": true, + "schema": { + "description": "The unique identifier of the OpenPhone number associated with the call.", + "examples": [ + "PN123abc" + ], + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "in": "query", + "name": "userId", + "required": false, + "schema": { + "description": "The unique identifier of the OpenPhone user who either placed or received the call. Defaults to the workspace owner.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + { + "in": "query", + "name": "participants", + "required": true, + "schema": { + "maxItems": 1, + "description": "The phone numbers of participants involved in the call conversation, excluding your OpenPhone number. Each number should contain the country code and conform to the E.164 format. Currently limited to one-to-one (1:1) conversations only.", + "examples": [ + "+15555555555" + ], + "type": "array", + "items": { + "minLength": 1, + "type": "string" + } + } + }, + { + "in": "query", + "name": "since", + "required": false, + "schema": { + "deprecated": true, + "description": "DEPRECATED, use \"createdAfter\" or \"createdBefore\" instead. \"since\" incorrectly behaves as \"createdBefore\" and will be removed in an upcoming release.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "createdAfter", + "required": false, + "schema": { + "description": "Filter results to only include calls created after the specified date and time, in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "createdBefore", + "required": false, + "schema": { + "description": "Filter results to only include calls created before the specified date and time, in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "maxResults", + "required": true, + "schema": { + "description": "Maximum number of results to return per page.", + "default": 10, + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + { + "in": "query", + "name": "pageToken", + "required": false, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "additionalProperties": false, + "type": "object", + "properties": { + "answeredAt": { + "anyOf": [ + { + "description": "The timestamp when the call was answered in ISO 8601 format. Null if the call was not answered.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "answeredBy": { + "anyOf": [ + { + "description": "The unique identifier of the OpenPhone user who answered the incoming call. Null for outgoing calls or unanswered incoming calls.", + "examples": [ + "USlHhXmRMz" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "initiatedBy": { + "anyOf": [ + { + "description": "The unique identifier of the OpenPhone user who initiated the outgoing call. Null for incoming calls.", + "examples": [ + "USlHhXmRMz" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "direction": { + "type": "string", + "enum": [ + "incoming", + "outgoing" + ], + "description": "The direction of the call relative to the OpenPhone number.", + "examples": [ + "incoming" + ] + }, + "status": { + "type": "string", + "enum": [ + "queued", + "initiated", + "ringing", + "in-progress", + "completed", + "busy", + "failed", + "no-answer", + "canceled", + "missed", + "answered", + "forwarded", + "abandoned" + ], + "description": "The current status of the call.", + "examples": [ + "completed" + ] + }, + "completedAt": { + "anyOf": [ + { + "description": "The timestamp when the call ended, in ISO 8601 format. Null if the call is ongoing or was not completed.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "description": "The timestamp when the call record was created, in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "duration": { + "description": "The total duration of the call in seconds.", + "examples": [ + 60 + ], + "type": "integer" + }, + "forwardedFrom": { + "anyOf": [ + { + "anyOf": [ + { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + { + "pattern": "^US(.*)$", + "type": "string" + } + ] + }, + { + "type": "null" + } + ] + }, + "forwardedTo": { + "anyOf": [ + { + "anyOf": [ + { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + { + "pattern": "^US(.*)$", + "type": "string" + } + ] + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier of the call.", + "examples": [ + "AC123abc" + ], + "pattern": "^AC(.*)$", + "type": "string" + }, + "phoneNumberId": { + "description": "The unique identifier of the OpenPhone number associated with the call.", + "examples": [ + "PN123abc" + ], + "pattern": "^PN(.*)$", + "type": "string" + }, + "participants": { + "maxItems": 2, + "type": "array", + "items": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + }, + "updatedAt": { + "anyOf": [ + { + "description": "The timestamp when the call record was last updated, in ISO 8601 format. Null if never updated.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "userId": { + "description": "The unique identifier of the OpenPhone user account associated with the call.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "answeredAt", + "answeredBy", + "initiatedBy", + "direction", + "status", + "completedAt", + "createdAt", + "duration", + "forwardedFrom", + "forwardedTo", + "id", + "phoneNumberId", + "participants", + "updatedAt", + "userId" + ] + } + }, + "totalItems": { + "description": "Total number of items available. ⚠️ Note: `totalItems` is not accurately returning the total number of items that can be paginated. We are working on fixing this issue.", + "type": "integer" + }, + "nextPageToken": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "data", + "totalItems", + "nextPageToken" + ] + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0100400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Bad Request", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0100401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0101403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0100404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0101500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/call-recordings/{callId}": { + "get": { + "tags": [ + "Calls" + ], + "summary": "Get recordings for a call", + "description": "Retrieve a list of recordings associated with a specific call. The results are sorted chronologically, with the oldest recording segment appearing first in the list.", + "operationId": "getCallRecordings_v1", + "parameters": [ + { + "in": "path", + "name": "callId", + "required": true, + "schema": { + "description": "The unique identifier of the call for which recordings are being retrieved.", + "examples": [ + "AC3700e624eca547eb9f749a06f" + ], + "pattern": "^AC(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "additionalProperties": false, + "type": "object", + "properties": { + "duration": { + "anyOf": [ + { + "description": "The length of the call recording in seconds. Null if the recording is not completed or the duration is unknown.", + "examples": [ + 60 + ], + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier of the call recording.", + "examples": [ + "CRwRVK2qBq" + ], + "type": "string" + }, + "startTime": { + "anyOf": [ + { + "description": "The timestamp when the recording began, in ISO 8601 format. Null if the recording hasn't started or the start time is unknown.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "anyOf": [ + { + "type": "string", + "enum": [ + "absent", + "completed", + "deleted", + "failed", + "in-progress", + "paused", + "processing", + "stopped", + "stopping" + ], + "description": "The current status of the call recording.", + "examples": [ + "completed" + ] + }, + { + "type": "null" + } + ] + }, + "type": { + "anyOf": [ + { + "description": "The file type of the call recording. Null if the type is not specified or is unknown.", + "examples": [ + "audio/mpeg" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "url": { + "anyOf": [ + { + "description": "The URL where the call recording can be accessed or downloaded. Null if the URL is not available or the recording is not accessible.", + "examples": [ + "https://examplestorage.com/a643d4d3e1484fcc8b721627284eda5e.mp3" + ], + "format": "uri-reference", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "duration", + "id", + "startTime", + "status", + "type", + "url" + ] + } + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0900400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Bad Request", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0900401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0900403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0900404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0901500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/call-summaries/{callId}": { + "get": { + "tags": [ + "Calls" + ], + "summary": "Get a summary for a call", + "description": "Retrieve an AI-generated summary of a specific call identified by its unique call ID. Call summaries are only available on OpenPhone Business plan.", + "operationId": "getCallSummary_v1", + "parameters": [ + { + "in": "path", + "name": "callId", + "required": true, + "schema": { + "description": "The unique identifier of the call associated with the summary.", + "examples": [ + "AC3700e624eca547eb9f749a06f" + ], + "pattern": "^AC(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "callId": { + "description": "The unique identifier of the call to which this summary belongs.", + "examples": [ + "ACea724hac8c30465bcbcff0b76e4c1c7b" + ], + "type": "string" + }, + "nextSteps": { + "anyOf": [ + { + "type": "array", + "items": { + "examples": [ + "Bring an umbrella." + ], + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "absent", + "in-progress", + "completed", + "failed" + ], + "description": "The status of the call summary.", + "examples": [ + "completed" + ] + }, + "summary": { + "anyOf": [ + { + "type": "array", + "items": { + "examples": [ + "You talked about the weather." + ], + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "jobs": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "icon": { + "type": "string" + }, + "name": { + "type": "string" + }, + "result": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "name", + "value" + ] + } + } + }, + "required": [ + "data" + ] + } + }, + "required": [ + "icon", + "name", + "result" + ] + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "callId", + "nextSteps", + "status", + "summary" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0500400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Bad Request", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0500401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0500403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0500404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0501500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/call-transcripts/{id}": { + "get": { + "tags": [ + "Calls" + ], + "summary": "Get a transcription for a call", + "description": "Retrieve a detailed transcript of a specific call identified by its unique call ID. Call transcripts are only available on OpenPhone business plan.", + "operationId": "getCallTranscript_v1", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "Unique identifier of the call associated with this transcript.", + "examples": [ + "AC3700e624eca547eb9f749a06f2eb1" + ], + "pattern": "^AC(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "callId": { + "description": "The unique identifier of the call to which this transcript belongs.", + "examples": [ + "ACea724hac8c30465bcbcff0b76e4c1c7b" + ], + "type": "string" + }, + "createdAt": { + "description": "The timestamp when the transcription was created, in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "dialogue": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "content": { + "description": "The transcribed text of a specific dialogue segment.", + "examples": [ + "Hello, world!" + ], + "type": "string" + }, + "start": { + "description": "The start time of the dialogue segment in seconds, relative to the beginning of the call.", + "examples": [ + 5.123456 + ], + "type": "number" + }, + "end": { + "description": "The end time of the dialogue segment in seconds, relative to the beginning of the call.", + "examples": [ + 10.123456 + ], + "type": "number" + }, + "identifier": { + "description": "The phone number of the participant who spoke during this dialogue segment.", + "examples": [ + "+19876543210" + ], + "type": "string" + }, + "userId": { + "anyOf": [ + { + "description": "The unique identifier of the OpenPhone user who spoke during this dialogue segment. Null for external participants or if user identification is not available.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "content", + "start", + "end", + "identifier", + "userId" + ] + } + }, + { + "type": "null" + } + ] + }, + "duration": { + "description": "The total duration of the transcribed call in seconds.", + "examples": [ + 100 + ], + "type": "number" + }, + "status": { + "type": "string", + "enum": [ + "absent", + "in-progress", + "completed", + "failed" + ], + "description": "The status of the call transcription.", + "examples": [ + "completed" + ] + } + }, + "required": [ + "callId", + "createdAt", + "dialogue", + "duration", + "status" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0600400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Bad Request", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0600401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0600403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0600404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0601500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/contact-custom-fields": { + "get": { + "tags": [ + "Contact Custom Fields" + ], + "summary": "Get contact custom fields", + "description": "Custom contact fields enhance your OpenPhone contacts with additional information beyond standard details like name, company, role, emails and phone numbers. These user-defined fields let you capture business-specific data. While you can only create or modify these fields in OpenPhone itself, this endpoint retrieves your existing custom properties. Use this information to accurately map and include important custom data when creating new contacts via the API.", + "operationId": "getContactCustomFields_v1", + "parameters": [], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the custom contact field. This name is set by users in the OpenPhone interface when the custom field is created.", + "examples": [ + "Inbound Lead" + ], + "type": "string" + }, + "key": { + "description": "The identifying key for contact custom field.", + "examples": [ + "inbound-lead" + ], + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "address", + "boolean", + "date", + "multi-select", + "number", + "string", + "url" + ], + "description": "The data type of the custom contact field, determining what kind of information can be stored and how it should be formatted.", + "examples": [ + "boolean" + ] + } + }, + "required": [ + "name", + "key", + "type" + ] + } + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0700400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Bad Request", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0700401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0700403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0700404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0701500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/contacts": { + "post": { + "tags": [ + "Contacts" + ], + "summary": "Create a contact", + "description": "Create a contact for a workspace.", + "operationId": "createContact_v1", + "parameters": [], + "security": [ + { + "apiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "defaultFields": { + "type": "object", + "properties": { + "company": { + "anyOf": [ + { + "description": "The contact's company name.", + "examples": [ + "OpenPhone" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name for the contact's email address.", + "examples": [ + "company email" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's email address.", + "examples": [ + "abc@example.com" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name", + "value" + ] + } + }, + "firstName": { + "anyOf": [ + { + "description": "The contact's first name.", + "examples": [ + "John" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastName": { + "anyOf": [ + { + "description": "The contact's last name.", + "examples": [ + "Doe" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "phoneNumbers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the contact's phone number.", + "examples": [ + "company phone" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's phone number.", + "examples": [ + "+12345678901" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name", + "value" + ] + } + }, + "role": { + "anyOf": [ + { + "description": "The contact's role.", + "examples": [ + "Sales" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "firstName" + ] + }, + "customFields": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "key": { + "description": "The identifying key for contact custom field.", + "examples": [ + "inbound-lead" + ], + "type": "string" + } + } + }, + { + "anyOf": [ + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + } + ] + } + ] + } + }, + "createdByUserId": { + "description": "The unique identifier of the user who created the contact.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "source": { + "description": "The contact's source. Defaults to `null` for contacts created in the UI. Defaults to `public-api` for contacts created via the public API. Cannot be one of the following reserved words: `openphone`, `device`, `csv`, `zapier`, `google-people`, `other` or start with one of the following reserved prefixes: `openphone`, `csv`.", + "examples": [ + "public-api", + "custom-hubspot", + "google-calendar" + ], + "default": "public-api", + "minLength": 1, + "maxLength": 72, + "type": "string" + }, + "sourceUrl": { + "description": "A link to the contact in the source system.", + "format": "uri", + "examples": [ + "https://openphone.co/contacts/664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 200, + "type": "string" + }, + "externalId": { + "anyOf": [ + { + "description": "A unique identifier from an external system that can optionally be supplied when creating a contact. This ID is used to associate the contact with records in other systems and is required for retrieving the contact later via the \"List Contacts\" endpoint. Ensure the `externalId` is unique and consistent across systems for accurate cross-referencing.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "defaultFields" + ] + } + } + } + }, + "responses": { + "201": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the contact.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "type": "string" + }, + "externalId": { + "anyOf": [ + { + "description": "A unique identifier from an external system that can optionally be supplied when creating a contact. This ID is used to associate the contact with records in other systems and is required for retrieving the contact later via the \"List Contacts\" endpoint. Ensure the `externalId` is unique and consistent across systems for accurate cross-referencing.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "source": { + "anyOf": [ + { + "description": "Indicates how the contact was created or where it originated from.", + "examples": [ + "public-api" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sourceUrl": { + "anyOf": [ + { + "description": "A link to the contact in the source system.", + "format": "uri", + "examples": [ + "https://openphone.co/contacts/664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 200, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "defaultFields": { + "type": "object", + "properties": { + "company": { + "anyOf": [ + { + "description": "The contact's company name.", + "examples": [ + "OpenPhone" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name for the contact's email address.", + "examples": [ + "company email" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's email address.", + "examples": [ + "abc@example.com" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier for the contact email field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "firstName": { + "anyOf": [ + { + "description": "The contact's first name.", + "examples": [ + "John" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastName": { + "anyOf": [ + { + "description": "The contact's last name.", + "examples": [ + "Doe" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "phoneNumbers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the contact's phone number.", + "examples": [ + "company phone" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's phone number.", + "examples": [ + "+12345678901" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier of the contact phone number field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "role": { + "anyOf": [ + { + "description": "The contact's role.", + "examples": [ + "Sales" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "company", + "emails", + "firstName", + "lastName", + "phoneNumbers", + "role" + ] + }, + "customFields": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "name": { + "description": "The name of the custom contact field. This name is set by users in the OpenPhone interface when the custom field is created.", + "examples": [ + "Inbound Lead" + ], + "type": "string" + }, + "key": { + "description": "The identifying key for contact custom field.", + "examples": [ + "inbound-lead" + ], + "type": "string" + }, + "id": { + "description": "The unique identifier for the contact custom field.", + "examples": [ + "66d0d87d534de8fd1c433cec3" + ], + "type": "string" + } + }, + "required": [ + "name" + ] + }, + { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "multi-select" + ] + }, + "value": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "address", + "string", + "url" + ] + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "boolean" + ] + }, + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "date" + ] + }, + "value": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "number" + ] + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + } + ] + } + ] + } + }, + "createdAt": { + "description": "Timestamp of contact creation in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "Timestamp of last contact update in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "createdByUserId": { + "description": "The unique identifier of the user who created the contact.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "id", + "externalId", + "source", + "sourceUrl", + "defaultFields", + "customFields", + "createdAt", + "updatedAt", + "createdByUserId" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Custom Field Item", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Custom Field Item", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Custom Field Item", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800409", + "type": "string" + }, + "status": { + "const": 409, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Conflict", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + }, + "get": { + "tags": [ + "Contacts" + ], + "summary": "List contacts", + "description": "Retrieve a paginated list of contacts associated with specific external IDs. You can optionally filter the results further by providing a list of sources. **Note**: The `externalIds` parameter is currently required to specify the contacts you want to retrieve.", + "operationId": "listContacts_v1", + "parameters": [ + { + "in": "query", + "name": "externalIds", + "required": true, + "schema": { + "description": "A list of unique identifiers from an external system used to retrieve specific contacts. This parameter is required and ensures the result set is limited to the contacts associated with the provided `externalIds`. These IDs must match the ones supplied during contact creation via the \"Create Contacts\" endpoint. Use this parameter to cross-reference and fetch contacts linked to external systems.", + "type": "array", + "items": { + "description": "A unique identifier from an external system that can optionally be supplied when creating a contact. This ID is used to associate the contact with records in other systems and is required for retrieving the contact later via the \"List Contacts\" endpoint. Ensure the `externalId` is unique and consistent across systems for accurate cross-referencing.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + } + } + }, + { + "in": "query", + "name": "sources", + "required": false, + "schema": { + "type": "array", + "items": { + "description": "Indicates how the contact was created or where it originated from.", + "examples": [ + "public-api" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + } + } + }, + { + "in": "query", + "name": "maxResults", + "required": true, + "schema": { + "description": "Maximum number of results to return per page.", + "default": 10, + "maximum": 50, + "minimum": 1, + "type": "integer" + } + }, + { + "in": "query", + "name": "pageToken", + "required": false, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the contact.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "type": "string" + }, + "externalId": { + "anyOf": [ + { + "description": "A unique identifier from an external system that can optionally be supplied when creating a contact. This ID is used to associate the contact with records in other systems and is required for retrieving the contact later via the \"List Contacts\" endpoint. Ensure the `externalId` is unique and consistent across systems for accurate cross-referencing.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "source": { + "anyOf": [ + { + "description": "Indicates how the contact was created or where it originated from.", + "examples": [ + "public-api" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sourceUrl": { + "anyOf": [ + { + "description": "A link to the contact in the source system.", + "format": "uri", + "examples": [ + "https://openphone.co/contacts/664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 200, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "defaultFields": { + "type": "object", + "properties": { + "company": { + "anyOf": [ + { + "description": "The contact's company name.", + "examples": [ + "OpenPhone" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name for the contact's email address.", + "examples": [ + "company email" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's email address.", + "examples": [ + "abc@example.com" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier for the contact email field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "firstName": { + "anyOf": [ + { + "description": "The contact's first name.", + "examples": [ + "John" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastName": { + "anyOf": [ + { + "description": "The contact's last name.", + "examples": [ + "Doe" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "phoneNumbers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the contact's phone number.", + "examples": [ + "company phone" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's phone number.", + "examples": [ + "+12345678901" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier of the contact phone number field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "role": { + "anyOf": [ + { + "description": "The contact's role.", + "examples": [ + "Sales" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "company", + "emails", + "firstName", + "lastName", + "phoneNumbers", + "role" + ] + }, + "customFields": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "name": { + "description": "The name of the custom contact field. This name is set by users in the OpenPhone interface when the custom field is created.", + "examples": [ + "Inbound Lead" + ], + "type": "string" + }, + "key": { + "description": "The identifying key for contact custom field.", + "examples": [ + "inbound-lead" + ], + "type": "string" + }, + "id": { + "description": "The unique identifier for the contact custom field.", + "examples": [ + "66d0d87d534de8fd1c433cec3" + ], + "type": "string" + } + }, + "required": [ + "name" + ] + }, + { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "multi-select" + ] + }, + "value": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "address", + "string", + "url" + ] + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "boolean" + ] + }, + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "date" + ] + }, + "value": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "number" + ] + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + } + ] + } + ] + } + }, + "createdAt": { + "description": "Timestamp of contact creation in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "Timestamp of last contact update in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "createdByUserId": { + "description": "The unique identifier of the user who created the contact.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "id", + "externalId", + "source", + "sourceUrl", + "defaultFields", + "customFields", + "createdAt", + "updatedAt", + "createdByUserId" + ] + } + }, + "totalItems": { + "description": "Total number of items available. ⚠️ Note: `totalItems` is not accurately returning the total number of items that can be paginated. We are working on fixing this issue.", + "type": "integer" + }, + "nextPageToken": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "data", + "totalItems", + "nextPageToken" + ] + } + } + } + }, + "400": { + "description": "Invalid Custom Field Item", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Custom Field Item", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Custom Field Item", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800409", + "type": "string" + }, + "status": { + "const": 409, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Conflict", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/contacts/{id}": { + "get": { + "tags": [ + "Contacts" + ], + "summary": "Get a contact by ID", + "description": "Retrieve detailed information about a specific contact in your OpenPhone workspace using the contact's unique identifier.", + "operationId": "getContactById_v1", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the contact.", + "examples": [ + "66d0d87e8dc1211467372303" + ], + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the contact.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "type": "string" + }, + "externalId": { + "anyOf": [ + { + "description": "A unique identifier from an external system that can optionally be supplied when creating a contact. This ID is used to associate the contact with records in other systems and is required for retrieving the contact later via the \"List Contacts\" endpoint. Ensure the `externalId` is unique and consistent across systems for accurate cross-referencing.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "source": { + "anyOf": [ + { + "description": "Indicates how the contact was created or where it originated from.", + "examples": [ + "public-api" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sourceUrl": { + "anyOf": [ + { + "description": "A link to the contact in the source system.", + "format": "uri", + "examples": [ + "https://openphone.co/contacts/664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 200, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "defaultFields": { + "type": "object", + "properties": { + "company": { + "anyOf": [ + { + "description": "The contact's company name.", + "examples": [ + "OpenPhone" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name for the contact's email address.", + "examples": [ + "company email" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's email address.", + "examples": [ + "abc@example.com" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier for the contact email field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "firstName": { + "anyOf": [ + { + "description": "The contact's first name.", + "examples": [ + "John" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastName": { + "anyOf": [ + { + "description": "The contact's last name.", + "examples": [ + "Doe" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "phoneNumbers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the contact's phone number.", + "examples": [ + "company phone" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's phone number.", + "examples": [ + "+12345678901" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier of the contact phone number field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "role": { + "anyOf": [ + { + "description": "The contact's role.", + "examples": [ + "Sales" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "company", + "emails", + "firstName", + "lastName", + "phoneNumbers", + "role" + ] + }, + "customFields": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "name": { + "description": "The name of the custom contact field. This name is set by users in the OpenPhone interface when the custom field is created.", + "examples": [ + "Inbound Lead" + ], + "type": "string" + }, + "key": { + "description": "The identifying key for contact custom field.", + "examples": [ + "inbound-lead" + ], + "type": "string" + }, + "id": { + "description": "The unique identifier for the contact custom field.", + "examples": [ + "66d0d87d534de8fd1c433cec3" + ], + "type": "string" + } + }, + "required": [ + "name" + ] + }, + { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "multi-select" + ] + }, + "value": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "address", + "string", + "url" + ] + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "boolean" + ] + }, + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "date" + ] + }, + "value": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "number" + ] + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + } + ] + } + ] + } + }, + "createdAt": { + "description": "Timestamp of contact creation in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "Timestamp of last contact update in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "createdByUserId": { + "description": "The unique identifier of the user who created the contact.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "id", + "externalId", + "source", + "sourceUrl", + "defaultFields", + "customFields", + "createdAt", + "updatedAt", + "createdByUserId" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Custom Field Item", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Custom Field Item", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Custom Field Item", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800409", + "type": "string" + }, + "status": { + "const": 409, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Conflict", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + }, + "patch": { + "tags": [ + "Contacts" + ], + "summary": "Update a contact by ID", + "description": "Modify an existing contact in your OpenPhone workspace using the contact's unique identifier.", + "operationId": "updateContactById_v1", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the contact.", + "examples": [ + "66d0d87e8dc1211467372303" + ], + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "externalId": { + "anyOf": [ + { + "description": "A unique identifier from an external system that can optionally be supplied when creating a contact. This ID is used to associate the contact with records in other systems and is required for retrieving the contact later via the \"List Contacts\" endpoint. Ensure the `externalId` is unique and consistent across systems for accurate cross-referencing.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "source": { + "anyOf": [ + { + "description": "Indicates how the contact was created or where it originated from.", + "examples": [ + "public-api" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sourceUrl": { + "anyOf": [ + { + "description": "A link to the contact in the source system.", + "format": "uri", + "examples": [ + "https://openphone.co/contacts/664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 200, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "defaultFields": { + "type": "object", + "properties": { + "company": { + "anyOf": [ + { + "description": "The contact's company name.", + "examples": [ + "OpenPhone" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name for the contact's email address.", + "examples": [ + "company email" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's email address. If set to null during a patch operation, it will remove the email item from the contact.", + "examples": [ + "info@openphone.com" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier for the contact email field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "firstName": { + "anyOf": [ + { + "description": "The contact's first name.", + "examples": [ + "John" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastName": { + "anyOf": [ + { + "description": "The contact's last name.", + "examples": [ + "Doe" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "phoneNumbers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the contact's phone number.", + "examples": [ + "company phone" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's phone number. If set to null during a patch operation, it will remove the phone number item from the contact.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier of the contact phone number field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "role": { + "anyOf": [ + { + "description": "The contact's role.", + "examples": [ + "Sales" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, + "customFields": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "key": { + "description": "The identifying key for contact custom field.", + "examples": [ + "inbound-lead" + ], + "type": "string" + }, + "id": { + "description": "The unique identifier for the contact custom field.", + "examples": [ + "66d0d87d534de8fd1c433cec3" + ], + "type": "string" + } + } + }, + { + "anyOf": [ + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + } + ] + } + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the contact.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "type": "string" + }, + "externalId": { + "anyOf": [ + { + "description": "A unique identifier from an external system that can optionally be supplied when creating a contact. This ID is used to associate the contact with records in other systems and is required for retrieving the contact later via the \"List Contacts\" endpoint. Ensure the `externalId` is unique and consistent across systems for accurate cross-referencing.", + "examples": [ + "664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "source": { + "anyOf": [ + { + "description": "Indicates how the contact was created or where it originated from.", + "examples": [ + "public-api" + ], + "minLength": 1, + "maxLength": 75, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sourceUrl": { + "anyOf": [ + { + "description": "A link to the contact in the source system.", + "format": "uri", + "examples": [ + "https://openphone.co/contacts/664d0db69fcac7cf2e6ec" + ], + "minLength": 1, + "maxLength": 200, + "type": "string" + }, + { + "type": "null" + } + ] + }, + "defaultFields": { + "type": "object", + "properties": { + "company": { + "anyOf": [ + { + "description": "The contact's company name.", + "examples": [ + "OpenPhone" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "emails": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name for the contact's email address.", + "examples": [ + "company email" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's email address.", + "examples": [ + "abc@example.com" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier for the contact email field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "firstName": { + "anyOf": [ + { + "description": "The contact's first name.", + "examples": [ + "John" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastName": { + "anyOf": [ + { + "description": "The contact's last name.", + "examples": [ + "Doe" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "phoneNumbers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the contact's phone number.", + "examples": [ + "company phone" + ], + "type": "string" + }, + "value": { + "anyOf": [ + { + "description": "The contact's phone number.", + "examples": [ + "+12345678901" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "description": "The unique identifier of the contact phone number field.", + "examples": [ + "acb123" + ], + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + } + }, + "role": { + "anyOf": [ + { + "description": "The contact's role.", + "examples": [ + "Sales" + ], + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "company", + "emails", + "firstName", + "lastName", + "phoneNumbers", + "role" + ] + }, + "customFields": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "name": { + "description": "The name of the custom contact field. This name is set by users in the OpenPhone interface when the custom field is created.", + "examples": [ + "Inbound Lead" + ], + "type": "string" + }, + "key": { + "description": "The identifying key for contact custom field.", + "examples": [ + "inbound-lead" + ], + "type": "string" + } + }, + "required": [ + "name" + ] + }, + { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "multi-select" + ] + }, + "value": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "address", + "string", + "url" + ] + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "boolean" + ] + }, + "value": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "date" + ] + }, + "value": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "number" + ] + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "value" + ] + } + ] + } + ] + } + }, + "createdAt": { + "description": "Timestamp of contact creation in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "Timestamp of last contact update in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "createdByUserId": { + "description": "The unique identifier of the user who created the contact.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "id", + "externalId", + "source", + "sourceUrl", + "defaultFields", + "customFields", + "createdAt", + "updatedAt", + "createdByUserId" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Custom Field Item", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Custom Field Item", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Custom Field Item", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800409", + "type": "string" + }, + "status": { + "const": 409, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Conflict", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + }, + "delete": { + "tags": [ + "Contacts" + ], + "summary": "Delete a contact", + "description": "Delete a contact by its unique identifier.", + "operationId": "deleteContact_v1", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of the contact.", + "examples": [ + "66d0d87e8dc1211467372303" + ], + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "description": "Invalid Custom Field Item", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Custom Field Item", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Custom Field Item", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0800409", + "type": "string" + }, + "status": { + "const": 409, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Conflict", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0801500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/conversations": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "List Conversations", + "description": "Fetch a paginated list of conversations of OpenPhone conversations. Can be filtered by user and/or phone numbers. Defaults to all conversations in the OpenPhone organization. Results are returned in descending order based on the most recent conversation.", + "operationId": "listConversations_v1", + "parameters": [ + { + "in": "query", + "name": "phoneNumber", + "required": false, + "schema": { + "description": "DEPRECATED, use `phoneNumbers` instead. If both `phoneNumber` and `phoneNumbers` are provided, `phoneNumbers` will be used. Filters results to only include conversations with the specified OpenPhone phone number. Can be either your OpenPhone phone number ID or the full phone number in E.164 format.", + "examples": [ + "+15555555555", + "PN123abc" + ], + "deprecated": true, + "anyOf": [ + { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + { + "pattern": "^PN(.*)$", + "type": "string" + } + ] + } + }, + { + "in": "query", + "name": "phoneNumbers", + "required": false, + "schema": { + "description": "Filters results to only include conversations with the specified OpenPhone phone numbers. Each item can be either an OpenPhone phone number ID or a full phone number in E.164 format.", + "examples": [ + [ + "+15555555555", + "PN123abc" + ] + ], + "minItems": 1, + "maxItems": 100, + "type": "array", + "items": { + "anyOf": [ + { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + { + "pattern": "^PN(.*)$", + "type": "string" + } + ] + } + } + }, + { + "in": "query", + "name": "userId", + "required": false, + "schema": { + "description": "The unique identifier of the user the making the request. Used to filter results to only include the user's conversations.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + { + "in": "query", + "name": "createdAfter", + "required": false, + "schema": { + "description": "Filter results to only include conversations created after the specified date and time, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "createdBefore", + "required": false, + "schema": { + "description": "Filter results to only include conversations created before the specified date and time, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "excludeInactive", + "required": false, + "schema": { + "description": "Exclude inactive conversations from the results.", + "examples": [ + true + ], + "type": "boolean" + } + }, + { + "in": "query", + "name": "updatedAfter", + "required": false, + "schema": { + "description": "Filter results to only include conversations updated after the specified date and time, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "updatedBefore", + "required": false, + "schema": { + "description": "Filter results to only include conversations updated before the specified date and time, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "maxResults", + "required": true, + "schema": { + "description": "Maximum number of results to return per page.", + "default": 10, + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + { + "in": "query", + "name": "pageToken", + "required": false, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "assignedTo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "createdAt": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "deletedAt": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "id": { + "pattern": "^CN(.*)$", + "type": "string" + }, + "lastActivityAt": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lastActivityId": { + "anyOf": [ + { + "pattern": "^AC(.*)$", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "mutedUntil": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "participants": { + "type": "array", + "items": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + }, + "phoneNumberId": { + "pattern": "^PN(.*)$", + "type": "string" + }, + "snoozedUntil": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "updatedAt": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "assignedTo", + "createdAt", + "deletedAt", + "id", + "lastActivityAt", + "lastActivityId", + "mutedUntil", + "name", + "participants", + "phoneNumberId", + "snoozedUntil", + "updatedAt" + ] + } + }, + "totalItems": { + "description": "Total number of items available. ⚠️ Note: `totalItems` is not accurately returning the total number of items that can be paginated. We are working on fixing this issue.", + "type": "integer" + }, + "nextPageToken": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "data", + "totalItems", + "nextPageToken" + ] + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "1000400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Bad Request", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "1000401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "1001403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "1000404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "1001500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/messages": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Send a text message", + "description": "Send a text message from your OpenPhone number to a recipient.", + "operationId": "sendMessage_v1", + "parameters": [], + "security": [ + { + "apiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "minLength": 1, + "maxLength": 1600, + "pattern": ".*\\S.*", + "description": "The text content of the message to be sent.", + "type": "string" + }, + "phoneNumberId": { + "description": "DEPRECATED, use \"from\" instead. OpenPhone phone number ID to send a message from", + "examples": [ + "OP1232abc" + ], + "deprecated": true, + "pattern": "^PN(.*)$", + "type": "string" + }, + "from": { + "anyOf": [ + { + "pattern": "^PN(.*)$", + "type": "string" + }, + { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + ] + }, + "to": { + "minItems": 1, + "maxItems": 1, + "type": "array", + "items": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + }, + "userId": { + "description": "The unique identifier of the OpenPhone user sending the message. If not provided, defaults to the phone number owner.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "setInboxStatus": { + "type": "string", + "enum": [ + "done" + ], + "description": "Used to set the status of the related OpenPhone inbox conversation. The default behavior without setting this parameter will be for the message sent to show up as an open conversation in the user's inbox. Setting the parameter to `'done'` would move the conversation to the Done inbox view.", + "examples": [ + "done" + ] + } + }, + "required": [ + "content", + "from", + "to" + ] + } + } + } + }, + "responses": { + "202": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the message.", + "examples": [ + "AC123abc" + ], + "pattern": "^AC(.*)$", + "type": "string" + }, + "to": { + "type": "array", + "items": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + }, + "from": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + "text": { + "description": "The content of the message.", + "examples": [ + "Hello, world!" + ], + "type": "string" + }, + "phoneNumberId": { + "anyOf": [ + { + "description": "The unique identifier of the OpenPhone phone number that the message was sent from.", + "examples": [ + "PN123abc" + ], + "pattern": "^PN(.*)$", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "direction": { + "type": "string", + "enum": [ + "incoming", + "outgoing" + ], + "description": "The direction of the message relative to the OpenPhone number.", + "examples": [ + "incoming" + ] + }, + "userId": { + "description": "The unique identifier of the user who sent the message. Null for incoming messages.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "queued", + "sent", + "delivered", + "undelivered" + ], + "description": "The status of the message.", + "examples": [ + "sent" + ] + }, + "createdAt": { + "description": "The timestamp when the message was created at, in ISO 8601 format", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The timestamp when the message status was last updated, in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + "required": [ + "id", + "to", + "from", + "text", + "phoneNumberId", + "direction", + "userId", + "status", + "createdAt", + "updatedAt" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "A2P Registration Not Approved", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0206400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "A2P Registration Not Approved", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "A2P Registration Not Approved", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "402": { + "description": "Not Enough Credits", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200402", + "type": "string" + }, + "status": { + "const": 402, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Enough Credits", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "The organization does not have enough prepaid credits to send the message", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0202403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0201500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + }, + "get": { + "tags": [ + "Messages" + ], + "summary": "List messages", + "description": "Retrieve a chronological list of messages exchanged between your OpenPhone number and specified participants, with support for filtering and pagination. ", + "operationId": "listMessages_v1", + "parameters": [ + { + "in": "query", + "name": "phoneNumberId", + "required": true, + "schema": { + "description": "The unique identifier of the OpenPhone number used to send or receive the messages. PhoneNumberID can be retrieved via the Get Phone Numbers endpoint.", + "examples": [ + "OP123abc" + ], + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "in": "query", + "name": "userId", + "required": false, + "schema": { + "description": "The unique identifier of the user the message was sent from.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + { + "in": "query", + "name": "participants", + "required": true, + "schema": { + "description": "Array of phone numbers involved in the conversation, excluding your OpenPhone number, in E.164 format.", + "examples": [ + "+15555555555" + ], + "type": "array", + "items": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + } + }, + { + "in": "query", + "name": "since", + "required": false, + "schema": { + "deprecated": true, + "description": "DEPRECATED, use \"createdAfter\" or \"createdBefore\" instead. \"since\" currently behaves as \"createdBefore\" and will be removed in an upcoming release.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "createdAfter", + "required": false, + "schema": { + "description": "Filter results to only include messages created after the specified date and time, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "createdBefore", + "required": false, + "schema": { + "description": "Filter results to only include messages created before the specified date and time, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "maxResults", + "required": true, + "schema": { + "description": "Maximum number of results to return per page.", + "default": 10, + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + { + "in": "query", + "name": "pageToken", + "required": false, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the message.", + "examples": [ + "AC123abc" + ], + "pattern": "^AC(.*)$", + "type": "string" + }, + "to": { + "type": "array", + "items": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + }, + "from": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + "text": { + "description": "The content of the message.", + "examples": [ + "Hello, world!" + ], + "type": "string" + }, + "phoneNumberId": { + "anyOf": [ + { + "description": "The unique identifier of the OpenPhone phone number that the message was sent from.", + "examples": [ + "PN123abc" + ], + "pattern": "^PN(.*)$", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "direction": { + "type": "string", + "enum": [ + "incoming", + "outgoing" + ], + "description": "The direction of the message relative to the OpenPhone number.", + "examples": [ + "incoming" + ] + }, + "userId": { + "description": "The unique identifier of the user who sent the message. Null for incoming messages.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "queued", + "sent", + "delivered", + "undelivered" + ], + "description": "The status of the message.", + "examples": [ + "sent" + ] + }, + "createdAt": { + "description": "The timestamp when the message was created at, in ISO 8601 format", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The timestamp when the message status was last updated, in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + "required": [ + "id", + "to", + "from", + "text", + "phoneNumberId", + "direction", + "userId", + "status", + "createdAt", + "updatedAt" + ] + } + }, + "totalItems": { + "description": "Total number of items available. ⚠️ Note: `totalItems` is not accurately returning the total number of items that can be paginated. We are working on fixing this issue.", + "type": "integer" + }, + "nextPageToken": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "data", + "totalItems", + "nextPageToken" + ] + } + } + } + }, + "400": { + "description": "A2P Registration Not Approved", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0206400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "A2P Registration Not Approved", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "A2P Registration Not Approved", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "402": { + "description": "Not Enough Credits", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200402", + "type": "string" + }, + "status": { + "const": 402, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Enough Credits", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "The organization does not have enough prepaid credits to send the message", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0202403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0201500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/messages/{id}": { + "get": { + "tags": [ + "Messages" + ], + "summary": "Get a message by ID", + "description": "Get a message by its unique identifier.", + "operationId": "getMessageById_v1", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of a message", + "examples": [ + "AC123abc" + ], + "pattern": "^AC(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the message.", + "examples": [ + "AC123abc" + ], + "pattern": "^AC(.*)$", + "type": "string" + }, + "to": { + "type": "array", + "items": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + } + }, + "from": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + "text": { + "description": "The content of the message.", + "examples": [ + "Hello, world!" + ], + "type": "string" + }, + "phoneNumberId": { + "anyOf": [ + { + "description": "The unique identifier of the OpenPhone phone number that the message was sent from.", + "examples": [ + "PN123abc" + ], + "pattern": "^PN(.*)$", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "direction": { + "type": "string", + "enum": [ + "incoming", + "outgoing" + ], + "description": "The direction of the message relative to the OpenPhone number.", + "examples": [ + "incoming" + ] + }, + "userId": { + "description": "The unique identifier of the user who sent the message. Null for incoming messages.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "queued", + "sent", + "delivered", + "undelivered" + ], + "description": "The status of the message.", + "examples": [ + "sent" + ] + }, + "createdAt": { + "description": "The timestamp when the message was created at, in ISO 8601 format", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The timestamp when the message status was last updated, in ISO 8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + } + }, + "required": [ + "id", + "to", + "from", + "text", + "phoneNumberId", + "direction", + "userId", + "status", + "createdAt", + "updatedAt" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "A2P Registration Not Approved", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0206400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "A2P Registration Not Approved", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "A2P Registration Not Approved", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "402": { + "description": "Not Enough Credits", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200402", + "type": "string" + }, + "status": { + "const": 402, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Enough Credits", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "The organization does not have enough prepaid credits to send the message", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "403": { + "description": "Not Phone Number User", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0202403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Phone Number User", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Not Phone Number User", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0200404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0201500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/phone-numbers": { + "get": { + "tags": [ + "Phone Numbers" + ], + "summary": "List phone numbers", + "description": "Retrieve the list of phone numbers and users associated with your OpenPhone workspace.", + "operationId": "listPhoneNumbers_v1", + "parameters": [ + { + "in": "query", + "name": "userId", + "required": false, + "schema": { + "description": "Filter results to return only phone numbers associated with the specified user\"s unique identifier.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPhoneNumbersResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0400400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Bad Request", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0400401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0400403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0400404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0401500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/webhooks": { + "get": { + "tags": [ + "Webhooks" + ], + "summary": "Lists all webhooks", + "description": "List all webhooks for a user.", + "operationId": "listWebhooks_v1", + "parameters": [ + { + "in": "query", + "name": "userId", + "required": false, + "schema": { + "description": "The unique identifier the user. Defaults to the workspace owner.", + "examples": "U55wgP5I5", + "pattern": "^US(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "message.received", + "message.delivered" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + }, + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.completed", + "call.ringing", + "call.recording.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + }, + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.summary.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + }, + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.transcript.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + } + ] + } + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0305400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Version", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Version", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0301500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/webhooks/{id}": { + "get": { + "tags": [ + "Webhooks" + ], + "summary": "Get a webhook by ID", + "description": "Get a webhook by its unique identifier.", + "operationId": "getWebhookById_v1", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of a webhook", + "examples": [ + "WH12345" + ], + "pattern": "^WH(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "message.received", + "message.delivered" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + }, + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.completed", + "call.ringing", + "call.recording.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + }, + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.summary.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + }, + { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.transcript.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + } + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0305400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Version", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Version", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0301500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + }, + "delete": { + "tags": [ + "Webhooks" + ], + "summary": "Delete a webhook by ID", + "description": "Delete a webhook by its unique identifier.", + "operationId": "deleteWebhookById_v1", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "description": "The unique identifier of a webhook", + "examples": [ + "WH12345" + ], + "pattern": "^WH(.*)$", + "type": "string" + } + } + ], + "security": [ + { + "apiKey": [] + } + ], + "responses": { + "204": { + "description": "Success" + }, + "400": { + "description": "Invalid Version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0305400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Version", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Version", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0301500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/webhooks/messages": { + "post": { + "tags": [ + "Webhooks" + ], + "summary": "Create a new webhook for messages", + "description": "Creates a new webhook that triggers on events from messages.", + "operationId": "createMessageWebhook_v1", + "parameters": [], + "security": [ + { + "apiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "message.received", + "message.delivered" + ] + } + }, + "label": { + "description": "Webhook's label", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com" + ], + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that creates the webhook. If not provided, default to workspace owner.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "events", + "url" + ] + } + } + } + }, + "responses": { + "201": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "message.received", + "message.delivered" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0305400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Version", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Version", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0301500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/webhooks/calls": { + "post": { + "tags": [ + "Webhooks" + ], + "summary": "Create a new webhook for calls", + "description": "Creates a new webhook that triggers on events from calls.", + "operationId": "createCallWebhook_v1", + "parameters": [], + "security": [ + { + "apiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.completed", + "call.ringing", + "call.recording.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + }, + "userId": { + "description": "The unique identifier of the user that creates the webhook. If not provided, default to workspace owner.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "label": { + "description": "Webhook's label", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + } + }, + "required": [ + "url", + "events" + ] + } + } + } + }, + "responses": { + "201": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.completed", + "call.ringing", + "call.recording.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0305400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Version", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Version", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0301500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/webhooks/call-summaries": { + "post": { + "tags": [ + "Webhooks" + ], + "summary": "Create a new webhook for call summaries", + "description": "Creates a new webhook that triggers on events from call summaries.", + "operationId": "createCallSummaryWebhook_v1", + "parameters": [], + "security": [ + { + "apiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.summary.completed" + ] + } + }, + "label": { + "description": "Webhook's label", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com" + ], + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that creates the webhook. If not provided, default to workspace owner.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "events", + "url" + ] + } + } + } + }, + "responses": { + "201": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.summary.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0305400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Version", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Version", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0301500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + }, + "/v1/webhooks/call-transcripts": { + "post": { + "tags": [ + "Webhooks" + ], + "summary": "Create a new webhook for call transcripts", + "description": "Creates a new webhook that triggers on events from call transcripts.", + "operationId": "createCallTranscriptWebhook_v1", + "parameters": [], + "security": [ + { + "apiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.transcript.completed" + ] + } + }, + "label": { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com" + ], + "type": "string" + }, + "userId": { + "description": "The ID of the user that creates the webhook. If not provided, default to workspace owner.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + } + }, + "required": [ + "events", + "url" + ] + } + } + } + }, + "responses": { + "201": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "id": { + "description": "The webhook's ID", + "examples": [ + "WHabcd1234" + ], + "pattern": "^WH(.*)$", + "type": "string" + }, + "userId": { + "description": "The unique identifier of the user that created the webhook.", + "examples": [ + "US123abc" + ], + "pattern": "^US(.*)$", + "type": "string" + }, + "orgId": { + "description": "The unique identifier of the organization the webhook belongs to", + "examples": [ + "OR1223abc" + ], + "pattern": "^OR(.*)$", + "type": "string" + }, + "label": { + "anyOf": [ + { + "description": "The webhook's label.", + "examples": [ + "my webhook label" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ], + "default": "enabled", + "description": "The status of the webhook.", + "examples": [ + "enabled" + ] + }, + "url": { + "format": "uri", + "description": "The endpoint that receives events from the webhook.", + "examples": [ + "https://example.com/" + ], + "type": "string" + }, + "key": { + "description": "Webhook key", + "examples": [ + "example-key" + ], + "type": "string" + }, + "createdAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "description": "The date the webhook was created at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "anyOf": [ + { + "description": "The date the webhook was deleted at, in ISO_8601 format.", + "examples": [ + "2022-01-01T00:00:00Z" + ], + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ] + }, + "events": { + "minItems": 1, + "type": "array", + "items": { + "type": "string", + "enum": [ + "call.transcript.completed" + ] + } + }, + "resourceIds": { + "anyOf": [ + { + "type": "array", + "items": { + "pattern": "^PN(.*)$", + "type": "string" + } + }, + { + "type": "array", + "items": { + "const": "*", + "type": "string" + } + } + ] + } + }, + "required": [ + "id", + "userId", + "orgId", + "label", + "status", + "url", + "key", + "createdAt", + "updatedAt", + "deletedAt", + "events", + "resourceIds" + ] + } + }, + "required": [ + "data" + ] + } + } + } + }, + "400": { + "description": "Invalid Version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0305400", + "type": "string" + }, + "status": { + "const": 400, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Invalid Version", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + }, + "description": { + "const": "Invalid Version", + "type": "string" + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title", + "description" + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300401", + "type": "string" + }, + "status": { + "const": 401, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unauthorized", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300403", + "type": "string" + }, + "status": { + "const": 403, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Forbidden", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0300404", + "type": "string" + }, + "status": { + "const": 404, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Not Found", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + }, + "500": { + "description": "Unknown Error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "const": "0301500", + "type": "string" + }, + "status": { + "const": 500, + "type": "number" + }, + "docs": { + "const": "https://openphone.com/docs", + "type": "string" + }, + "title": { + "const": "Unknown", + "type": "string" + }, + "trace": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "message": { + "type": "string" + }, + "value": {}, + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "path", + "message", + "schema" + ] + } + } + }, + "required": [ + "message", + "code", + "status", + "docs", + "title" + ] + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ListPhoneNumbersResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of OpenPhone phone number.", + "examples": [ + "PN123bc" + ], + "pattern": "^PN(.*)$", + "type": "string" + }, + "groupId": { + "description": "The unique identifier of the group to which the OpenPhone number belongs.", + "examples": [ + "1234" + ], + "type": "string" + }, + "createdAt": { + "description": "Timestamp of when the phone number was added to the account in ISO 8601 format.", + "examples": [ + " '2022-01-01T00:00:00Z'" + ], + "type": "string" + }, + "updatedAt": { + "description": "Timestamp of the last update to the phone number's details in ISO 8601 format.", + "examples": [ + " '2022-01-01T00:00:00Z'" + ], + "type": "string" + }, + "name": { + "description": "The display name of the phone number", + "examples": [ + "My phone number" + ], + "type": "string" + }, + "number": { + "pattern": "^\\+[1-9]\\d{1,14}$", + "description": "A phone number in E.164 format, including the country code.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + "formattedNumber": { + "anyOf": [ + { + "description": "A human-readable representation of a phone number.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "forward": { + "anyOf": [ + { + "description": "Forwarding number for incoming calls, null if no forwarding number is configured.", + "examples": [ + "+15555555555" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "portRequestId": { + "anyOf": [ + { + "description": "Unique identifier for the phone number’s porting request, if applicable.", + "examples": [ + "123abc" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "portingStatus": { + "anyOf": [ + { + "description": "Current status of the porting process, if applicable.", + "examples": [ + "completed" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "symbol": { + "anyOf": [ + { + "description": "Custom symbol or emoji associated with the phone number.", + "examples": [ + "🏡" + ], + "type": "string" + }, + { + "type": "null" + } + ] + }, + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "groupId": { + "type": "string" + }, + "id": { + "pattern": "^US(.*)$", + "type": "string" + }, + "lastName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + } + }, + "required": [ + "email", + "firstName", + "groupId", + "id", + "lastName", + "role" + ] + } + }, + "restrictions": { + "type": "object", + "properties": { + "messaging": { + "type": "object", + "properties": { + "CA": { + "type": "string", + "enum": [ + "restricted", + "unrestricted" + ], + "description": "The phone-number usage restriction status for a specific region", + "examples": [ + "unrestricted" + ] + }, + "US": { + "type": "string", + "enum": [ + "restricted", + "unrestricted" + ], + "description": "The phone-number usage restriction status for a specific region", + "examples": [ + "unrestricted" + ] + }, + "Intl": { + "type": "string", + "enum": [ + "restricted", + "unrestricted" + ], + "description": "The phone-number usage restriction status for a specific region", + "examples": [ + "unrestricted" + ] + } + }, + "required": [ + "CA", + "US", + "Intl" + ] + }, + "calling": { + "type": "object", + "properties": { + "CA": { + "type": "string", + "enum": [ + "restricted", + "unrestricted" + ], + "description": "The phone-number usage restriction status for a specific region", + "examples": [ + "unrestricted" + ] + }, + "US": { + "type": "string", + "enum": [ + "restricted", + "unrestricted" + ], + "description": "The phone-number usage restriction status for a specific region", + "examples": [ + "unrestricted" + ] + }, + "Intl": { + "type": "string", + "enum": [ + "restricted", + "unrestricted" + ], + "description": "The phone-number usage restriction status for a specific region", + "examples": [ + "unrestricted" + ] + } + }, + "required": [ + "CA", + "US", + "Intl" + ] + } + }, + "required": [ + "messaging", + "calling" + ] + } + }, + "required": [ + "id", + "groupId", + "createdAt", + "updatedAt", + "name", + "number", + "formattedNumber", + "forward", + "portRequestId", + "portingStatus", + "symbol", + "users", + "restrictions" + ] + } + } + }, + "required": [ + "data" + ] + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } + }, + "servers": [ + { + "url": "https://api.openphone.com", + "description": "Production server" + } + ], + "tags": [ + { + "name": "Calls", + "description": "Operations related to calls" + }, + { + "name": "Call Summaries", + "description": "Operations related to call summaries" + }, + { + "name": "Call Transcripts", + "description": "Operations related to call transcripts" + }, + { + "name": "Contacts", + "description": "Operations related to contacts" + }, + { + "name": "Conversations", + "description": "Operations related to conversations" + }, + { + "name": "Messages", + "description": "Operations related to text messages" + }, + { + "name": "Phone Numbers", + "description": "Operations related to phone numbers" + }, + { + "name": "Webhooks", + "description": "Operations related to webhooks" + } + ], + "security": [ + { + "apiKey": [] + } + ], + "x-kong-name": "public_api", + "x-kong-service-defaults": { + "retries": 10, + "connect_timeout": 30000, + "write_timeout": 30000, + "read_timeout": 30000 + }, + "x-kong-route-defaults": { + "preserve_host": true + }, + "x-kong-plugin-key-auth": { + "config": { + "key_names": [ + "Authorization" + ] + } + }, + "x-kong-plugin-rate-limiting": { + "config": { + "second": 10, + "policy": "local", + "limit_by": "consumer", + "fault_tolerant": true + } + } + } \ No newline at end of file diff --git a/packages/v1-ready/openphone/tests/ManagerTest.js b/packages/v1-ready/openphone/tests/ManagerTest.js new file mode 100644 index 0000000..9940672 --- /dev/null +++ b/packages/v1-ready/openphone/tests/ManagerTest.js @@ -0,0 +1,75 @@ +const { Api } = require('../api'); +const { Definition } = require('../definition'); + +class OpenproneMockApi { + constructor() { + this.baseUrl = 'https://api.openphone.com'; + } + + // Mock methods for testing + async getCalls() { + return { data: [] }; + } + + async getMessages() { + return { data: [] }; + } + + async getContacts() { + return { data: [] }; + } + + async getCurrentUser() { + return { data: { id: '123', name: 'Test User' } }; + } +} + +beforeAll(async () => { + this.api = new Api({ + api_key: process.env.OPENPHONE_API_KEY, + }); +}); + +afterAll(async () => { + await new Promise((resolve) => setTimeout(resolve, 1000)); +}); + +describe('OpenPhone Manager', () => { + it('should initialize', async () => { + expect(this.api).toBeDefined(); + expect(this.api.baseUrl).toBe('https://api.openphone.com'); + }); + + describe('API Methods', () => { + it('should have getCalls method', () => { + expect(typeof this.api.getCalls).toBe('function'); + }); + + it('should have getMessages method', () => { + expect(typeof this.api.getMessages).toBe('function'); + }); + + it('should have getContacts method', () => { + expect(typeof this.api.getContacts).toBe('function'); + }); + + it('should have getCurrentUser method', () => { + expect(typeof this.api.getCurrentUser).toBe('function'); + }); + }); +}); + +describe('OpenPhone Definition', () => { + it('should have correct module name', () => { + expect(Definition.moduleName).toBe('openphone'); + expect(Definition.getName()).toBe('openphone'); + }); + + it('should have API class', () => { + expect(Definition.API).toBe(Api); + }); + + it('should have model name', () => { + expect(Definition.modelName).toBe('OpenPhone'); + }); +}); \ No newline at end of file diff --git a/packages/v1-ready/openphone/tests/api.test.js b/packages/v1-ready/openphone/tests/api.test.js new file mode 100644 index 0000000..4b59384 --- /dev/null +++ b/packages/v1-ready/openphone/tests/api.test.js @@ -0,0 +1,951 @@ +const {Authenticator} = require('@friggframework/test'); +const {Api} = require('../api'); +const config = require('../defaultConfig.json'); +const {promises: fs} = require("fs"); + +const mockDir = `./mocks${Date.now()}` +const parsedBody = async function async(resp) { + const contentType = resp.headers.get('Content-Type') || ''; + let body; + if ( + contentType.match(/^application\/json/) || + contentType.match(/^application\/vnd.api\+json/) || + contentType.match(/^application\/hal\+json/) + ) { + body = await resp.json(); + } else { + body = await resp.text(); + } + await fs.writeFile(`./${mockDir}/${this.lastCalled}.json`, JSON.stringify(body)); + return body; +} + +describe(`${config.label} API tests`, () => { + const apiParams = { + client_id: process.env.HUBSPOT_CLIENT_ID, + client_secret: process.env.HUBSPOT_CLIENT_SECRET, + redirect_uri: `${process.env.REDIRECT_URI}/hubspot`, + scope: process.env.HUBSPOT_SCOPE + }; + Object.getOwnPropertyNames(Api.prototype).forEach(f => { + if (f !== 'constructor' && + typeof Api.prototype[f] === 'function' && + f !== 'addJsonHeaders' && + !f.startsWith('_')) { + const old = Api.prototype[f]; + Api.prototype[f] = function (...args) { + this.lastCalled = f; + return old.apply(this, args); + } + } + }) + const api = new Api(apiParams); + api.parsedBody = parsedBody; + beforeAll(async () => { + await fs.mkdir(mockDir, {recursive: true}); + }); + + beforeAll(async () => { + const url = await api.getAuthUri(); + const response = await Authenticator.oauth2(url); + const baseArr = response.base.split('/'); + response.entityType = baseArr[baseArr.length - 1]; + delete response.base; + + await api.getTokenFromCode(response.data.code); + }); + + const testObjType = 'tests'; + + describe('HS User Info', () => { + it('should return the user details', async () => { + const response = await api.getUserDetails(); + expect(response).toHaveProperty('portalId'); + expect(response).toHaveProperty('token'); + expect(response).toHaveProperty('app_id'); + }); + }); + + // Skipping tests... inherited with bugs, needs refactor + describe.skip('HS Deals', () => { + it('should return a deal by id', async () => { + const deal_id = '2022088696'; + const response = await api.getDealById(deal_id); + expect(response.id).toBe(deal_id); + expect(response.properties.amount).to.eq('100000'); + expect(response.properties.dealname).to.eq('Test'); + expect(response.properties.dealstage).to.eq('appointmentscheduled'); + }); + + it('should return all deals of a company', async () => { + let response = await api.listDeals(); + expect(response.results[0]).toHaveProperty('id'); + expect(response.results[0]).toHaveProperty('properties'); + expect(response.results[0].properties).toHaveProperty('amount'); + expect(response.results[0].properties).toHaveProperty('dealname'); + expect(response.results[0].properties).toHaveProperty('dealstage'); + }); + }); + + // Some tests skipped ... inherited with bugs, needs refactor + describe('HS Companies', () => { + let createRes; + beforeAll(async () => { + const body = { + domain: 'gitlab.com', + name: 'Gitlab', + }; + createRes = await api.createCompany(body); + }); + + afterAll(async () => { + await api.archiveCompany(createRes.id); + }); + + it('should create a Company', async () => { + expect(createRes.properties.domain).toBe('gitlab.com'); + expect(createRes.properties.name).toBe('Gitlab'); + }); + + it('should return the company info', async () => { + const company_id = createRes.id; + const response = await api.getCompanyById(company_id); + expect(response.id).toBe(company_id); + // expect(response.properties.domain).to.eq('golabstech.com'); + // expect(response.properties.name).to.eq('Golabs'); + }); + + it('should list Companies', async () => { + const response = await api.listCompanies(); + expect(response.results[0]).toHaveProperty('id'); + expect(response.results[0]).toHaveProperty('properties'); + expect(response.results[0].properties).toHaveProperty('domain'); + expect(response.results[0].properties).toHaveProperty('name'); + expect(response.results[0].properties).toHaveProperty( + 'hs_object_id' + ); + }); + + it('should update Company', async () => { + const body = { + properties: { + name: 'Facebook 1', + } + }; + const response = await api.updateCompany( + createRes.id, + body + ); + expect(response.properties.name).toBe('Facebook 1'); + }); + + it('should search for a company', async () => { + // case sensitive search of default searchable properties + // website, phone, name, domain + const body = { + query: 'Facebook', + }; + const response = await api.searchCompanies(body); + expect(response.results[0]).toHaveProperty('id'); + expect(response.results[0]).toHaveProperty('properties'); + expect(response.results[0].properties).toHaveProperty('domain'); + expect(response.results[0].properties).toHaveProperty('name'); + expect(response.results[0].properties.name).toBe('Facebook 1'); + }) + + it('should delete a company', async () => { + // Hope the after works! + }); + }); + + // Skipping tests... inherited with bugs, needs refactor + describe.skip('HS Companies BATCH', () => { + let createResponse; + beforeAll(async () => { + const body = [ + { + properties: { + domain: 'gitlab.com', + name: 'Gitlab', + }, + }, + { + properties: { + domain: 'facebook.com', + name: 'Facebook', + }, + }, + ]; + createResponse = await api.createABatchCompanies(body); + }); + + afterAll(async () => { + return createResponse.results.map(async (company) => { + return api.deconsteCompany(company.id); + }); + }); + + it('should create a Batch of Companies', async () => { + const results = _.sortBy(createResponse.results, [ + function (o) { + return o.properties.name; + }, + ]); + expect(createResponse.status).toBe('COMPCONSTE'); + expect(results[0].properties.name).toBe('Facebook'); + expect(results[0].properties.domain).toBe('facebook.com'); + expect(results[1].properties.name).toBe('Gitlab'); + expect(results[1].properties.domain).toBe('gitlab.com'); + }); + + it('should update a Batch of Companies', async () => { + const body = [ + { + properties: { + name: 'Facebook 2', + }, + id: createResponse.results[0].id, + }, + { + properties: { + name: 'Gitlab 2', + }, + id: createResponse.results[1].id, + }, + ]; + const response = await api.updateBatchCompany(body); + + const results = _.sortBy(response.results, [ + function (o) { + return o.properties.name; + }, + ]); + expect(response.status).toBe('COMPCONSTE'); + expect(results[0].properties.name).toBe('Facebook 2'); + expect(results[1].properties.name).toBe('Gitlab 2'); + }); + }); + + // Some tests skipped ... inherited with bugs, needs refactor + describe('HS Contacts', () => { + let createResponse; + + it('should create a Contact', async () => { + const body = { + email: 'jose.miguel@hubspot.com', + firstname: 'Miguel', + lastname: 'Delgado', + }; + createResponse = await api.createContact(body); + expect(createResponse).toHaveProperty('id'); + expect(createResponse.properties.firstname).toBe('Miguel'); + expect(createResponse.properties.lastname).toBe('Delgado'); + }); + + it('should list Contacts', async () => { + let response = await api.listContacts(); + expect(response.results[0]).toHaveProperty('id'); + expect(response.results[0]).toHaveProperty('properties'); + expect(response.results[0].properties).toHaveProperty('firstname'); + }); + + it('should update a Contact', async () => { + let properties = { + lastname: 'Johnson (Sample Contact) 1', + }; + let response = await api.updateContact( + createResponse.id, + properties, + ); + expect(response.properties.lastname).toBe( + 'Johnson (Sample Contact) 1' + ); + }); + + it('should delete a contact', async () => { + let response = await api.archiveContact(createResponse.id); + expect(response.status).toBe(204); + }); + }); + + // Skipping tests... inherited with bugs, needs refactor + describe.skip('HS Contacts BATCH', () => { + let createResponse; + beforeAll(async () => { + let body = [ + { + properties: { + email: 'jose.miguel3@hubspot.com', + firstname: 'Miguel', + lastname: 'Delgado', + }, + }, + { + properties: { + email: 'jose.miguel2@hubspot.com', + firstname: 'Miguel', + lastname: 'Delgado', + }, + }, + ]; + createResponse = await api.createbatchContacts(body); + }); + + afterAll(async () => { + createResponse.results.forEach(async (contact) => { + await api.deleteContact(contact.id); + }); + }); + + it('should create a batch of Contacts', async () => { + let results = _.sortBy(createResponse.results, [ + function (o) { + return o.properties.email; + }, + ]); + expect(createResponse.status).toBe('COMPLETE'); + expect(results[0].properties.email).toBe( + 'jose.miguel2@hubspot.com' + ); + expect(results[0].properties.firstname).toBe('Miguel'); + }); + + it('should update a batch of Contacts', async () => { + let body = [ + { + properties: { + firstname: 'Miguel 3', + }, + id: createResponse.results[0].id, + }, + { + properties: { + firstname: 'Miguel 2', + }, + id: createResponse.results[1].id, + }, + ]; + + let response = await api.updateBatchContact(body); + let results = _.sortBy(response.results, [ + function (o) { + return o.properties.firstname; + }, + ]); + expect(response.status).toBe('COMPLETE'); + expect(results[0].properties.firstname).toBe('Miguel 2'); + expect(results[1].properties.firstname).toBe('Miguel 3'); + }); + }); + + describe('HS Landing Pages', () => { + let allLandingPages; + it('should return the landing pages', async () => { + allLandingPages = await api.getLandingPages(); + expect(allLandingPages).toBeDefined(); + }); + let primaryLandingPages + it('should return only primary language landing pages', async () => { + primaryLandingPages = await api.getLandingPages('translatedFromId__is_null'); + expect(primaryLandingPages).toBeDefined(); + }); + let variationLandingPages; + let sampleLandingPage; + it('should return only variation language landing pages', async () => { + variationLandingPages = await api.getLandingPages('translatedFromId__not_null'); + expect(variationLandingPages).toBeDefined(); + sampleLandingPage = variationLandingPages.results.slice(-1)[0]; + expect(sampleLandingPage.id).toBeDefined(); + }); + it('confirm total landing pages', async () => { + expect(allLandingPages.total).toBe(primaryLandingPages.total + variationLandingPages.total) + }); + + it('get Landing Page by Id', async () => { + const response = await api.getLandingPage(sampleLandingPage.id); + expect(response).toBeDefined(); + }); + it('update a Landing page (maximal patch)', async () => { + delete sampleLandingPage['archivedAt']; + const response = await api.updateLandingPage( + sampleLandingPage.id, + sampleLandingPage, + true); + expect(response).toBeDefined(); + }); + it('update a Landing page (minimal patch)', async () => { + const response = await api.updateLandingPage( + sampleLandingPage.id, + {htmlTitle: `test Landing page ${Date.now()}`}, + true); + expect(response).toBeDefined(); + }); + it('publish a Landing Page', async () => { + const now = new Date(Date.now() + 5000); + const response = await api.publishLandingPage( + sampleLandingPage.id, + now.toISOString(), + ); + expect(response).toBeDefined(); + }); + it('push a Landing page draft to live', async () => { + + const response = await api.pushLandingPageDraftToLive(sampleLandingPage.id); + expect(response).toBeDefined(); + }); + }); + + describe('HS Site Pages', () => { + let allSitePages; + it('should return the Site pages', async () => { + allSitePages = await api.getSitePages(); + expect(allSitePages).toBeDefined(); + }); + let primarySitePages + it('should return only primary language Site pages', async () => { + primarySitePages = await api.getSitePages('translatedFromId__is_null'); + expect(primarySitePages).toBeDefined(); + }); + let variationSitePages + it('should return only variation language Site pages', async () => { + variationSitePages = await api.getSitePages('translatedFromId__not_null'); + expect(variationSitePages).toBeDefined(); + }); + it('confirm total Site pages', async () => { + expect(allSitePages.total).toBe(primarySitePages.total + variationSitePages.total) + }); + it('get Site Page by Id', async () => { + const pageToGet = primarySitePages.results.slice(-1)[0]; + const response = await api.getSitePage(pageToGet.id); + expect(response).toBeDefined(); + }); + it('update a Site page', async () => { + const pageToUpdate = variationSitePages.results.slice(-1)[0]; + const response = await api.updateSitePage( + pageToUpdate.id, + {htmlTitle: `test site page ${Date.now()}`}, + true); + expect(response).toBeDefined(); + }); + }); + + describe('HS Blog Posts', () => { + let allBlogPosts; + it('should return the Blog Posts', async () => { + allBlogPosts = await api.getBlogPosts(); + expect(allBlogPosts).toBeDefined(); + }); + let primaryBlogPosts + it('should return only primary language Blog Posts', async () => { + primaryBlogPosts = await api.getBlogPosts('translatedFromId__is_null'); + expect(primaryBlogPosts).toBeDefined(); + }); + let variationBlogPosts + it('should return only variation language Blog Posts', async () => { + variationBlogPosts = await api.getBlogPosts('translatedFromId__not_null'); + expect(variationBlogPosts).toBeDefined(); + }); + it('confirm total Blog Posts', async () => { + expect(allBlogPosts.total).toBe(primaryBlogPosts.total + variationBlogPosts.total) + }); + it('get Blog Post by Id', async () => { + const postToGet = primaryBlogPosts.results.slice(-1)[0]; + const response = await api.getBlogPost(postToGet.id); + expect(response).toBeDefined(); + }); + it('update a Blog Post', async () => { + const postToUpdate = primaryBlogPosts.results[0]; + const response = await api.updateBlogPost( + postToUpdate.id, + {htmlTitle: `test blog post ${Date.now()}`}, + true); + expect(response).toBeDefined(); + }); + }); + + describe('HS Email Templates', () => { + let allEmailTemplates; + it('should return the Email Templates', async () => { + allEmailTemplates = await api.getEmailTemplates(); + expect(allEmailTemplates).toBeDefined(); + expect(allEmailTemplates).toHaveProperty('objects') + }); + it('get Email Template by Id', async () => { + const templateToGet = allEmailTemplates.objects.slice(-1)[0]; + const response = await api.getEmailTemplate(templateToGet.id); + expect(response).toBeDefined(); + }); + it('update a Email Template', async () => { + const postToUpdate = allEmailTemplates.objects.slice(-1)[0]; + const response = await api.updateEmailTemplate( + postToUpdate.id, + {label: `test email template ${Date.now()}`}, + ); + expect(response).toBeDefined(); + }); + let createdId; + it('create an Email Template', async () => { + const response = await api.createEmailTemplate( + allEmailTemplates.objects.slice(-1)[0] + ); + expect(response).toBeDefined(); + createdId = response.id; + }); + it('Delete an Email Template', async () => { + const response = await api.deleteEmailTemplate(createdId) + expect(response.status).toBe(204); + }); + }); + + describe('Custom Object Schemas', () => { + const testSchema = { + "labels": {"singular": "Test Object", "plural": "Test Objects"}, + "requiredProperties": ["word"], + "searchableProperties": ["word"], + "primaryDisplayProperty": "word", + "secondaryDisplayProperties": [], + "description": null, + "properties": [{ + "name": "word", + "label": "Word", + "type": "string", + "fieldType": "text", + "description": "", + "hasUniqueValue": false + }], + "associatedObjects": [ + "COMPANY" + ], + "name": "test_object" + } + + it('should return the Custom Object Schemas', async () => { + const response = await api.listCustomObjectSchemas(); + expect(response).toBeDefined(); + expect(response).toHaveProperty('results'); + expect(response.results.length).toBeGreaterThan(0); + expect(response.results.filter(s => s.name === testSchema.name).length).toBe(0); + }); + + it('should create a Custom Object Schema', async () => { + const response = await api.createCustomObjectSchema(testSchema); + expect(response).toBeDefined(); + expect(response).toHaveProperty('id'); + }); + + it('Should get association labels', async () => { + const labels = await api.getAssociationLabels('COMPANY', testSchema.name); + expect(labels).toBeDefined(); + expect(labels.results).toHaveProperty('length'); + expect(labels.results.find(label => label.label === 'Primary')).toBeTruthy(); + }) + + it('should delete a Custom Object Schema', async () => { + const response = await api.deleteCustomObjectSchema(testSchema.name); + expect(response.status).toBe(204); + }) + }) + + describe('HS Custom Objects', () => { + let allCustomObjects; + let oneWord; + const createWord = 'Test Custom Object Create'; + const updateWord = 'Test Custom Object Update'; + it('should return the Custom Objects', async () => { + allCustomObjects = await api.listCustomObjects( + testObjType, + {properties: 'word'} + ); + expect(allCustomObjects).toBeDefined(); + expect(allCustomObjects).toHaveProperty('results') + oneWord = allCustomObjects.results.find(o => o.properties.word === 'One'); + }); + it('get Custom Object by Id', async () => { + const objectToGet = allCustomObjects.results.slice(-1)[0]; + const response = await api.getCustomObject(testObjType, objectToGet.id); + expect(response).toBeDefined(); + }); + let createdObject; + it('create a Custom Object', async () => { + createdObject = await api.createCustomObject( + testObjType, + { + properties: { + word: createWord + } + }, + ); + expect(createdObject).toBeDefined(); + }) + it('update a Custom Object', async () => { + const response = await api.updateCustomObject( + testObjType, + createdObject.id, + { + properties: { + word: updateWord + } + }, + ); + expect(response).toBeDefined(); + }); + it('Search for custom object', async () => { + // Search doesn't work on objects that were very recently created + const response = await api.searchCustomObjects( + testObjType, + { + "query": 'One', + "filterGroups": [ + { + "filters": [ + { + "propertyName": "word", + "value": 'One', + "operator": "EQ" + } + ] + } + ] + } + ); + expect(response).toBeDefined(); + expect(response.results).toHaveProperty('length'); + expect(response.results[0].id).toBe(oneWord.id); + }); + it('delete a Custom Object', async () => { + const response = await api.deleteCustomObject(testObjType, createdObject.id); + expect(response.status).toBe(204); + }) + + // BATCH TESTS + const batchSize = 100; + let createdBatch; + it('Should bulk create a batch of objects', async () => { + const range = Array.from({length: batchSize}, (_, i) => i); + const objectsToCreate = range.map(i => ({ + properties: { + word: `Test Bulk Create ${i}` + }, + })) + const response = await api.bulkCreateCustomObjects( + testObjType, + {inputs: objectsToCreate} + ); + expect(response.results).toHaveProperty('length'); + expect(response.results.length).toBe(batchSize); + createdBatch = response.results; + }) + it('Should read a batch of objects', async () => { + const inputs = createdBatch.map(o => { + return {id: o.id} + }); + const response = await api.bulkReadCustomObjects( + testObjType, + { + inputs, + properties: ['word'] + } + ); + expect(response).toBeDefined(); + expect(response.results).toHaveProperty('length'); + expect(response.results.length).toBe(batchSize); + }); + it('Should update a batch of objects', async () => { + const inputs = createdBatch.map(o => { + return { + id: o.id, + properties: {word: 'Test Update'} + } + }); + + const response = await api.bulkUpdateCustomObjects( + testObjType, + { + inputs, + } + ); + expect(response).toBeDefined(); + expect(response.results).toHaveProperty('length'); + expect(response.results.length).toBe(batchSize); + }); + it('Should delete a batch of objects', async () => { + const inputs = createdBatch.map(o => { + return {id: o.id} + }); + const response = await api.bulkArchiveCustomObjects( + testObjType, + { + inputs + } + ); + expect(response).toBeDefined(); + expect(response).toBe(""); + }); + afterAll(async () => { + // Search doesn't work on objects that were very recently created + const response = await api.searchCustomObjects( + testObjType, + { + "query": 'Test', + "limit": 100, + "filterGroups": [ + { + "filters": [ + { + "propertyName": "word", + "value": 'Test', + "operator": "CONTAINS_TOKEN" + } + ] + } + ] + } + ); + const inputs = response.results.map(o => { + return {id: o.id} + }); + await api.bulkArchiveCustomObjects(testObjType, {inputs}); + }) + }) + + describe('HS List Requests', () => { + it('Should get a list of lists', async () => { + const response = await api.searchLists(); + expect(response).toBeDefined(); + expect(response.lists).toHaveProperty('length'); + }); + let createdListId; + it('Should create a list', async () => { + const {list} = await api.createList('Test List', '0-2'); + createdListId = list.listId; + }); + it('Should get a list', async () => { + const response = await api.getListById(createdListId); + expect(response).toBeDefined(); + expect(response.list.listId).toBe(createdListId); + }) + it('Should add a record to list', async () => { + const companyResponse = await api.listCompanies(); + const someCompanyId = companyResponse.results[0].id; + const response = await api.addToList(createdListId, [someCompanyId]); + expect(response).toBeDefined(); + // HS has a typo in the response "recordsIds" instead of "recordIds" + expect(response.recordsIdsAdded).toHaveLength(1); + }) + it('Should remove all records from list', async () => { + const response = await api.removeAllListMembers(createdListId); + expect(response.status).toBe(204); + }) + it('Should delete a list', async () => { + const response = await api.deleteList(createdListId); + expect(response).toBeDefined(); + expect(response.status).toBe(204); + }) + }); + + describe('Association Labels', () => { + it('Should get association labels', async () => { + const labels = await api.getAssociationLabels('COMPANY', 'CONTACT'); + expect(labels).toBeDefined(); + expect(labels.results).toHaveProperty('length'); + expect(labels.results.find(label => label.label && label.label.includes('Primary'))).toBeTruthy(); + }) + + let createdBatch; + let toCompany; + beforeAll(async () => { + const batchSize = 20; + const range = Array.from({length: batchSize}, (_, i) => i); + const objectsToCreate = range.map(i => ({ + properties: { + word: `Test Bulk Create ${Date.now()}${i}` + }, + })) + const response = await api.bulkCreateCustomObjects( + testObjType, + {inputs: objectsToCreate} + ); + expect(response.results).toHaveProperty('length'); + expect(response.results.length).toBe(batchSize); + createdBatch = response.results; + + const companyResponse = await api.listCompanies(); + toCompany = companyResponse.results[0].id; + }) + + it('Should create batch default associations', async () => { + const inputs = createdBatch.map(o => { + return { + from: {id: o.id}, + to: {id: toCompany} + } + }); + const response = await api.createBatchAssociationsDefault( + testObjType, + 'COMPANY', + inputs + ); + expect(response).toBeDefined(); + expect(response).toHaveProperty('length'); + expect(response.length).toBe(createdBatch.length * 2); + }) + + let createdLabel; + it('Should create a test association label', async () => { + const response = await api.createAssociationLabel(testObjType, 'COMPANY', { + inverseLabel: 'ooF', + name: 'Foo', + label: 'Foo', + }); + expect(response).toBeDefined(); + const {results} = response; + expect(results).toHaveProperty('length'); + expect(results.length).toBe(2); + expect(results.find(label => label.label && label.label === 'Foo')).toBeTruthy(); + createdLabel = results.find(label => label.label && label.label === 'Foo'); + }) + + it('Should get association labels', async () => { + const labels = await api.getAssociationLabels(testObjType, 'COMPANY'); + expect(labels).toBeDefined(); + expect(labels.results).toHaveProperty('length'); + expect(labels.results.find(label => label.label && label.label === 'Foo')).toBeTruthy(); + const created = labels.results.find(label => label.label && label.label === 'Foo'); + expect(created).toEqual(createdLabel); + }) + + it('Should associate a batch of objects', async () => { + const inputs = createdBatch.map(o => { + return { + types: [{ + associationCategory: createdLabel.category, + associationTypeId: createdLabel.typeId + }], + from: {id: o.id}, + to: {id: toCompany} + } + }); + const response = await api.createBatchAssociations( + testObjType, + 'COMPANY', + inputs + ); + expect(response).toBeDefined(); + expect(response).toHaveProperty('length'); + expect(response.length).toBe(createdBatch.length); + }); + + it('Should read the associations of a batch of objects', async () => { + const inputs = createdBatch.map(o => ({id: o.id})); + const response = await api.getBatchAssociations( + testObjType, + 'COMPANY', + inputs + ) + expect(response).toBeDefined(); + expect(response).toHaveProperty('length'); + expect(response.length).toBe(createdBatch.length); + for (const a of response) { + expect(a).toHaveProperty('to'); + expect(a.to[0].associationTypes).toHaveProperty('length'); + expect(a.to[0].associationTypes.some(t => t.typeId === createdLabel.typeId)).toBe(true); + } + }) + + it('Should remove the specific labelled associations of a batch of objects', async () => { + const inputs = createdBatch.map(o => { + return { + types: [{ + associationCategory: createdLabel.category, + associationTypeId: createdLabel.typeId + }], + from: {id: o.id}, + to: {id: toCompany} + } + }); + const response = await api.deleteBatchAssociationLabels( + testObjType, + 'COMPANY', + inputs + ); + expect(response).toBeDefined(); + expect(response.status).toBe(204); + }) + + it('Should delete an association label', async () => { + const response = await api.deleteAssociationLabel(testObjType, 'COMPANY', createdLabel.typeId); + expect(response).toBeDefined(); + expect(response.status).toBe(204); + }) + + afterAll(async () => { + const inputs = createdBatch.map(o => { + return {id: o.id} + }); + const response = await api.bulkArchiveCustomObjects( + testObjType, + { + inputs + } + ); + expect(response).toBeDefined(); + expect(response).toBe(""); + }); + }); + + describe('Properties requests', () => { + let groupeName; + it('Should retrieve a property', async () => { + const response = await api.getPropertyByName('tests', 'word'); + expect(response).toBeDefined(); + expect(response).toHaveProperty('label'); + expect(response.label).toBe('Word'); + groupeName = response.groupName; + }); + + it('Should create a property', async () => { + const response = await api.createProperty('tests', { + "name": "test_field", + "label": "Test Field", + "type": "enumeration", + "fieldType": "select", + "groupName": groupeName, + "description": "A test of enumerated fields", + "options": [ + { + "label": "Item One", + "value": "item_one" + }, + { + "label": "Item Two", + "value": "item_two" + } + ] + }); + expect(response).toBeDefined(); + expect(response).toHaveProperty('label'); + expect(response.name).toBe('test_field'); + }); + + it('Should update a property', async () => { + const existing = await api.getPropertyByName('tests', 'test_field'); + existing.options.push( + { + "label": "Item Three", + "value": "item_three", + } + ) + const response = await api.updateProperty('tests', 'test_field', existing); + expect(response).toBeDefined(); + expect(response).toHaveProperty('options'); + expect(response.options.some(o => o.label === 'Item Three')).toBeTruthy(); + }); + + it('Should delete a property', async () => { + const response = await api.deleteProperty('tests', 'test_field'); + expect(response).toBeDefined(); + expect(response.status).toBe(204); + }) + + }) +}); diff --git a/packages/v1-ready/openphone/tests/auther.test.js b/packages/v1-ready/openphone/tests/auther.test.js new file mode 100644 index 0000000..c8baaa4 --- /dev/null +++ b/packages/v1-ready/openphone/tests/auther.test.js @@ -0,0 +1,139 @@ +const {connectToDatabase, disconnectFromDatabase, createObjectId, Auther} = require('@friggframework/core'); +const {Authenticator, testAutherDefinition} = require('@friggframework/devtools'); +const {Definition} = require('../definition'); + +const authorizeResponse = { + "base": "/redirect/hubspot", + "data": { + "code": "test-code", + "state": "null" + } +} + +const tokenResponse = { + "token_type": "bearer", + "refresh_token": "test-refresh-token", + "access_token": "test-access-token", + "expires_in": 1800 +} + +const mocks = { + getUserDetails: { + "portalId": 111111111, + "timeZone": "US/Eastern", + "accountType": "DEVELOPER_TEST", + "currency": "USD", + "utcOffset": "-05:00", + "utcOffsetMilliseconds": -18000000, + "token": "test-token", + "user": "projectteam@lefthook.co", + "hub_domain": "Testing Object Things-dev-44613847.com", + "scopes": [ + "content", + "oauth", + "crm.objects.contacts.read", + "crm.objects.contacts.write", + "crm.objects.companies.write", + "crm.objects.companies.read", + "crm.objects.deals.read", + "crm.schemas.deals.read" + ], + "hub_id": 111111111, + "app_id": 22222222, + "expires_in": 1704, + "user_id": 33333333, + "token_type": "access" + }, + tokenResponse: { + "token_type": "bearer", + "refresh_token": "test-refresh-token", + "access_token": "test-access-token", + "expires_in": 1800 + }, + authorizeResponse: { + "base": "/redirect/hubspot", + "data": { + "code": "test-code", + "state": "null" + } + } +} + +testAutherDefinition(Definition, mocks) + +describe.skip('HubSpot Module Live Tests', () => { + let module, authUrl; + beforeAll(async () => { + await connectToDatabase(); + module = await Auther.getInstance({ + definition: Definition, + userId: createObjectId(), + }); + }); + + afterAll(async () => { + await module.CredentialModel.deleteMany(); + await module.EntityModel.deleteMany(); + await disconnectFromDatabase(); + }); + + describe('getAuthorizationRequirements() test', () => { + it('should return auth requirements', async () => { + const requirements = module.getAuthorizationRequirements(); + expect(requirements).toBeDefined(); + expect(requirements.type).toEqual('oauth2'); + expect(requirements.url).toBeDefined(); + authUrl = requirements.url; + }); + }); + + describe('Authorization requests', () => { + let firstRes; + it('processAuthorizationCallback()', async () => { + const response = await Authenticator.oauth2(authUrl); + firstRes = await module.processAuthorizationCallback({ + data: { + code: response.data.code, + }, + }); + expect(firstRes).toBeDefined(); + expect(firstRes.entity_id).toBeDefined(); + expect(firstRes.credential_id).toBeDefined(); + }); + it.skip('retrieves existing entity on subsequent calls', async () => { + const response = await Authenticator.oauth2(authUrl); + const res = await module.processAuthorizationCallback({ + data: { + code: response.data.code, + }, + }); + expect(res).toEqual(firstRes); + }); + }); + describe('Test credential retrieval and module instantiation', () => { + it('retrieve by entity id', async () => { + const newModule = await Auther.getInstance({ + userId: module.userId, + entityId: module.entity.id, + definition: Definition, + }); + expect(newModule).toBeDefined(); + expect(newModule.entity).toBeDefined(); + expect(newModule.credential).toBeDefined(); + expect(await newModule.testAuth()).toBeTruthy(); + + }); + + it('retrieve by credential id', async () => { + const newModule = await Auther.getInstance({ + userId: module.userId, + credentialId: module.credential.id, + definition: Definition, + }); + expect(newModule).toBeDefined(); + expect(newModule.credential).toBeDefined(); + expect(await newModule.testAuth()).toBeTruthy(); + + }); + }); +}); diff --git a/packages/v1-ready/pipedrive/.eslintrc.json b/packages/v1-ready/pipedrive/.eslintrc.json new file mode 100644 index 0000000..49541d6 --- /dev/null +++ b/packages/v1-ready/pipedrive/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "@friggframework/eslint-config" +} diff --git a/packages/v1-ready/pipedrive/CHANGELOG.md b/packages/v1-ready/pipedrive/CHANGELOG.md new file mode 100644 index 0000000..8bacb81 --- /dev/null +++ b/packages/v1-ready/pipedrive/CHANGELOG.md @@ -0,0 +1,209 @@ +# v0.10.0 (Wed Mar 20 2024) + +:tada: This release contains work from new contributors! :tada: + +Thanks for all your work! + +:heart: Nicolas Leal ([@nicolasmelo1](https://github.com/nicolasmelo1)) + +:heart: nmilcoff ([@nmilcoff](https://github.com/nmilcoff)) + +#### 🚀 Enhancement + +#### 🐛 Bug Fix + +- correct some bad automated edits, though they are not in relevant + files ([@MichaelRyanWebber](https://github.com/MichaelRyanWebber)) +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 4 + +- [@MichaelRyanWebber](https://github.com/MichaelRyanWebber) +- Nicolas Leal ([@nicolasmelo1](https://github.com/nicolasmelo1)) +- nmilcoff ([@nmilcoff](https://github.com/nmilcoff)) +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.9.0 (Wed Sep 06 2023) + +#### 🐛 Bug Fix + +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.26 (Thu Jun 08 2023) + +#### 🐛 Bug Fix + +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.25 (Thu May 25 2023) + +#### 🐛 Bug Fix + +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.24 (Tue Apr 04 2023) + +#### 🐛 Bug Fix + +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.23 (Tue Feb 21 2023) + +#### 🐛 Bug Fix + +- Merge branch 'main' into hubspot-updates ([@seanspeaks](https://github.com/seanspeaks)) +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.21 (Tue Jan 31 2023) + +#### 🐛 Bug Fix + +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.19 (Wed Jan 11 2023) + +#### 🐛 Bug Fix + +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.18 (Tue Jan 10 2023) + +:tada: This release contains work from a new contributor! :tada: + +Thank you, Jonathan O'Donnell ([@joncodo](https://github.com/joncodo)), for all your work! + +#### 🐛 Bug Fix + +- Merge branch 'main' of github.com:friggframework/frigg into doc-updates ([@joncodo](https://github.com/joncodo)) +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 2 + +- Jonathan O'Donnell ([@joncodo](https://github.com/joncodo)) +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.17 (Mon Jan 09 2023) + +#### 🐛 Bug Fix + +- Merge remote-tracking branch 'origin/main' into + gitbook-updates [#48](https://github.com/friggframework/frigg/pull/48) ([@seanspeaks](https://github.com/seanspeaks)) +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) +- A lot of changes all rolled into + one [#21](https://github.com/friggframework/frigg/pull/21) ([@seanspeaks](https://github.com/seanspeaks)) +- Updated API modules with support for sls offline, and made sure optional chaining with discriminators was in + place ([@seanspeaks](https://github.com/seanspeaks)) +- Fixing dependencies across all API Modules ([@seanspeaks](https://github.com/seanspeaks)) +- More import issues (Exports are named objects, imports needed to object + destructure) ([@seanspeaks](https://github.com/seanspeaks)) +- Updates to API Modules for proper export/imports ([@seanspeaks](https://github.com/seanspeaks)) +- Merge remote-tracking branch 'origin/main' into + simplify-mongoose-models ([@seanspeaks](https://github.com/seanspeaks)) +- Update all api modules to use module-plugin models ([@seanspeaks](https://github.com/seanspeaks)) +- Add READMEs for all packages and + api-modules [#20](https://github.com/friggframework/frigg/pull/20) ([@seanspeaks](https://github.com/seanspeaks)) +- Add READMEs for all packages and api-modules ([@seanspeaks](https://github.com/seanspeaks)) + +#### ⚠️ Pushed to `main` + +- Merge branch 'main' into gitbook-updates ([@seanspeaks](https://github.com/seanspeaks)) +- Finish initial formatting and publishing of all modules ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.14 (Tue Dec 06 2022) + +#### 🐛 Bug Fix + +- fix modules to + @friggframework [#74](https://github.com/friggframework/frigg/pull/74) ([@sheehantoufiq](https://github.com/sheehantoufiq)) +- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 2 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) +- Sheehan Toufiq Khan ([@sheehantoufiq](https://github.com/sheehantoufiq)) + +--- + +# v0.8.11 (Mon Sep 19 2022) + +#### 🐛 Bug Fix + +- Test environment setup for all + modules [#49](https://github.com/friggframework/frigg/pull/49) ([@seanspeaks](https://github.com/seanspeaks)) +- Test environment setup for all modules ([@seanspeaks](https://github.com/seanspeaks)) +- Merge remote-tracking branch 'origin/main' into + gitbook-updates [#48](https://github.com/friggframework/frigg/pull/48) ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) + +--- + +# v0.8.10 (Thu Sep 01 2022) + +#### 🐛 Bug Fix + +- version bumped to address tag + issue [#43](https://github.com/friggframework/frigg/pull/43) ([@seanspeaks](https://github.com/seanspeaks)) +- version bumped ([@seanspeaks](https://github.com/seanspeaks)) +- Publish ([@seanspeaks](https://github.com/seanspeaks)) +- Add nx and + licenses [#37](https://github.com/friggframework/frigg/pull/37) ([@seanspeaks](https://github.com/seanspeaks)) +- MIT to all packages ([@seanspeaks](https://github.com/seanspeaks)) + +#### Authors: 1 + +- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks)) diff --git a/packages/v1-ready/pipedrive/LICENSE.md b/packages/v1-ready/pipedrive/LICENSE.md new file mode 100644 index 0000000..77f5cc2 --- /dev/null +++ b/packages/v1-ready/pipedrive/LICENSE.md @@ -0,0 +1,16 @@ +MIT License + +Copyright (c) 2022 Left Hook Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/v1-ready/pipedrive/README.md b/packages/v1-ready/pipedrive/README.md new file mode 100644 index 0000000..0ae7cf3 --- /dev/null +++ b/packages/v1-ready/pipedrive/README.md @@ -0,0 +1,6 @@ +# pipedrive + +This is the API Module for pipedrive that allows the [Frigg](https://friggframework.org) code to talk to the pipedrive +API. + +Read more on the [Frigg documentation site](https://docs.friggframework.org/api-modules/list/pipedrive \ No newline at end of file diff --git a/packages/v1-ready/pipedrive/api.js b/packages/v1-ready/pipedrive/api.js new file mode 100644 index 0000000..16f6037 --- /dev/null +++ b/packages/v1-ready/pipedrive/api.js @@ -0,0 +1,453 @@ +const { OAuth2Requester, get } = require('@friggframework/core'); + +class Api extends OAuth2Requester { + constructor(params) { + super(params); + this.baseUrl = 'https://api.pipedrive.com/api/v2'; + + // OAuth2 configuration + this.authorizationUri = 'https://oauth.pipedrive.com/oauth/authorize'; + this.tokenUri = 'https://oauth.pipedrive.com/oauth/token'; + this.client_id = get(params, 'client_id', process.env.PIPEDRIVE_CLIENT_ID); + this.client_secret = get(params, 'client_secret', process.env.PIPEDRIVE_CLIENT_SECRET); + this.redirect_uri = get(params, 'redirect_uri', process.env.PIPEDRIVE_REDIRECT_URI); + + this.URLs = { + // Activities endpoints + activities: '/activities', + activityById: (activityId) => `/activities/${activityId}`, + + // Deals endpoints + deals: '/deals', + dealById: (dealId) => `/deals/${dealId}`, + + // Products endpoints + products: '/products', + productById: (productId) => `/products/${productId}`, + + // Leads endpoints + leads: '/leads', + leadById: (leadId) => `/leads/${leadId}`, + + // Organizations endpoints + organizations: '/organizations', + organizationById: (orgId) => `/organizations/${orgId}`, + + // Persons endpoints + persons: '/persons', + personById: (personId) => `/persons/${personId}`, + + // Pipelines endpoints + pipelines: '/pipelines', + pipelineById: (pipelineId) => `/pipelines/${pipelineId}`, + + // Stages endpoints + stages: '/stages', + stageById: (stageId) => `/stages/${stageId}`, + + // Users endpoints + users: '/users', + userById: (userId) => `/users/${userId}`, + + // Search endpoints + itemSearch: '/itemSearch', + }; + } + + async getAuthorizationUri() { + return `${this.authorizationUri}?client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&response_type=code`; + } + + // Activities API methods + async getActivities(options = {}) { + const query = this._cleanParams({ + filter_id: options.filter_id, + ids: options.ids, + owner_id: options.owner_id, + deal_id: options.deal_id, + lead_id: options.lead_id, + person_id: options.person_id, + org_id: options.org_id, + done: options.done, + updated_since: options.updated_since, + updated_until: options.updated_until, + sort_by: options.sort_by || 'id', + sort_direction: options.sort_direction || 'asc', + include_fields: options.include_fields, + limit: options.limit || 100, + cursor: options.cursor + }); + + return this._get({ + url: this.baseUrl + this.URLs.activities, + query + }); + } + + async getActivityById(activityId) { + return this._get({ + url: this.baseUrl + this.URLs.activityById(activityId) + }); + } + + async createActivity(body) { + return this._post({ + url: this.baseUrl + this.URLs.activities, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updateActivity(activityId, body) { + return this._put({ + url: this.baseUrl + this.URLs.activityById(activityId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deleteActivity(activityId) { + return this._delete({ + url: this.baseUrl + this.URLs.activityById(activityId) + }); + } + + // Deals API methods + async getDeals(options = {}) { + const query = this._cleanParams({ + filter_id: options.filter_id, + ids: options.ids, + owner_id: options.owner_id, + stage_id: options.stage_id, + status: options.status, + updated_since: options.updated_since, + updated_until: options.updated_until, + sort_by: options.sort_by || 'id', + sort_direction: options.sort_direction || 'asc', + limit: options.limit || 100, + cursor: options.cursor + }); + + return this._get({ + url: this.baseUrl + this.URLs.deals, + query + }); + } + + async getDealById(dealId) { + return this._get({ + url: this.baseUrl + this.URLs.dealById(dealId) + }); + } + + async createDeal(body) { + return this._post({ + url: this.baseUrl + this.URLs.deals, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updateDeal(dealId, body) { + return this._put({ + url: this.baseUrl + this.URLs.dealById(dealId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deleteDeal(dealId) { + return this._delete({ + url: this.baseUrl + this.URLs.dealById(dealId) + }); + } + + // Products API methods + async getProducts(options = {}) { + const query = this._cleanParams({ + filter_id: options.filter_id, + ids: options.ids, + owner_id: options.owner_id, + updated_since: options.updated_since, + updated_until: options.updated_until, + sort_by: options.sort_by || 'id', + sort_direction: options.sort_direction || 'asc', + limit: options.limit || 100, + cursor: options.cursor + }); + + return this._get({ + url: this.baseUrl + this.URLs.products, + query + }); + } + + async getProductById(productId) { + return this._get({ + url: this.baseUrl + this.URLs.productById(productId) + }); + } + + async createProduct(body) { + return this._post({ + url: this.baseUrl + this.URLs.products, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updateProduct(productId, body) { + return this._put({ + url: this.baseUrl + this.URLs.productById(productId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deleteProduct(productId) { + return this._delete({ + url: this.baseUrl + this.URLs.productById(productId) + }); + } + + // Leads API methods + async getLeads(options = {}) { + const query = this._cleanParams({ + filter_id: options.filter_id, + ids: options.ids, + owner_id: options.owner_id, + updated_since: options.updated_since, + updated_until: options.updated_until, + sort_by: options.sort_by || 'id', + sort_direction: options.sort_direction || 'asc', + limit: options.limit || 100, + cursor: options.cursor + }); + + return this._get({ + url: this.baseUrl + this.URLs.leads, + query + }); + } + + async getLeadById(leadId) { + return this._get({ + url: this.baseUrl + this.URLs.leadById(leadId) + }); + } + + async createLead(body) { + return this._post({ + url: this.baseUrl + this.URLs.leads, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updateLead(leadId, body) { + return this._put({ + url: this.baseUrl + this.URLs.leadById(leadId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deleteLead(leadId) { + return this._delete({ + url: this.baseUrl + this.URLs.leadById(leadId) + }); + } + + // Organizations API methods + async getOrganizations(options = {}) { + const query = this._cleanParams({ + filter_id: options.filter_id, + ids: options.ids, + owner_id: options.owner_id, + updated_since: options.updated_since, + updated_until: options.updated_until, + sort_by: options.sort_by || 'id', + sort_direction: options.sort_direction || 'asc', + limit: options.limit || 100, + cursor: options.cursor + }); + + return this._get({ + url: this.baseUrl + this.URLs.organizations, + query + }); + } + + async getOrganizationById(orgId) { + return this._get({ + url: this.baseUrl + this.URLs.organizationById(orgId) + }); + } + + async createOrganization(body) { + return this._post({ + url: this.baseUrl + this.URLs.organizations, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updateOrganization(orgId, body) { + return this._put({ + url: this.baseUrl + this.URLs.organizationById(orgId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deleteOrganization(orgId) { + return this._delete({ + url: this.baseUrl + this.URLs.organizationById(orgId) + }); + } + + // Persons API methods + async getPersons(options = {}) { + const query = this._cleanParams({ + filter_id: options.filter_id, + ids: options.ids, + owner_id: options.owner_id, + org_id: options.org_id, + updated_since: options.updated_since, + updated_until: options.updated_until, + sort_by: options.sort_by || 'id', + sort_direction: options.sort_direction || 'asc', + limit: options.limit || 100, + cursor: options.cursor + }); + + return this._get({ + url: this.baseUrl + this.URLs.persons, + query + }); + } + + async getPersonById(personId) { + return this._get({ + url: this.baseUrl + this.URLs.personById(personId) + }); + } + + async createPerson(body) { + return this._post({ + url: this.baseUrl + this.URLs.persons, + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updatePerson(personId, body) { + return this._put({ + url: this.baseUrl + this.URLs.personById(personId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deletePerson(personId) { + return this._delete({ + url: this.baseUrl + this.URLs.personById(personId) + }); + } + + // Pipelines API methods + async getPipelines(options = {}) { + const query = this._cleanParams(options); + return this._get({ + url: this.baseUrl + this.URLs.pipelines, + query + }); + } + + async getPipelineById(pipelineId) { + return this._get({ + url: this.baseUrl + this.URLs.pipelineById(pipelineId) + }); + } + + // Stages API methods + async getStages(options = {}) { + const query = this._cleanParams(options); + return this._get({ + url: this.baseUrl + this.URLs.stages, + query + }); + } + + async getStageById(stageId) { + return this._get({ + url: this.baseUrl + this.URLs.stageById(stageId) + }); + } + + // Users API methods + async getUsers(options = {}) { + const query = this._cleanParams(options); + return this._get({ + url: this.baseUrl + this.URLs.users, + query + }); + } + + async getUserById(userId) { + return this._get({ + url: this.baseUrl + this.URLs.userById(userId) + }); + } + + async getCurrentUser() { + const users = await this.getUsers(); + return users.data && users.data.length > 0 ? users.data[0] : null; + } + + // Search API methods + async search(options = {}) { + const query = this._cleanParams(options); + return this._get({ + url: this.baseUrl + this.URLs.itemSearch, + query + }); + } + + // Helper methods + _cleanParams(params) { + const cleaned = {}; + Object.keys(params).forEach(key => { + if (params[key] !== undefined && params[key] !== null) { + cleaned[key] = params[key]; + } + }); + return cleaned; + } +} + +module.exports = { Api }; diff --git a/packages/v1-ready/pipedrive/defaultConfig.json b/packages/v1-ready/pipedrive/defaultConfig.json new file mode 100644 index 0000000..3485c8a --- /dev/null +++ b/packages/v1-ready/pipedrive/defaultConfig.json @@ -0,0 +1,11 @@ +{ + "name": "pipedrive", + "label": "PipeDrive CRM", + "productUrl": "https://pipedrive.com", + "apiDocs": "https://developer.pipedrive.com", + "logoUrl": "https://friggframework.org/assets/img/pipedrive-icon.png", + "categories": [ + "Sales" + ], + "description": "Pipedrive" +} diff --git a/packages/v1-ready/pipedrive/definition.js b/packages/v1-ready/pipedrive/definition.js new file mode 100644 index 0000000..35d9590 --- /dev/null +++ b/packages/v1-ready/pipedrive/definition.js @@ -0,0 +1,54 @@ +require('dotenv').config(); +const { Api } = require('./api'); +const { get } = require('@friggframework/core'); +const config = require('./defaultConfig.json'); + +const Definition = { + API: Api, + getName: function () { + return config.name; + }, + moduleName: config.name, + modelName: 'Pipedrive', + requiredAuthMethods: { + getAuthorizationRequirements: async function (params) { + return { + url: await this.api.getAuthUri(), + type: 'oauth2', + }; + }, + getToken: async function (api, params) { + const code = get(params.data, 'code'); + return api.getTokenFromCode(code); + }, + getEntityDetails: async function (api, callbackParams, tokenResponse, userId) { + const userDetails = await api.getUser(); + return { + identifiers: { externalId: userDetails.data.id, user: userId }, + details: { name: userDetails.data.name || userDetails.data.email } + }; + }, + apiPropertiesToPersist: { + credential: ['access_token', 'refresh_token', 'companyDomain'], + entity: [] + }, + getCredentialDetails: async function (api, userId) { + const userDetails = await api.getUser(); + return { + identifiers: { externalId: userDetails.data.id, user: userId }, + details: {} + }; + }, + testAuthRequest: async function (api) { + return api.getUser(); + } + }, + env: { + client_id: process.env.PIPEDRIVE_CLIENT_ID, + client_secret: process.env.PIPEDRIVE_CLIENT_SECRET, + scope: process.env.PIPEDRIVE_SCOPE, + redirect_uri: `${process.env.REDIRECT_URI}/pipedrive` + } +}; + +module.exports = { Definition }; \ No newline at end of file diff --git a/packages/v1-ready/pipedrive/index.js b/packages/v1-ready/pipedrive/index.js new file mode 100644 index 0000000..13b0c76 --- /dev/null +++ b/packages/v1-ready/pipedrive/index.js @@ -0,0 +1,13 @@ +const {Api} = require('./api'); +const {Credential} = require('./models/credential'); +const {Entity} = require('./models/entity'); +const ModuleManager = require('./manager'); +const Config = require('./defaultConfig'); + +module.exports = { + Api, + Credential, + Entity, + ModuleManager, + Config, +}; diff --git a/packages/v1-ready/pipedrive/jest-setup.js b/packages/v1-ready/pipedrive/jest-setup.js new file mode 100644 index 0000000..9dd3e0d --- /dev/null +++ b/packages/v1-ready/pipedrive/jest-setup.js @@ -0,0 +1,2 @@ +const {globalSetup} = require('@friggframework/test'); +module.exports = globalSetup; diff --git a/packages/v1-ready/pipedrive/jest-teardown.js b/packages/v1-ready/pipedrive/jest-teardown.js new file mode 100644 index 0000000..5bc7251 --- /dev/null +++ b/packages/v1-ready/pipedrive/jest-teardown.js @@ -0,0 +1,2 @@ +const {globalTeardown} = require('@friggframework/test'); +module.exports = globalTeardown; diff --git a/packages/v1-ready/pipedrive/jest.config.js b/packages/v1-ready/pipedrive/jest.config.js new file mode 100644 index 0000000..48f9fcc --- /dev/null +++ b/packages/v1-ready/pipedrive/jest.config.js @@ -0,0 +1,20 @@ +/* + * For a detailed explanation regarding each configuration property, visit: + * https://jestjs.io/docs/configuration + */ +module.exports = { + // preset: '@friggframework/test-environment', + coverageThreshold: { + global: { + statements: 13, + branches: 0, + functions: 1, + lines: 13, + }, + }, + // A path to a module which exports an async function that is triggered once before all test suites + globalSetup: './jest-setup.js', + + // A path to a module which exports an async function that is triggered once after all test suites + globalTeardown: './jest-teardown.js', +}; diff --git a/packages/v1-ready/pipedrive/manager.js b/packages/v1-ready/pipedrive/manager.js new file mode 100644 index 0000000..eef514c --- /dev/null +++ b/packages/v1-ready/pipedrive/manager.js @@ -0,0 +1,193 @@ +const { + ModuleManager, + ModuleConstants, + flushDebugLog, + debug +} = require('@friggframework/core'); +const {Api} = require('./api.js'); +const {Entity} = require('./models/entity'); +const {Credential} = require('./models/credential'); +const Config = require('./defaultConfig.json'); + +class Manager extends ModuleManager { + static + Entity = Entity; + + static + Credential = Credential; + + constructor(params) { + super(params); + } + + static getName() { + return Config.name; + } + + static + async getInstance(params) { + const instance = new this(params); + + const apiParams = {delegate: instance}; + if (params.entityId) { + instance.entity = await instance.entityMO.get(params.entityId); + instance.credential = await instance.credentialMO.get( + instance.entity.credential + ); + } else if (params.credentialId) { + instance.credential = await instance.credentialMO.get( + params.credentialId + ); + } + if (instance.entity?.credential) { + apiParams.access_token = instance.credential.accessToken; + apiParams.refresh_token = instance.credential.refreshToken; + apiParams.companyDomain = instance.credential.companyDomain; + } + instance.api = await new Api(apiParams); + + return instance; + } + + async getAuthorizationRequirements(params) { + return { + url: this.api.authorizationUri, + type: ModuleConstants.authType.oauth2, + }; + } + + async testAuth() { + let validAuth = false; + try { + if (await this.api.getUser()) validAuth = true; + } catch (e) { + await this.markCredentialsInvalid(); + flushDebugLog(e); + } + return validAuth; + } + + async processAuthorizationCallback(params) { + const code = get(params.data, 'code'); + await this.api.getTokenFromCode(code); + await this.testAuth(); + + const userProfile = await this.api.getUser(); + await this.findOrCreateEntity({ + companyId: userProfile.data.company_id, + companyName: userProfile.data.company_name, + }); + + return { + credential_id: this.credential.id, + entity_id: this.entity.id, + type: Manager.getName(), + }; + } + + async findOrCreateEntity(params) { + const companyId = get(params, 'companyId'); + const companyName = get(params, 'companyName'); + + const search = await this.entityMO.list({ + user: this.userId, + externalId: companyId, + }); + if (search.length === 0) { + // validate choices!!! + // create entity + const createObj = { + credential: this.credential.id, + user: this.userId, + name: companyName, + externalId: companyId, + }; + this.entity = await this.entityMO.create(createObj); + } else if (search.length === 1) { + this.entity = search[0]; + } else { + debug( + 'Multiple entities found with the same Company ID:', + companyId + ); + } + + return { + entity_id: this.entity.id, + }; + } + + async deauthorize() { + this.api = new Api(); + + const entity = await this.entityMO.getByUserId(this.userId); + if (entity.credential) { + await this.credentialMO.delete(entity.credential); + entity.credential = undefined; + await entity.save(); + } + } + + async receiveNotification(notifier, delegateString, object = null) { + if (notifier instanceof Api) { + if (delegateString === this.api.DLGT_TOKEN_UPDATE) { + const userProfile = await this.api.getUser(); + const pipedriveUserId = userProfile.data.id; + const updatedToken = { + user: this.userId, + accessToken: this.api.access_token, + refreshToken: this.api.refresh_token, + accessTokenExpire: this.api.accessTokenExpire, + externalId: pipedriveUserId, + companyDomain: object.api_domain, + auth_is_valid: true, + }; + + if (!this.credential) { + let credentialSearch = await this.credentialMO.list({ + externalId: pipedriveUserId, + }); + if (credentialSearch.length === 0) { + this.credential = await this.credentialMO.create( + updatedToken + ); + } else if (credentialSearch.length === 1) { + if ( + credentialSearch[0].user.toString() === + this.userId.toString() + ) { + this.credential = await this.credentialMO.update( + credentialSearch[0], + updatedToken + ); + } else { + debug( + 'Somebody else already created a credential with the same User ID:', + pipedriveUserId + ); + } + } else { + // Handling multiple credentials found with an error for the time being + debug( + 'Multiple credentials found with the same User ID:', + pipedriveUserId + ); + } + } else { + this.credential = await this.credentialMO.update( + this.credential, + updatedToken + ); + } + } + if (delegateString === this.api.DLGT_TOKEN_DEAUTHORIZED) { + await this.deauthorize(); + } + if (delegateString === this.api.DLGT_INVALID_AUTH) { + await this.markCredentialsInvalid(); + } + } + } +} + +module.exports = Manager; diff --git a/packages/v1-ready/pipedrive/manager.test.js b/packages/v1-ready/pipedrive/manager.test.js new file mode 100644 index 0000000..b4c8e08 --- /dev/null +++ b/packages/v1-ready/pipedrive/manager.test.js @@ -0,0 +1,26 @@ +const Manager = require('./manager'); +const mongoose = require('mongoose'); +const config = require('./defaultConfig.json'); + +describe(`Should fully test the ${config.label} Manager`, () => { + let manager, userManager; + + beforeAll(async () => { + await mongoose.connect(process.env.MONGO_URI); + manager = await Manager.getInstance({ + userId: new mongoose.Types.ObjectId(), + }); + }); + + afterAll(async () => { + await Manager.Credential.deleteMany(); + await Manager.Entity.deleteMany(); + await mongoose.disconnect(); + }); + + it('should return auth requirements', async () => { + const requirements = await manager.getAuthorizationRequirements(); + expect(requirements).exists; + expect(requirements.type).toEqual('oauth2'); + }); +}); diff --git a/packages/v1-ready/pipedrive/mocks/activities/createActivity.js b/packages/v1-ready/pipedrive/mocks/activities/createActivity.js new file mode 100644 index 0000000..01b3508 --- /dev/null +++ b/packages/v1-ready/pipedrive/mocks/activities/createActivity.js @@ -0,0 +1,172 @@ +module.exports = { + data: { + type: 'task', + id: 31, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-11-06T02:52:48.000Z', + dueAt: '2021-11-06T02:52:48.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-11-06T02:52:48.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=31', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=31', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/31', + }, + }, +}; diff --git a/packages/v1-ready/pipedrive/mocks/activities/deleteActivity.js b/packages/v1-ready/pipedrive/mocks/activities/deleteActivity.js new file mode 100644 index 0000000..26c393f --- /dev/null +++ b/packages/v1-ready/pipedrive/mocks/activities/deleteActivity.js @@ -0,0 +1,3 @@ +module.exports = { + status: 204, +}; diff --git a/packages/v1-ready/pipedrive/mocks/activities/listActivities.js b/packages/v1-ready/pipedrive/mocks/activities/listActivities.js new file mode 100644 index 0000000..57d5c9c --- /dev/null +++ b/packages/v1-ready/pipedrive/mocks/activities/listActivities.js @@ -0,0 +1,1538 @@ +module.exports = { + data: [ + { + type: 'task', + id: 1, + attributes: { + action: 'action_item', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-21T18:49:12.000Z', + dueAt: '2021-10-21T18:49:03.000Z', + note: 'Do it you will', + opportunityAssociation: 'recent_created', + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-21T18:49:12.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 12, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=1', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=1', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=1', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=1', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=1', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=1', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 12, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 4, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/1', + }, + }, + { + type: 'task', + id: 2, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-29T15:00:56.000Z', + dueAt: '2021-10-29T15:00:56.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-29T15:00:56.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=2', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=2', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=2', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=2', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=2', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=2', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/2', + }, + }, + { + type: 'task', + id: 3, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-29T15:10:21.000Z', + dueAt: '2021-10-29T15:10:21.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-29T15:10:21.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=3', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=3', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=3', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=3', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=3', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=3', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/3', + }, + }, + { + type: 'task', + id: 4, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-29T15:10:32.000Z', + dueAt: '2021-10-29T15:10:32.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-29T15:10:32.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=4', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=4', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=4', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=4', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=4', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=4', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/4', + }, + }, + { + type: 'task', + id: 5, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-29T15:10:53.000Z', + dueAt: '2021-10-29T15:10:53.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-29T15:10:53.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=5', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=5', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=5', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=5', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=5', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=5', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/5', + }, + }, + { + type: 'task', + id: 6, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-29T15:11:07.000Z', + dueAt: '2021-10-29T15:11:07.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-29T15:14:35.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 3, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=6', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=6', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=6', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=6', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=6', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=6', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 3, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/6', + }, + }, + { + type: 'task', + id: 7, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-29T16:05:44.000Z', + dueAt: '2021-10-29T16:05:44.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-29T16:05:44.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=7', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=7', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=7', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=7', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=7', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=7', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/7', + }, + }, + { + type: 'task', + id: 8, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-10-29T17:27:05.000Z', + dueAt: '2021-10-29T17:27:05.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-10-29T17:27:05.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=8', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=8', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=8', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=8', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=8', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=8', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/8', + }, + }, + { + type: 'task', + id: 31, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-11-06T02:52:48.000Z', + dueAt: '2021-11-06T02:52:48.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-11-06T02:52:48.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 1, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=31', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=31', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 1, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/31', + }, + }, + ], + meta: { + count: 9, + count_truncated: false, + }, +}; diff --git a/packages/v1-ready/pipedrive/mocks/activities/updateActivity.js b/packages/v1-ready/pipedrive/mocks/activities/updateActivity.js new file mode 100644 index 0000000..d8657fb --- /dev/null +++ b/packages/v1-ready/pipedrive/mocks/activities/updateActivity.js @@ -0,0 +1,172 @@ +module.exports = { + data: { + type: 'task', + id: 31, + attributes: { + action: 'email', + autoskipAt: null, + compiledSequenceTemplateHtml: null, + completed: false, + completedAt: null, + createdAt: '2021-11-06T02:52:48.000Z', + dueAt: '2021-11-06T02:52:48.000Z', + note: null, + opportunityAssociation: null, + scheduledAt: null, + state: 'incomplete', + stateChangedAt: null, + taskType: 'manual', + updatedAt: '2021-11-06T03:04:55.000Z', + }, + relationships: { + account: { + data: { + type: 'account', + id: 3, + }, + }, + call: { + data: null, + }, + calls: { + links: { + related: + 'https://api.pipedrive.io/api/v2/calls?filter%5Btask%5D%5Bid%5D=31', + }, + }, + completer: { + data: null, + }, + creator: { + data: { + type: 'user', + id: 1, + }, + }, + defaultPluginMapping: { + data: null, + }, + mailing: { + data: null, + }, + mailings: { + links: { + related: + 'https://api.pipedrive.io/api/v2/mailings?filter%5Btask%5D%5Bid%5D=31', + }, + }, + opportunity: { + data: null, + }, + owner: { + data: { + type: 'user', + id: 1, + }, + }, + prospect: { + data: null, + }, + prospectAccount: { + data: null, + }, + prospectContacts: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/emailAddresses?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + prospectOwner: { + data: null, + }, + prospectPhoneNumbers: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/phoneNumbers?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + prospectStage: { + data: null, + }, + sequence: { + data: null, + }, + sequenceSequenceSteps: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/sequenceSteps?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + sequenceState: { + data: null, + }, + sequenceStateSequenceStep: { + data: null, + }, + sequenceStateSequenceStepOverrides: { + data: [], + meta: { + count: 0, + }, + }, + sequenceStateStartingTemplate: { + data: null, + }, + sequenceStep: { + data: null, + }, + sequenceStepOverrideTemplates: { + data: [], + links: { + related: + 'https://api.pipedrive.io/api/v2/templates?filter%5Btask%5D%5Bid%5D=31', + }, + meta: { + count: 0, + }, + }, + sequenceTemplate: { + data: null, + }, + sequenceTemplateTemplate: { + data: null, + }, + subject: { + data: { + type: 'account', + id: 3, + }, + }, + taskPriority: { + data: { + type: 'taskPriority', + id: 3, + }, + }, + taskTheme: { + data: { + type: 'taskTheme', + id: 1, + }, + }, + template: { + data: null, + }, + }, + links: { + self: 'https://api.pipedrive.io/api/v2/tasks/31', + }, + }, +}; diff --git a/packages/v1-ready/pipedrive/mocks/apiMock.js b/packages/v1-ready/pipedrive/mocks/apiMock.js new file mode 100644 index 0000000..e92c85f --- /dev/null +++ b/packages/v1-ready/pipedrive/mocks/apiMock.js @@ -0,0 +1,30 @@ +class MockApi { + constructor() { + } + + /** * Deals ** */ + + async listDeals() { + return require('./deals/listDeals'); + } + + /** * Activities ** */ + + async createActivity() { + return require('./activities/createActivity'); + } + + async listActivities() { + return require('./activities/listActivities'); + } + + async deleteActivity() { + return require('./activities/deleteActivity'); + } + + async updateActivity() { + return require('./activities/updateActivity'); + } +} + +module.exports = MockApi; diff --git a/packages/v1-ready/pipedrive/mocks/deals/listDeals.js b/packages/v1-ready/pipedrive/mocks/deals/listDeals.js new file mode 100644 index 0000000..2555ad6 --- /dev/null +++ b/packages/v1-ready/pipedrive/mocks/deals/listDeals.js @@ -0,0 +1,236 @@ +module.exports = { + success: true, + data: [ + { + id: 1, + creator_user_id: { + id: 1811658, + name: 'Tom Elliott', + email: 'projectteam@lefthook.co', + has_pic: 1, + pic_hash: 'de38c66276cb325d7c0e84d4fae1f0ce', + active_flag: true, + value: 1811658, + }, + user_id: { + id: 1811658, + name: 'Tom Elliott', + email: 'projectteam@lefthook.co', + has_pic: 1, + pic_hash: 'de38c66276cb325d7c0e84d4fae1f0ce', + active_flag: true, + value: 1811658, + }, + person_id: { + active_flag: true, + name: 'Example Person', + email: [ + { + value: '', + primary: true, + }, + ], + phone: [ + { + value: '', + primary: true, + }, + ], + owner_id: 1811658, + value: 1, + }, + org_id: null, + stage_id: 1, + title: 'Example Person deal', + value: 0, + currency: 'USD', + add_time: '2020-07-06 19:08:03', + update_time: '2020-07-06 19:08:03', + stage_change_time: null, + active: true, + deleted: false, + status: 'open', + probability: null, + next_activity_date: null, + next_activity_time: null, + next_activity_id: null, + last_activity_id: null, + last_activity_date: null, + lost_reason: null, + visible_to: '3', + close_time: null, + pipeline_id: 1, + won_time: null, + first_won_time: null, + lost_time: null, + products_count: 0, + files_count: 0, + notes_count: 0, + followers_count: 1, + email_messages_count: 0, + activities_count: 0, + done_activities_count: 0, + undone_activities_count: 0, + participants_count: 1, + expected_close_date: null, + last_incoming_mail_time: null, + last_outgoing_mail_time: null, + label: null, + renewal_type: 'one_time', + stage_order_nr: 1, + person_name: 'Example Person', + org_name: null, + next_activity_subject: null, + next_activity_type: null, + next_activity_duration: null, + next_activity_note: null, + group_id: null, + group_name: null, + formatted_value: '$0', + weighted_value: 0, + formatted_weighted_value: '$0', + weighted_value_currency: 'USD', + rotten_time: null, + owner_name: 'Tom Elliott', + cc_email: 'lefthook-sandbox-41e8b7+deal1@pipedrivemail.com', + org_hidden: false, + person_hidden: false, + }, + { + id: 2, + creator_user_id: { + id: 1811658, + name: 'Tom Elliott', + email: 'projectteam@lefthook.co', + has_pic: 1, + pic_hash: 'de38c66276cb325d7c0e84d4fae1f0ce', + active_flag: true, + value: 1811658, + }, + user_id: { + id: 1811658, + name: 'Tom Elliott', + email: 'projectteam@lefthook.co', + has_pic: 1, + pic_hash: 'de38c66276cb325d7c0e84d4fae1f0ce', + active_flag: true, + value: 1811658, + }, + person_id: null, + org_id: { + name: 'Left Hook', + people_count: 0, + owner_id: 1811658, + address: null, + active_flag: true, + cc_email: 'lefthook-sandbox-41e8b7@pipedrivemail.com', + value: 1, + }, + stage_id: 1, + title: 'New Deal gotta find person', + value: 0, + currency: 'USD', + add_time: '2021-11-19 19:14:43', + update_time: '2021-11-19 19:14:43', + stage_change_time: null, + active: true, + deleted: false, + status: 'open', + probability: null, + next_activity_date: null, + next_activity_time: null, + next_activity_id: null, + last_activity_id: null, + last_activity_date: null, + lost_reason: null, + visible_to: '3', + close_time: null, + pipeline_id: 1, + won_time: null, + first_won_time: null, + lost_time: null, + products_count: 0, + files_count: 0, + notes_count: 0, + followers_count: 1, + email_messages_count: 0, + activities_count: 0, + done_activities_count: 0, + undone_activities_count: 0, + participants_count: 0, + expected_close_date: null, + last_incoming_mail_time: null, + last_outgoing_mail_time: null, + label: null, + renewal_type: 'one_time', + stage_order_nr: 1, + person_name: null, + org_name: 'Left Hook', + next_activity_subject: null, + next_activity_type: null, + next_activity_duration: null, + next_activity_note: null, + group_id: null, + group_name: null, + formatted_value: '$0', + weighted_value: 0, + formatted_weighted_value: '$0', + weighted_value_currency: 'USD', + rotten_time: null, + owner_name: 'Tom Elliott', + cc_email: 'lefthook-sandbox-41e8b7+deal2@pipedrivemail.com', + org_hidden: false, + person_hidden: false, + }, + ], + additional_data: { + pagination: { + start: 0, + limit: 100, + more_items_in_collection: false, + }, + }, + related_objects: { + user: { + 1811658: { + id: 1811658, + name: 'Tom Elliott', + email: 'projectteam@lefthook.co', + has_pic: 1, + pic_hash: 'de38c66276cb325d7c0e84d4fae1f0ce', + active_flag: true, + }, + }, + person: { + 1: { + active_flag: true, + id: 1, + name: 'Example Person', + email: [ + { + value: '', + primary: true, + }, + ], + phone: [ + { + value: '', + primary: true, + }, + ], + owner_id: 1811658, + }, + }, + organization: { + 1: { + id: 1, + name: 'Left Hook', + people_count: 0, + owner_id: 1811658, + address: null, + active_flag: true, + cc_email: 'lefthook-sandbox-41e8b7@pipedrivemail.com', + }, + }, + }, +}; diff --git a/packages/v1-ready/pipedrive/models/credential.js b/packages/v1-ready/pipedrive/models/credential.js new file mode 100644 index 0000000..29afde1 --- /dev/null +++ b/packages/v1-ready/pipedrive/models/credential.js @@ -0,0 +1,21 @@ +const {Credential: Parent} = require('@friggframework/core'); +const mongoose = require('mongoose'); + +const schema = new mongoose.Schema({ + accessToken: { + type: String, + trim: true, + lhEncrypt: true, + }, + refreshToken: { + type: String, + trim: true, + lhEncrypt: true, + }, + companyDomain: {type: String}, +}); + +const name = 'PipedriveCredential'; +const Credential = + Parent.discriminators?.[name] || Parent.discriminator(name, schema); +module.exports = {Credential}; diff --git a/packages/v1-ready/pipedrive/models/entity.js b/packages/v1-ready/pipedrive/models/entity.js new file mode 100644 index 0000000..6e02de8 --- /dev/null +++ b/packages/v1-ready/pipedrive/models/entity.js @@ -0,0 +1,9 @@ +const {Entity: Parent} = require('@friggframework/core'); +'use strict'; +const mongoose = require('mongoose'); + +const schema = new mongoose.Schema({}); +const name = 'PipedriveEntity'; +const Entity = + Parent.discriminators?.[name] || Parent.discriminator(name, schema); +module.exports = {Entity}; diff --git a/packages/v1-ready/pipedrive/package.json b/packages/v1-ready/pipedrive/package.json new file mode 100644 index 0000000..4caf5bd --- /dev/null +++ b/packages/v1-ready/pipedrive/package.json @@ -0,0 +1,26 @@ +{ + "name": "@friggframework/api-module-pipedrive", + "version": "1.0.0", + "description": "Pipedrive CRM API module for Frigg Framework", + "main": "index.js", + "scripts": { + "test": "jest --passWithNoTests" + }, + "keywords": [ + "frigg", + "api", + "pipedrive", + "crm", + "sales" + ], + "author": "Frigg Framework Team", + "license": "MIT", + "dependencies": { + "@friggframework/core": "^2.0.0-next.24", + "@friggframework/devtools": "^2.0.0-next.24", + "dotenv": "^16.0.0" + }, + "devDependencies": { + "jest": "^29.0.0" + } +} diff --git a/packages/v1-ready/pipedrive/specs/openAPI.yaml b/packages/v1-ready/pipedrive/specs/openAPI.yaml new file mode 100644 index 0000000..e0370d5 --- /dev/null +++ b/packages/v1-ready/pipedrive/specs/openAPI.yaml @@ -0,0 +1,11129 @@ +openapi: 3.0.1 +info: + title: Pipedrive API v2 + version: 2.0.0 +servers: + - url: 'https://api.pipedrive.com/api/v2' +tags: + - name: Activities + description: | + Activities are appointments/tasks/events on a calendar that can be associated with a deal, a lead, a person and an organization. Activities can be of different type (such as call, meeting, lunch or a custom type - see ActivityTypes object) and can be assigned to a particular user. Note that activities can also be created without a specific date/time. + - name: Deals + description: | + Deals represent ongoing, lost or won sales to an organization or to a person. Each deal has a monetary value and must be placed in a stage. Deals can be owned by a user, and followed by one or many users. Each deal consists of standard data fields but can also contain a number of custom fields. The custom fields can be recognized by long hashes as keys. These hashes can be mapped against `DealField.key`. The corresponding label for each such custom field can be obtained from `DealField.name`. + - name: Products + description: | + Products are the goods or services you are dealing with. Each product can have N different price points - firstly, each product can have a price in N different currencies, and secondly, each product can have N variations of itself, each having N prices in different currencies. Note that only one price per variation per currency is supported. Products can be instantiated to deals. In the context of instatiation, a custom price, quantity and discount can be applied. + - name: Leads + description: | + Leads are potential deals stored in Leads Inbox before they are archived or converted to a deal. Each lead needs to be named (using the `title` field) and be linked to a person or an organization. In addition to that, a lead can contain most of the fields a deal can (such as `value` or `expected_close_date`). + - name: Organizations + description: | + Organizations are companies and other kinds of organizations you are making deals with. Persons can be associated with organizations so that each organization can contain one or more persons. + - name: Persons + description: | + Persons are your contacts, the customers you are doing deals with. Each person can belong to an organization. Persons should not be confused with users. + - name: ItemSearch + description: | + Ordered reference objects, pointing to either deals, persons, organizations, leads, products, files or mail attachments. + - name: Stages + description: | + Stage is a logical component of a pipeline, and essentially a bucket that can hold a number of deals. In the context of the pipeline a stage belongs to, it has an order number which defines the order of stages in that pipeline. + - name: Pipelines + description: | + Pipelines are essentially ordered collections of stages. +paths: + /activities: + get: + summary: Get all activities + description: Returns data about all activities. + x-token-cost: 10 + operationId: getActivities + tags: + - Activities + security: + - api_key: [] + - oauth2: + - 'activities:read' + - 'activities:full' + parameters: + - in: query + name: filter_id + schema: + type: integer + description: 'If supplied, only activities matching the specified filter are returned' + - in: query + name: ids + description: 'Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.' + schema: + type: string + - in: query + name: owner_id + schema: + type: integer + description: 'If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored.' + - in: query + name: deal_id + schema: + type: integer + description: 'If supplied, only activities linked to the specified deal are returned. If filter_id is provided, this is ignored.' + - in: query + name: lead_id + schema: + type: string + description: 'If supplied, only activities linked to the specified lead are returned. If filter_id is provided, this is ignored.' + - in: query + name: person_id + schema: + type: integer + description: 'If supplied, only activities whose primary participant is the given person are returned. If filter_id is provided, this is ignored.' + - in: query + name: org_id + schema: + type: integer + description: 'If supplied, only activities linked to the specified organization are returned. If filter_id is provided, this is ignored.' + - in: query + name: done + schema: + type: boolean + description: 'If supplied, only activities with specified ''done'' flag value are returned' + - in: query + name: updated_since + schema: + type: string + description: 'If set, only activities with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: updated_until + schema: + type: string + description: 'If set, only activities with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `due_date`.' + schema: + type: string + default: id + enum: + - id + - update_time + - add_time + - due_date + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include + schema: + type: string + enum: + - attendees + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Get all activities + content: + application/json: + schema: + type: object + title: GetActivitiesResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Activities array + items: + type: object + title: ActivityItem + properties: + id: + type: integer + description: The ID of the activity + subject: + type: string + description: The subject of the activity + type: + type: string + description: The type of the activity + owner_id: + type: integer + description: The ID of the user who owns the activity + creator_user_id: + type: integer + description: The ID of the user who created the activity + is_deleted: + type: boolean + description: Whether the activity is deleted or not + add_time: + type: string + description: The creation date and time of the activity + update_time: + type: string + description: The last updated date and time of the activity + deal_id: + type: integer + description: The ID of the deal linked to the activity + lead_id: + type: string + description: The ID of the lead linked to the activity + person_id: + type: integer + description: The ID of the person linked to the activity + org_id: + type: integer + description: The ID of the organization linked to the activity + project_id: + type: integer + description: The ID of the project linked to the activity + due_date: + type: string + description: The due date of the activity + due_time: + type: string + description: The due time of the activity + duration: + type: string + description: The duration of the activity + busy: + type: boolean + description: Whether the activity marks the assignee as busy or not in their calendar + done: + type: boolean + description: Whether the activity is marked as done or not + marked_as_done_time: + type: string + description: The date and time when the activity was marked as done + location: + type: object + description: Location of the activity + properties: + value: + type: string + description: The full address of the activity + country: + type: string + description: Country of the activity + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the activity + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the activity + locality: + type: string + description: Locality (e.g. city) of the activity + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the activity + route: + type: string + description: Route (e.g. street) of the activity + street_number: + type: string + description: Street number of the activity + postal_code: + type: string + description: Postal code of the activity + participants: + type: array + description: The participants of the activity + items: + type: object + properties: + person_id: + type: integer + description: The ID of the person + primary: + type: boolean + description: Whether the person is the primary participant or not + attendees: + type: array + description: The attendees of the activity + items: + type: object + properties: + email: + type: string + description: The email address of the attendee + name: + type: string + description: The name of the attendee + status: + type: string + description: The status of the attendee + is_organizer: + type: boolean + description: Whether the attendee is the organizer or not + person_id: + type: integer + description: The ID of the person if the attendee has a person record + user_id: + type: integer + description: The ID of the user if the attendee is a user + conference_meeting_client: + type: string + description: The client used for the conference meeting + conference_meeting_url: + type: string + description: The URL of the conference meeting + conference_meeting_id: + type: string + description: The ID of the conference meeting + public_description: + type: string + description: The public description of the activity + priority: + type: integer + description: The priority of the activity. Mappable to a specific string using activityFields API. + note: + type: string + description: The note of the activity + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + subject: Activity Subject + type: activity_type + owner_id: 1 + creator_user_id: 1 + is_deleted: false + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + deal_id: 5 + lead_id: abc-def + person_id: 6 + org_id: 7 + project_id: 8 + due_date: '2021-01-01' + due_time: '15:00:00' + duration: '01:00:00' + busy: true + done: true + marked_as_done_time: '2021-01-01T00:00:00Z' + location: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + participants: + - person_id: 1 + primary: true + attendees: + - email: some@email.com + name: Some Name + status: accepted + is_organizer: true + person_id: 1 + user_id: 1 + conference_meeting_client: google_meet + conference_meeting_url: 'https://meet.google.com/abc-xyz' + conference_meeting_id: abc-xyz + public_description: Public Description + priority: 263 + note: Note + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a new activity + description: Adds a new activity. + x-token-cost: 5 + operationId: addActivity + tags: + - Activities + security: + - api_key: [] + - oauth2: + - 'activities:full' + requestBody: + content: + application/json: + schema: + type: object + properties: + subject: + type: string + description: The subject of the activity + type: + type: string + description: The type of the activity + owner_id: + type: integer + description: The ID of the user who owns the activity + deal_id: + type: integer + description: The ID of the deal linked to the activity + lead_id: + type: string + description: The ID of the lead linked to the activity + person_id: + type: integer + description: The ID of the person linked to the activity + org_id: + type: integer + description: The ID of the organization linked to the activity + project_id: + type: integer + description: The ID of the project linked to the activity + due_date: + type: string + description: The due date of the activity + due_time: + type: string + description: The due time of the activity + duration: + type: string + description: The duration of the activity + busy: + type: boolean + description: Whether the activity marks the assignee as busy or not in their calendar + done: + type: boolean + description: Whether the activity is marked as done or not + location: + type: object + description: Location of the activity + properties: + value: + type: string + description: The full address of the activity + country: + type: string + description: Country of the activity + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the activity + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the activity + locality: + type: string + description: Locality (e.g. city) of the activity + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the activity + route: + type: string + description: Route (e.g. street) of the activity + street_number: + type: string + description: Street number of the activity + postal_code: + type: string + description: Postal code of the activity + participants: + type: array + description: The participants of the activity + items: + type: object + properties: + person_id: + type: integer + description: The ID of the person + primary: + type: boolean + description: Whether the person is the primary participant or not + attendees: + type: array + description: The attendees of the activity + items: + type: object + properties: + email: + type: string + description: The email address of the attendee + name: + type: string + description: The name of the attendee + status: + type: string + description: The status of the attendee + is_organizer: + type: boolean + description: Whether the attendee is the organizer or not + person_id: + type: integer + description: The ID of the person if the attendee has a person record + user_id: + type: integer + description: The ID of the user if the attendee is a user + public_description: + type: string + description: The public description of the activity + priority: + type: integer + description: The priority of the activity. Mappable to a specific string using activityFields API. + note: + type: string + description: The note of the activity + responses: + '200': + description: Add activity + content: + application/json: + schema: + type: object + title: UpsertActivityResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertActivityResponseData + properties: + data: + type: object + title: ActivityItem + properties: + id: + type: integer + description: The ID of the activity + subject: + type: string + description: The subject of the activity + type: + type: string + description: The type of the activity + owner_id: + type: integer + description: The ID of the user who owns the activity + creator_user_id: + type: integer + description: The ID of the user who created the activity + is_deleted: + type: boolean + description: Whether the activity is deleted or not + add_time: + type: string + description: The creation date and time of the activity + update_time: + type: string + description: The last updated date and time of the activity + deal_id: + type: integer + description: The ID of the deal linked to the activity + lead_id: + type: string + description: The ID of the lead linked to the activity + person_id: + type: integer + description: The ID of the person linked to the activity + org_id: + type: integer + description: The ID of the organization linked to the activity + project_id: + type: integer + description: The ID of the project linked to the activity + due_date: + type: string + description: The due date of the activity + due_time: + type: string + description: The due time of the activity + duration: + type: string + description: The duration of the activity + busy: + type: boolean + description: Whether the activity marks the assignee as busy or not in their calendar + done: + type: boolean + description: Whether the activity is marked as done or not + marked_as_done_time: + type: string + description: The date and time when the activity was marked as done + location: + type: object + description: Location of the activity + properties: + value: + type: string + description: The full address of the activity + country: + type: string + description: Country of the activity + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the activity + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the activity + locality: + type: string + description: Locality (e.g. city) of the activity + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the activity + route: + type: string + description: Route (e.g. street) of the activity + street_number: + type: string + description: Street number of the activity + postal_code: + type: string + description: Postal code of the activity + participants: + type: array + description: The participants of the activity + items: + type: object + properties: + person_id: + type: integer + description: The ID of the person + primary: + type: boolean + description: Whether the person is the primary participant or not + attendees: + type: array + description: The attendees of the activity + items: + type: object + properties: + email: + type: string + description: The email address of the attendee + name: + type: string + description: The name of the attendee + status: + type: string + description: The status of the attendee + is_organizer: + type: boolean + description: Whether the attendee is the organizer or not + person_id: + type: integer + description: The ID of the person if the attendee has a person record + user_id: + type: integer + description: The ID of the user if the attendee is a user + conference_meeting_client: + type: string + description: The client used for the conference meeting + conference_meeting_url: + type: string + description: The URL of the conference meeting + conference_meeting_id: + type: string + description: The ID of the conference meeting + public_description: + type: string + description: The public description of the activity + priority: + type: integer + description: The priority of the activity. Mappable to a specific string using activityFields API. + note: + type: string + description: The note of the activity + description: The activity object + example: + success: true + data: + id: 1 + subject: Activity Subject + type: activity_type + owner_id: 1 + creator_user_id: 1 + is_deleted: false + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + deal_id: 5 + lead_id: abc-def + person_id: 6 + org_id: 7 + project_id: 8 + due_date: '2021-01-01' + due_time: '15:00:00' + duration: '01:00:00' + busy: true + done: true + marked_as_done_time: '2021-01-01T00:00:00Z' + location: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + participants: + - person_id: 1 + primary: true + attendees: + - email: some@email.com + name: Some Name + status: accepted + is_organizer: true + person_id: 1 + user_id: 1 + conference_meeting_client: google_meet + conference_meeting_url: 'https://meet.google.com/abc-xyz' + conference_meeting_id: abc-xyz + public_description: Public Description + priority: 263 + note: Note + '/activities/{id}': + delete: + summary: Delete an activity + description: 'Marks an activity as deleted. After 30 days, the activity will be permanently deleted.' + x-token-cost: 3 + operationId: deleteActivity + tags: + - Activities + security: + - api_key: [] + - oauth2: + - 'activities:full' + parameters: + - in: path + name: id + description: The ID of the activity + required: true + schema: + type: integer + responses: + '200': + description: Delete activity + content: + application/json: + schema: + title: DeleteActivityResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: Deleted activity ID + example: + success: true + data: + id: 1 + get: + summary: Get details of an activity + description: Returns the details of a specific activity. + x-token-cost: 1 + operationId: getActivity + tags: + - Activities + security: + - api_key: [] + - oauth2: + - 'activities:read' + - 'activities:full' + parameters: + - in: path + name: id + description: The ID of the activity + required: true + schema: + type: integer + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include + schema: + type: string + enum: + - attendees + responses: + '200': + description: Get activity + content: + application/json: + schema: + type: object + title: UpsertActivityResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertActivityResponseData + properties: + data: + type: object + title: ActivityItem + properties: + id: + type: integer + description: The ID of the activity + subject: + type: string + description: The subject of the activity + type: + type: string + description: The type of the activity + owner_id: + type: integer + description: The ID of the user who owns the activity + creator_user_id: + type: integer + description: The ID of the user who created the activity + is_deleted: + type: boolean + description: Whether the activity is deleted or not + add_time: + type: string + description: The creation date and time of the activity + update_time: + type: string + description: The last updated date and time of the activity + deal_id: + type: integer + description: The ID of the deal linked to the activity + lead_id: + type: string + description: The ID of the lead linked to the activity + person_id: + type: integer + description: The ID of the person linked to the activity + org_id: + type: integer + description: The ID of the organization linked to the activity + project_id: + type: integer + description: The ID of the project linked to the activity + due_date: + type: string + description: The due date of the activity + due_time: + type: string + description: The due time of the activity + duration: + type: string + description: The duration of the activity + busy: + type: boolean + description: Whether the activity marks the assignee as busy or not in their calendar + done: + type: boolean + description: Whether the activity is marked as done or not + marked_as_done_time: + type: string + description: The date and time when the activity was marked as done + location: + type: object + description: Location of the activity + properties: + value: + type: string + description: The full address of the activity + country: + type: string + description: Country of the activity + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the activity + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the activity + locality: + type: string + description: Locality (e.g. city) of the activity + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the activity + route: + type: string + description: Route (e.g. street) of the activity + street_number: + type: string + description: Street number of the activity + postal_code: + type: string + description: Postal code of the activity + participants: + type: array + description: The participants of the activity + items: + type: object + properties: + person_id: + type: integer + description: The ID of the person + primary: + type: boolean + description: Whether the person is the primary participant or not + attendees: + type: array + description: The attendees of the activity + items: + type: object + properties: + email: + type: string + description: The email address of the attendee + name: + type: string + description: The name of the attendee + status: + type: string + description: The status of the attendee + is_organizer: + type: boolean + description: Whether the attendee is the organizer or not + person_id: + type: integer + description: The ID of the person if the attendee has a person record + user_id: + type: integer + description: The ID of the user if the attendee is a user + conference_meeting_client: + type: string + description: The client used for the conference meeting + conference_meeting_url: + type: string + description: The URL of the conference meeting + conference_meeting_id: + type: string + description: The ID of the conference meeting + public_description: + type: string + description: The public description of the activity + priority: + type: integer + description: The priority of the activity. Mappable to a specific string using activityFields API. + note: + type: string + description: The note of the activity + description: The activity object + example: + success: true + data: + id: 1 + subject: Activity Subject + type: activity_type + owner_id: 1 + creator_user_id: 1 + is_deleted: false + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + deal_id: 5 + lead_id: abc-def + person_id: 6 + org_id: 7 + project_id: 8 + due_date: '2021-01-01' + due_time: '15:00:00' + duration: '01:00:00' + busy: true + done: true + marked_as_done_time: '2021-01-01T00:00:00Z' + location: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + participants: + - person_id: 1 + primary: true + attendees: + - email: some@email.com + name: Some Name + status: accepted + is_organizer: true + person_id: 1 + user_id: 1 + conference_meeting_client: google_meet + conference_meeting_url: 'https://meet.google.com/abc-xyz' + conference_meeting_id: abc-xyz + public_description: Public Description + priority: 263 + note: Note + patch: + summary: Update an activity + description: Updates the properties of an activity. + x-token-cost: 5 + operationId: updateActivity + tags: + - Activities + security: + - api_key: [] + - oauth2: + - 'activities:full' + parameters: + - in: path + name: id + description: The ID of the activity + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: object + properties: + subject: + type: string + description: The subject of the activity + type: + type: string + description: The type of the activity + owner_id: + type: integer + description: The ID of the user who owns the activity + deal_id: + type: integer + description: The ID of the deal linked to the activity + lead_id: + type: string + description: The ID of the lead linked to the activity + person_id: + type: integer + description: The ID of the person linked to the activity + org_id: + type: integer + description: The ID of the organization linked to the activity + project_id: + type: integer + description: The ID of the project linked to the activity + due_date: + type: string + description: The due date of the activity + due_time: + type: string + description: The due time of the activity + duration: + type: string + description: The duration of the activity + busy: + type: boolean + description: Whether the activity marks the assignee as busy or not in their calendar + done: + type: boolean + description: Whether the activity is marked as done or not + location: + type: object + description: Location of the activity + properties: + value: + type: string + description: The full address of the activity + country: + type: string + description: Country of the activity + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the activity + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the activity + locality: + type: string + description: Locality (e.g. city) of the activity + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the activity + route: + type: string + description: Route (e.g. street) of the activity + street_number: + type: string + description: Street number of the activity + postal_code: + type: string + description: Postal code of the activity + participants: + type: array + description: The participants of the activity + items: + type: object + properties: + person_id: + type: integer + description: The ID of the person + primary: + type: boolean + description: Whether the person is the primary participant or not + attendees: + type: array + description: The attendees of the activity + items: + type: object + properties: + email: + type: string + description: The email address of the attendee + name: + type: string + description: The name of the attendee + status: + type: string + description: The status of the attendee + is_organizer: + type: boolean + description: Whether the attendee is the organizer or not + person_id: + type: integer + description: The ID of the person if the attendee has a person record + user_id: + type: integer + description: The ID of the user if the attendee is a user + public_description: + type: string + description: The public description of the activity + priority: + type: integer + description: The priority of the activity. Mappable to a specific string using activityFields API. + note: + type: string + description: The note of the activity + responses: + '200': + description: Edit activity + content: + application/json: + schema: + type: object + title: UpsertActivityResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertActivityResponseData + properties: + data: + type: object + title: ActivityItem + properties: + id: + type: integer + description: The ID of the activity + subject: + type: string + description: The subject of the activity + type: + type: string + description: The type of the activity + owner_id: + type: integer + description: The ID of the user who owns the activity + creator_user_id: + type: integer + description: The ID of the user who created the activity + is_deleted: + type: boolean + description: Whether the activity is deleted or not + add_time: + type: string + description: The creation date and time of the activity + update_time: + type: string + description: The last updated date and time of the activity + deal_id: + type: integer + description: The ID of the deal linked to the activity + lead_id: + type: string + description: The ID of the lead linked to the activity + person_id: + type: integer + description: The ID of the person linked to the activity + org_id: + type: integer + description: The ID of the organization linked to the activity + project_id: + type: integer + description: The ID of the project linked to the activity + due_date: + type: string + description: The due date of the activity + due_time: + type: string + description: The due time of the activity + duration: + type: string + description: The duration of the activity + busy: + type: boolean + description: Whether the activity marks the assignee as busy or not in their calendar + done: + type: boolean + description: Whether the activity is marked as done or not + marked_as_done_time: + type: string + description: The date and time when the activity was marked as done + location: + type: object + description: Location of the activity + properties: + value: + type: string + description: The full address of the activity + country: + type: string + description: Country of the activity + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the activity + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the activity + locality: + type: string + description: Locality (e.g. city) of the activity + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the activity + route: + type: string + description: Route (e.g. street) of the activity + street_number: + type: string + description: Street number of the activity + postal_code: + type: string + description: Postal code of the activity + participants: + type: array + description: The participants of the activity + items: + type: object + properties: + person_id: + type: integer + description: The ID of the person + primary: + type: boolean + description: Whether the person is the primary participant or not + attendees: + type: array + description: The attendees of the activity + items: + type: object + properties: + email: + type: string + description: The email address of the attendee + name: + type: string + description: The name of the attendee + status: + type: string + description: The status of the attendee + is_organizer: + type: boolean + description: Whether the attendee is the organizer or not + person_id: + type: integer + description: The ID of the person if the attendee has a person record + user_id: + type: integer + description: The ID of the user if the attendee is a user + conference_meeting_client: + type: string + description: The client used for the conference meeting + conference_meeting_url: + type: string + description: The URL of the conference meeting + conference_meeting_id: + type: string + description: The ID of the conference meeting + public_description: + type: string + description: The public description of the activity + priority: + type: integer + description: The priority of the activity. Mappable to a specific string using activityFields API. + note: + type: string + description: The note of the activity + description: The activity object + example: + success: true + data: + id: 1 + subject: Activity Subject + type: activity_type + owner_id: 1 + creator_user_id: 1 + is_deleted: false + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + deal_id: 5 + lead_id: abc-def + person_id: 6 + org_id: 7 + project_id: 8 + due_date: '2021-01-01' + due_time: '15:00:00' + duration: '01:00:00' + busy: true + done: true + marked_as_done_time: '2021-01-01T00:00:00Z' + location: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + participants: + - person_id: 1 + primary: true + attendees: + - email: some@email.com + name: Some Name + status: accepted + is_organizer: true + person_id: 1 + user_id: 1 + conference_meeting_client: google_meet + conference_meeting_url: 'https://meet.google.com/abc-xyz' + conference_meeting_id: abc-xyz + public_description: Public Description + priority: 263 + note: Note + /deals: + get: + summary: Get all deals + description: Returns data about all not archived deals. + x-token-cost: 10 + operationId: getDeals + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: query + name: filter_id + schema: + type: integer + description: 'If supplied, only deals matching the specified filter are returned' + - in: query + name: ids + description: 'Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.' + schema: + type: string + - in: query + name: owner_id + schema: + type: integer + description: 'If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.' + - in: query + name: person_id + schema: + type: integer + description: 'If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.' + - in: query + name: org_id + schema: + type: integer + description: 'If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.' + - in: query + name: pipeline_id + schema: + type: integer + description: 'If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.' + - in: query + name: stage_id + schema: + type: integer + description: 'If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.' + - in: query + name: status + schema: + type: string + enum: + - open + - won + - lost + - deleted + description: 'Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored.' + - in: query + name: updated_since + schema: + type: string + description: 'If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: updated_until + schema: + type: string + description: 'If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `update_time`, `add_time`.' + schema: + type: string + default: id + enum: + - id + - update_time + - add_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include + schema: + type: string + enum: + - next_activity_id + - last_activity_id + - first_won_time + - products_count + - files_count + - notes_count + - followers_count + - email_messages_count + - activities_count + - done_activities_count + - undone_activities_count + - participants_count + - last_incoming_mail_time + - last_outgoing_mail_time + - smart_bcc_email + - in: query + name: custom_fields + description: 'Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Get all not archived deals + content: + application/json: + schema: + type: object + title: GetDealsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Deals array + items: + type: object + title: DealItem + properties: + id: + type: integer + description: The ID of the deal + title: + type: string + description: The title of the deal + owner_id: + type: integer + description: The ID of the user who owns the deal + person_id: + type: integer + description: The ID of the person linked to the deal + org_id: + type: integer + description: The ID of the organization linked to the deal + pipeline_id: + type: integer + description: The ID of the pipeline associated with the deal + stage_id: + type: integer + description: The ID of the deal stage + value: + type: number + description: The value of the deal + currency: + type: string + description: The currency associated with the deal + add_time: + type: string + description: The creation date and time of the deal + update_time: + type: string + description: The last updated date and time of the deal + stage_change_time: + type: string + description: The last updated date and time of the deal stage + is_deleted: + type: boolean + description: Whether the deal is deleted or not + is_archived: + type: boolean + description: Whether the deal is archived or not + status: + type: string + description: The status of the deal + probability: + type: number + nullable: true + description: The success probability percentage of the deal + lost_reason: + type: string + nullable: true + description: The reason for losing the deal + visible_to: + type: integer + description: The visibility of the deal + close_time: + type: string + nullable: true + description: The date and time of closing the deal + won_time: + type: string + description: The date and time of changing the deal status as won + lost_time: + type: string + description: The date and time of changing the deal status as lost + expected_close_date: + type: string + format: date + description: The expected close date of the deal + label_ids: + type: array + description: The IDs of labels assigned to the deal + items: + type: integer + origin: + type: string + description: The way this Deal was created. `origin` field is set by Pipedrive when Deal is created and cannot be changed. + origin_id: + type: string + nullable: true + description: The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this Deal. + channel: + type: integer + nullable: true + description: 'The ID of your Marketing channel this Deal was created from. Recognized Marketing channels can be configured in your Company settings.' + channel_id: + type: string + nullable: true + description: The optional ID to further distinguish the Marketing channel. + arr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Recurring Revenue of the deal + + Null if there are no products attached to the deal + mrr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Monthly Recurring Revenue of the deal + + Null if there are no products attached to the deal + acv: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Contract Value of the deal + + Null if there are no products attached to the deal + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + title: Deal Title + creator_user_id: 1 + owner_id: 1 + value: 200 + person_id: 1 + org_id: 1 + stage_id: 1 + pipeline_id: 1 + currency: USD + archive_time: '2021-01-01T00:00:00Z' + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + stage_change_time: '2021-01-01T00:00:00Z' + status: open + is_archived: false + is_deleted: false + probability: 90 + lost_reason: Lost Reason + visible_to: 7 + close_time: '2021-01-01T00:00:00Z' + won_time: '2021-01-01T00:00:00Z' + lost_time: '2021-01-01T00:00:00Z' + local_won_date: '2021-01-01' + local_lost_date: '2021-01-01' + local_close_date: '2021-01-01' + expected_close_date: '2021-01-01' + label_ids: + - 1 + - 2 + - 3 + origin: ManuallyCreated + origin_id: null + channel: 52 + channel_id: Jun23 Billboards + acv: 120 + arr: 120 + mrr: 10 + custom_fields: {} + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a new deal + description: Adds a new deal. + x-token-cost: 5 + operationId: addDeal + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:full' + requestBody: + content: + application/json: + schema: + required: + - title + type: object + properties: + title: + type: string + description: The title of the deal + owner_id: + type: integer + description: The ID of the user who owns the deal + person_id: + type: integer + description: The ID of the person linked to the deal + org_id: + type: integer + description: The ID of the organization linked to the deal + pipeline_id: + type: integer + description: The ID of the pipeline associated with the deal + stage_id: + type: integer + description: The ID of the deal stage + value: + type: number + description: The value of the deal + currency: + type: string + description: The currency associated with the deal + add_time: + type: string + description: The creation date and time of the deal + update_time: + type: string + description: The last updated date and time of the deal + stage_change_time: + type: string + description: The last updated date and time of the deal stage + is_deleted: + type: boolean + description: Whether the deal is deleted or not + is_archived: + type: boolean + description: Whether the deal is archived or not + archive_time: + type: string + description: 'The optional date and time of archiving the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. If omitted and `is_archived` is true, it will be set to the current date and time.' + status: + type: string + description: The status of the deal + probability: + type: number + nullable: true + description: The success probability percentage of the deal + lost_reason: + type: string + nullable: true + description: The reason for losing the deal. Can only be set if deal status is lost. + visible_to: + type: integer + description: The visibility of the deal + close_time: + type: string + nullable: true + description: The date and time of closing the deal. Can only be set if deal status is won or lost. + won_time: + type: string + description: The date and time of changing the deal status as won. Can only be set if deal status is won. + lost_time: + type: string + description: The date and time of changing the deal status as lost. Can only be set if deal status is lost. + expected_close_date: + type: string + format: date + description: The expected close date of the deal + label_ids: + type: array + description: The IDs of labels assigned to the deal + items: + type: integer + responses: + '200': + description: Add deal + content: + application/json: + schema: + type: object + title: UpsertDealResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertDealResponseData + properties: + data: + type: object + title: DealItem + properties: + id: + type: integer + description: The ID of the deal + title: + type: string + description: The title of the deal + owner_id: + type: integer + description: The ID of the user who owns the deal + person_id: + type: integer + description: The ID of the person linked to the deal + org_id: + type: integer + description: The ID of the organization linked to the deal + pipeline_id: + type: integer + description: The ID of the pipeline associated with the deal + stage_id: + type: integer + description: The ID of the deal stage + value: + type: number + description: The value of the deal + currency: + type: string + description: The currency associated with the deal + add_time: + type: string + description: The creation date and time of the deal + update_time: + type: string + description: The last updated date and time of the deal + stage_change_time: + type: string + description: The last updated date and time of the deal stage + is_deleted: + type: boolean + description: Whether the deal is deleted or not + is_archived: + type: boolean + description: Whether the deal is archived or not + status: + type: string + description: The status of the deal + probability: + type: number + nullable: true + description: The success probability percentage of the deal + lost_reason: + type: string + nullable: true + description: The reason for losing the deal + visible_to: + type: integer + description: The visibility of the deal + close_time: + type: string + nullable: true + description: The date and time of closing the deal + won_time: + type: string + description: The date and time of changing the deal status as won + lost_time: + type: string + description: The date and time of changing the deal status as lost + expected_close_date: + type: string + format: date + description: The expected close date of the deal + label_ids: + type: array + description: The IDs of labels assigned to the deal + items: + type: integer + origin: + type: string + description: The way this Deal was created. `origin` field is set by Pipedrive when Deal is created and cannot be changed. + origin_id: + type: string + nullable: true + description: The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this Deal. + channel: + type: integer + nullable: true + description: 'The ID of your Marketing channel this Deal was created from. Recognized Marketing channels can be configured in your Company settings.' + channel_id: + type: string + nullable: true + description: The optional ID to further distinguish the Marketing channel. + arr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Recurring Revenue of the deal + + Null if there are no products attached to the deal + mrr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Monthly Recurring Revenue of the deal + + Null if there are no products attached to the deal + acv: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Contract Value of the deal + + Null if there are no products attached to the deal + description: The deal object + example: + success: true + data: + id: 1 + title: Deal Title + creator_user_id: 1 + owner_id: 1 + value: 200 + person_id: 1 + org_id: 1 + stage_id: 1 + pipeline_id: 1 + currency: USD + archive_time: '2021-01-01T00:00:00Z' + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + stage_change_time: '2021-01-01T00:00:00Z' + status: open + is_archived: false + is_deleted: false + probability: 90 + lost_reason: Lost Reason + visible_to: 7 + close_time: '2021-01-01T00:00:00Z' + won_time: '2021-01-01T00:00:00Z' + lost_time: '2021-01-01T00:00:00Z' + local_won_date: '2021-01-01' + local_lost_date: '2021-01-01' + local_close_date: '2021-01-01' + expected_close_date: '2021-01-01' + label_ids: + - 1 + - 2 + - 3 + origin: ManuallyCreated + origin_id: null + channel: 52 + channel_id: Jun23 Billboards + acv: 120 + arr: 120 + mrr: 10 + custom_fields: {} + /deals/archived: + get: + summary: Get all archived deals + description: Returns data about all archived deals. + x-token-cost: 20 + operationId: getArchivedDeals + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: query + name: filter_id + schema: + type: integer + description: 'If supplied, only deals matching the specified filter are returned' + - in: query + name: ids + description: 'Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.' + schema: + type: string + - in: query + name: owner_id + schema: + type: integer + description: 'If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.' + - in: query + name: person_id + schema: + type: integer + description: 'If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.' + - in: query + name: org_id + schema: + type: integer + description: 'If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.' + - in: query + name: pipeline_id + schema: + type: integer + description: 'If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.' + - in: query + name: stage_id + schema: + type: integer + description: 'If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.' + - in: query + name: status + schema: + type: string + enum: + - open + - won + - lost + - deleted + description: 'Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored.' + - in: query + name: updated_since + schema: + type: string + description: 'If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: updated_until + schema: + type: string + description: 'If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `update_time`, `add_time`.' + schema: + type: string + default: id + enum: + - id + - update_time + - add_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include + schema: + type: string + enum: + - next_activity_id + - last_activity_id + - first_won_time + - products_count + - files_count + - notes_count + - followers_count + - email_messages_count + - activities_count + - done_activities_count + - undone_activities_count + - participants_count + - last_incoming_mail_time + - last_outgoing_mail_time + - smart_bcc_email + - in: query + name: custom_fields + description: 'Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Get all archived deals + content: + application/json: + schema: + type: object + title: GetDealsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Deals array + items: + type: object + title: DealItem + properties: + id: + type: integer + description: The ID of the deal + title: + type: string + description: The title of the deal + owner_id: + type: integer + description: The ID of the user who owns the deal + person_id: + type: integer + description: The ID of the person linked to the deal + org_id: + type: integer + description: The ID of the organization linked to the deal + pipeline_id: + type: integer + description: The ID of the pipeline associated with the deal + stage_id: + type: integer + description: The ID of the deal stage + value: + type: number + description: The value of the deal + currency: + type: string + description: The currency associated with the deal + add_time: + type: string + description: The creation date and time of the deal + update_time: + type: string + description: The last updated date and time of the deal + stage_change_time: + type: string + description: The last updated date and time of the deal stage + is_deleted: + type: boolean + description: Whether the deal is deleted or not + is_archived: + type: boolean + description: Whether the deal is archived or not + status: + type: string + description: The status of the deal + probability: + type: number + nullable: true + description: The success probability percentage of the deal + lost_reason: + type: string + nullable: true + description: The reason for losing the deal + visible_to: + type: integer + description: The visibility of the deal + close_time: + type: string + nullable: true + description: The date and time of closing the deal + won_time: + type: string + description: The date and time of changing the deal status as won + lost_time: + type: string + description: The date and time of changing the deal status as lost + expected_close_date: + type: string + format: date + description: The expected close date of the deal + label_ids: + type: array + description: The IDs of labels assigned to the deal + items: + type: integer + origin: + type: string + description: The way this Deal was created. `origin` field is set by Pipedrive when Deal is created and cannot be changed. + origin_id: + type: string + nullable: true + description: The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this Deal. + channel: + type: integer + nullable: true + description: 'The ID of your Marketing channel this Deal was created from. Recognized Marketing channels can be configured in your Company settings.' + channel_id: + type: string + nullable: true + description: The optional ID to further distinguish the Marketing channel. + arr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Recurring Revenue of the deal + + Null if there are no products attached to the deal + mrr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Monthly Recurring Revenue of the deal + + Null if there are no products attached to the deal + acv: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Contract Value of the deal + + Null if there are no products attached to the deal + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + title: Deal Title + creator_user_id: 1 + owner_id: 1 + value: 200 + person_id: 1 + org_id: 1 + stage_id: 1 + pipeline_id: 1 + currency: USD + archive_time: '2021-01-01T00:00:00Z' + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + stage_change_time: '2021-01-01T00:00:00Z' + status: open + is_archived: true + is_deleted: false + probability: 90 + lost_reason: Lost Reason + visible_to: 7 + close_time: '2021-01-01T00:00:00Z' + won_time: '2021-01-01T00:00:00Z' + lost_time: '2021-01-01T00:00:00Z' + local_won_date: '2021-01-01' + local_lost_date: '2021-01-01' + local_close_date: '2021-01-01' + expected_close_date: '2021-01-01' + label_ids: + - 1 + - 2 + - 3 + origin: ManuallyCreated + origin_id: null + channel: 52 + channel_id: Jun23 Billboards + acv: 120 + arr: 120 + mrr: 10 + custom_fields: {} + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/deals/{id}': + delete: + summary: Delete a deal + description: 'Marks a deal as deleted. After 30 days, the deal will be permanently deleted.' + x-token-cost: 3 + operationId: deleteDeal + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + responses: + '200': + description: Delete deal + content: + application/json: + schema: + title: DeleteDealResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: Deleted deal ID + example: + success: true + data: + id: 1 + get: + summary: Get details of a deal + description: Returns the details of a specific deal. + x-token-cost: 1 + operationId: getDeal + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include + schema: + type: string + enum: + - next_activity_id + - last_activity_id + - first_won_time + - products_count + - files_count + - notes_count + - followers_count + - email_messages_count + - activities_count + - done_activities_count + - undone_activities_count + - participants_count + - last_incoming_mail_time + - last_outgoing_mail_time + - smart_bcc_email + - in: query + name: custom_fields + description: 'Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + responses: + '200': + description: Get deal + content: + application/json: + schema: + type: object + title: UpsertDealResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertDealResponseData + properties: + data: + type: object + title: DealItem + properties: + id: + type: integer + description: The ID of the deal + title: + type: string + description: The title of the deal + owner_id: + type: integer + description: The ID of the user who owns the deal + person_id: + type: integer + description: The ID of the person linked to the deal + org_id: + type: integer + description: The ID of the organization linked to the deal + pipeline_id: + type: integer + description: The ID of the pipeline associated with the deal + stage_id: + type: integer + description: The ID of the deal stage + value: + type: number + description: The value of the deal + currency: + type: string + description: The currency associated with the deal + add_time: + type: string + description: The creation date and time of the deal + update_time: + type: string + description: The last updated date and time of the deal + stage_change_time: + type: string + description: The last updated date and time of the deal stage + is_deleted: + type: boolean + description: Whether the deal is deleted or not + is_archived: + type: boolean + description: Whether the deal is archived or not + status: + type: string + description: The status of the deal + probability: + type: number + nullable: true + description: The success probability percentage of the deal + lost_reason: + type: string + nullable: true + description: The reason for losing the deal + visible_to: + type: integer + description: The visibility of the deal + close_time: + type: string + nullable: true + description: The date and time of closing the deal + won_time: + type: string + description: The date and time of changing the deal status as won + lost_time: + type: string + description: The date and time of changing the deal status as lost + expected_close_date: + type: string + format: date + description: The expected close date of the deal + label_ids: + type: array + description: The IDs of labels assigned to the deal + items: + type: integer + origin: + type: string + description: The way this Deal was created. `origin` field is set by Pipedrive when Deal is created and cannot be changed. + origin_id: + type: string + nullable: true + description: The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this Deal. + channel: + type: integer + nullable: true + description: 'The ID of your Marketing channel this Deal was created from. Recognized Marketing channels can be configured in your Company settings.' + channel_id: + type: string + nullable: true + description: The optional ID to further distinguish the Marketing channel. + arr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Recurring Revenue of the deal + + Null if there are no products attached to the deal + mrr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Monthly Recurring Revenue of the deal + + Null if there are no products attached to the deal + acv: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Contract Value of the deal + + Null if there are no products attached to the deal + description: The deal object + example: + success: true + data: + id: 1 + title: Deal Title + creator_user_id: 1 + owner_id: 1 + value: 200 + person_id: 1 + org_id: 1 + stage_id: 1 + pipeline_id: 1 + currency: USD + archive_time: '2021-01-01T00:00:00Z' + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + stage_change_time: '2021-01-01T00:00:00Z' + status: open + is_archived: false + is_deleted: false + probability: 90 + lost_reason: Lost Reason + visible_to: 7 + close_time: '2021-01-01T00:00:00Z' + won_time: '2021-01-01T00:00:00Z' + lost_time: '2021-01-01T00:00:00Z' + local_won_date: '2021-01-01' + local_lost_date: '2021-01-01' + local_close_date: '2021-01-01' + expected_close_date: '2021-01-01' + label_ids: + - 1 + - 2 + - 3 + origin: ManuallyCreated + origin_id: null + channel: 52 + channel_id: Jun23 Billboards + acv: 120 + arr: 120 + mrr: 10 + custom_fields: {} + patch: + summary: Update a deal + description: Updates the properties of a deal. + x-token-cost: 5 + operationId: updateDeal + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: object + properties: + title: + type: string + description: The title of the deal + owner_id: + type: integer + description: The ID of the user who owns the deal + person_id: + type: integer + description: The ID of the person linked to the deal + org_id: + type: integer + description: The ID of the organization linked to the deal + pipeline_id: + type: integer + description: The ID of the pipeline associated with the deal + stage_id: + type: integer + description: The ID of the deal stage + value: + type: number + description: The value of the deal + currency: + type: string + description: The currency associated with the deal + add_time: + type: string + description: The creation date and time of the deal + update_time: + type: string + description: The last updated date and time of the deal + stage_change_time: + type: string + description: The last updated date and time of the deal stage + is_deleted: + type: boolean + description: Whether the deal is deleted or not + is_archived: + type: boolean + description: Whether the deal is archived or not + archive_time: + type: string + description: 'The optional date and time of archiving the deal in UTC. Format: YYYY-MM-DD HH:MM:SS. If omitted and `is_archived` is true, it will be set to the current date and time.' + status: + type: string + description: The status of the deal + probability: + type: number + nullable: true + description: The success probability percentage of the deal + lost_reason: + type: string + nullable: true + description: The reason for losing the deal. Can only be set if deal status is lost. + visible_to: + type: integer + description: The visibility of the deal + close_time: + type: string + nullable: true + description: The date and time of closing the deal. Can only be set if deal status is won or lost. + won_time: + type: string + description: The date and time of changing the deal status as won. Can only be set if deal status is won. + lost_time: + type: string + description: The date and time of changing the deal status as lost. Can only be set if deal status is lost. + expected_close_date: + type: string + format: date + description: The expected close date of the deal + label_ids: + type: array + description: The IDs of labels assigned to the deal + items: + type: integer + responses: + '200': + description: Edit deal + content: + application/json: + schema: + type: object + title: UpsertDealResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertDealResponseData + properties: + data: + type: object + title: DealItem + properties: + id: + type: integer + description: The ID of the deal + title: + type: string + description: The title of the deal + owner_id: + type: integer + description: The ID of the user who owns the deal + person_id: + type: integer + description: The ID of the person linked to the deal + org_id: + type: integer + description: The ID of the organization linked to the deal + pipeline_id: + type: integer + description: The ID of the pipeline associated with the deal + stage_id: + type: integer + description: The ID of the deal stage + value: + type: number + description: The value of the deal + currency: + type: string + description: The currency associated with the deal + add_time: + type: string + description: The creation date and time of the deal + update_time: + type: string + description: The last updated date and time of the deal + stage_change_time: + type: string + description: The last updated date and time of the deal stage + is_deleted: + type: boolean + description: Whether the deal is deleted or not + is_archived: + type: boolean + description: Whether the deal is archived or not + status: + type: string + description: The status of the deal + probability: + type: number + nullable: true + description: The success probability percentage of the deal + lost_reason: + type: string + nullable: true + description: The reason for losing the deal + visible_to: + type: integer + description: The visibility of the deal + close_time: + type: string + nullable: true + description: The date and time of closing the deal + won_time: + type: string + description: The date and time of changing the deal status as won + lost_time: + type: string + description: The date and time of changing the deal status as lost + expected_close_date: + type: string + format: date + description: The expected close date of the deal + label_ids: + type: array + description: The IDs of labels assigned to the deal + items: + type: integer + origin: + type: string + description: The way this Deal was created. `origin` field is set by Pipedrive when Deal is created and cannot be changed. + origin_id: + type: string + nullable: true + description: The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this Deal. + channel: + type: integer + nullable: true + description: 'The ID of your Marketing channel this Deal was created from. Recognized Marketing channels can be configured in your Company settings.' + channel_id: + type: string + nullable: true + description: The optional ID to further distinguish the Marketing channel. + arr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Recurring Revenue of the deal + + Null if there are no products attached to the deal + mrr: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Monthly Recurring Revenue of the deal + + Null if there are no products attached to the deal + acv: + type: number + nullable: true + description: | + Only available in Advanced and above plans + + The Annual Contract Value of the deal + + Null if there are no products attached to the deal + description: The deal object + example: + success: true + data: + id: 1 + title: Deal Title + creator_user_id: 1 + owner_id: 1 + value: 200 + person_id: 1 + org_id: 1 + stage_id: 1 + pipeline_id: 1 + currency: USD + archive_time: '2021-01-01T00:00:00Z' + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + stage_change_time: '2021-01-01T00:00:00Z' + status: open + is_archived: false + is_deleted: false + probability: 90 + lost_reason: Lost Reason + visible_to: 7 + close_time: '2021-01-01T00:00:00Z' + won_time: '2021-01-01T00:00:00Z' + lost_time: '2021-01-01T00:00:00Z' + local_won_date: '2021-01-01' + local_lost_date: '2021-01-01' + local_close_date: '2021-01-01' + expected_close_date: '2021-01-01' + label_ids: + - 1 + - 2 + - 3 + origin: ManuallyCreated + origin_id: null + channel: 52 + channel_id: Jun23 Billboards + acv: 120 + arr: 120 + mrr: 10 + custom_fields: {} + '/deals/{id}/followers': + get: + summary: List followers of a deal + description: Lists users who are following the deal. + x-token-cost: 10 + operationId: getDealFollowers + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowersResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Followers array + items: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - user_id: 1 + add_time: '2021-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a follower to a deal + description: Adds a user as a follower to the deal. + x-token-cost: 5 + operationId: addDealFollower + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + required: + - user_id + type: object + properties: + user_id: + type: integer + description: The ID of the user to add as a follower + responses: + '201': + description: Add a follower + content: + application/json: + schema: + type: object + title: AddFollowerResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + description: The follower object + example: + success: true + data: + user_id: 1 + add_time: '2021-01-01T00:00:00Z' + '/deals/{id}/followers/changelog': + get: + summary: List followers changelog of a deal + description: Lists changelogs about users have followed the deal. + x-token-cost: 10 + operationId: getDealFollowersChangelog + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowerChangelogsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Follower changelogs array + items: + type: object + title: FollowerChangelogItem + properties: + action: + type: string + description: The type of change + actor_user_id: + type: integer + description: The ID of the user who did the change + follower_user_id: + type: integer + description: The ID of the user who was following the entity + time: + type: string + description: The time at which the change happened + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - action: added + actor_user_id: 1 + follower_user_id: 1 + time: '2024-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/deals/{id}/followers/{follower_id}': + delete: + summary: Delete a follower from a deal + description: Deletes a user follower from the deal. + x-token-cost: 3 + operationId: deleteDealFollower + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: path + name: follower_id + required: true + schema: + type: integer + description: The ID of the following user + responses: + '200': + description: Remove a follower + content: + application/json: + schema: + title: DeleteFollowerResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + user_id: + type: integer + description: Deleted follower user ID + example: + success: true + data: + user_id: 1 + /deals/products: + get: + summary: Get deal products of several deals + description: Returns data about products attached to deals + x-token-cost: 10 + operationId: getDealsProducts + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + - 'deals:read' + - 'deals:full' + parameters: + - in: query + name: deal_ids + required: true + schema: + type: array + items: + type: integer + description: An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided. + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `deal_id`, `add_time`, `update_time`.' + schema: + type: string + default: id + enum: + - id + - deal_id + - add_time + - update_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + responses: + '200': + description: List of products attached to deals + content: + application/json: + schema: + title: GetDealsProductsResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: array + description: Array containing data for all products attached to deals + items: + allOf: + - type: object + properties: + id: + type: integer + description: The ID of the deal-product (the ID of the product attached to the deal) + sum: + type: number + description: The sum of all the products attached to the deal + tax: + type: number + description: The product tax + deal_id: + type: integer + description: The ID of the deal + name: + type: string + description: The product name + product_id: + type: integer + description: The ID of the product + product_variation_id: + type: integer + nullable: true + description: The ID of the product variation + add_time: + type: string + description: The date and time when the product was added to the deal + update_time: + type: string + description: The date and time when the deal product was last updated + comments: + type: string + description: The comments of the product + currency: + type: string + description: The currency associated with the deal product + discount: + type: number + default: 0 + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + discount_type: + type: string + enum: + - percentage + - amount + default: percentage + description: The type of the discount's value + quantity: + type: integer + description: The quantity of the product + item_price: + type: number + description: The price value of the product + tax_method: + type: string + enum: + - exclusive + - inclusive + - none + description: 'The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount. By default, the user setting value for tax options will be used. Changing this in one product affects the rest of the products attached to the deal' + is_enabled: + type: boolean + description: Whether this product is enabled for the deal + default: true + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + + To set `billing_frequency` different than `one-time`, the deal must not have installments associated + + A deal can have up to 20 products attached with `billing_frequency` different than `one-time` + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + properties: + billing_start_date: + default: null + type: string + format: YYYY-MM-DD + nullable: true + description: | + Only available in Advanced and above plans + + The billing start date. Must be between 10 years in the past and 10 years in the future + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 3 + sum: 90 + tax: 0 + deal_id: 1 + name: Mechanical Pencil + product_id: 1 + product_variation_id: null + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + comments: '' + currency: USD + discount: 0 + quantity: 1 + item_price: 90 + tax_method: inclusive + discount_type: percentage + is_enabled: true + billing_frequency: one-time + billing_frequency_cycles: null + billing_start_date: '2019-12-19' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + /deals/search: + get: + summary: Search deals + description: 'Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID.' + x-token-cost: 20 + operationId: searchDeals + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + - 'search:read' + parameters: + - in: query + name: term + required: true + schema: + type: string + description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + - in: query + name: fields + schema: + type: string + enum: + - custom_fields + - notes + - title + description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields here.' + - in: query + name: exact_match + schema: + type: boolean + description: 'When enabled, only full exact matches against the given term are returned. It is not case sensitive.' + - in: query + name: person_id + schema: + type: integer + description: Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000. + - in: query + name: organization_id + schema: + type: integer + description: Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000. + - in: query + name: status + schema: + type: string + enum: + - open + - won + - lost + description: 'Will filter deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found deals associated with the status is 2000.' + - in: query + name: include_fields + schema: + type: string + enum: + - deal.cc_email + description: Supports including optional fields in the results which are not provided by default + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Success + content: + application/json: + schema: + title: GetDealSearchResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + properties: + items: + type: array + description: The array of deals + items: + type: object + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + properties: + id: + type: integer + description: The ID of the deal + type: + type: string + description: The type of the item + title: + type: string + description: The title of the deal + value: + type: integer + description: The value of the deal + currency: + type: string + description: The currency of the deal + status: + type: string + description: The status of the deal + visible_to: + type: integer + description: The visibility of the deal + owner: + type: object + properties: + id: + type: integer + description: The ID of the owner of the deal + stage: + type: object + properties: + id: + type: integer + description: The ID of the stage of the deal + name: + type: string + description: The name of the stage of the deal + person: + type: object + nullable: true + properties: + id: + type: integer + description: The ID of the person the deal is associated with + name: + type: string + description: The name of the person the deal is associated with + organization: + type: object + nullable: true + properties: + id: + type: integer + description: The ID of the organization the deal is associated with + name: + type: string + description: The name of the organization the deal is associated with + custom_fields: + type: array + items: + type: string + description: Custom fields + notes: + type: array + description: An array of notes + items: + type: string + is_archived: + type: boolean + description: A flag indicating whether the deal is archived or not + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + items: + - result_score: 1.22 + item: + id: 1 + type: deal + title: Jane Doe deal + value: 100 + currency: USD + status: open + visible_to: 3 + owner: + id: 1 + stage: + id: 1 + name: Lead In + person: + id: 1 + name: Jane Doe + organization: null + custom_fields: [] + notes: [] + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/deals/{id}/products': + get: + summary: List products attached to a deal + description: Lists products attached to a deal. + x-token-cost: 10 + operationId: getDealProducts + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `add_time`, `update_time`.' + schema: + default: id + type: string + enum: + - id + - add_time + - update_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + default: asc + type: string + enum: + - asc + - desc + responses: + '200': + description: List of products attached to deals + content: + application/json: + schema: + title: GetDealsProductsResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: array + description: Array containing data for all products attached to deals + items: + allOf: + - type: object + properties: + id: + type: integer + description: The ID of the deal-product (the ID of the product attached to the deal) + sum: + type: number + description: The sum of all the products attached to the deal + tax: + type: number + description: The product tax + deal_id: + type: integer + description: The ID of the deal + name: + type: string + description: The product name + product_id: + type: integer + description: The ID of the product + product_variation_id: + type: integer + nullable: true + description: The ID of the product variation + add_time: + type: string + description: The date and time when the product was added to the deal + update_time: + type: string + description: The date and time when the deal product was last updated + comments: + type: string + description: The comments of the product + currency: + type: string + description: The currency associated with the deal product + discount: + type: number + default: 0 + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + discount_type: + type: string + enum: + - percentage + - amount + default: percentage + description: The type of the discount's value + quantity: + type: integer + description: The quantity of the product + item_price: + type: number + description: The price value of the product + tax_method: + type: string + enum: + - exclusive + - inclusive + - none + description: 'The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount. By default, the user setting value for tax options will be used. Changing this in one product affects the rest of the products attached to the deal' + is_enabled: + type: boolean + description: Whether this product is enabled for the deal + default: true + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + + To set `billing_frequency` different than `one-time`, the deal must not have installments associated + + A deal can have up to 20 products attached with `billing_frequency` different than `one-time` + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + properties: + billing_start_date: + default: null + type: string + format: YYYY-MM-DD + nullable: true + description: | + Only available in Advanced and above plans + + The billing start date. Must be between 10 years in the past and 10 years in the future + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 3 + sum: 90 + tax: 0 + deal_id: 1 + name: Mechanical Pencil + product_id: 1 + product_variation_id: null + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + comments: '' + currency: USD + discount: 0 + quantity: 1 + item_price: 90 + tax_method: inclusive + discount_type: percentage + is_enabled: true + billing_frequency: one-time + billing_frequency_cycles: null + billing_start_date: '2019-12-19' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a product to a deal + description: 'Adds a product to a deal, creating a new item called a deal-product.' + x-token-cost: 5 + operationId: addDealProduct + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'products:full' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + title: addDealProductRequest + required: + - item_price + - quantity + - product_id + allOf: + - required: + - product_id + - item_price + - quantity + title: dealProductRequestBody + type: object + properties: + product_id: + type: integer + description: The ID of the product + item_price: + type: number + description: The price value of the product + quantity: + type: number + description: The quantity of the product + tax: + type: number + default: 0 + description: The product tax + comments: + type: string + description: The comments of the product + discount: + type: number + default: 0 + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + is_enabled: + type: boolean + description: | + Whether this product is enabled for the deal + + Not possible to disable the product if the deal has installments associated and the product is the last one enabled + + Not possible to enable the product if the deal has installments associated and the product is recurring + default: true + tax_method: + type: string + enum: + - exclusive + - inclusive + - none + description: 'The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount. By default, the user setting value for tax options will be used. Changing this in one product affects the rest of the products attached to the deal' + discount_type: + type: string + enum: + - percentage + - amount + default: percentage + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + product_variation_id: + type: integer + nullable: true + description: The ID of the product variation + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + + To set `billing_frequency` different than `one-time`, the deal must not have installments associated + + A deal can have up to 20 products attached with `billing_frequency` different than `one-time` + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + properties: + billing_start_date: + default: null + type: string + format: YYYY-MM-DD + nullable: true + description: | + Only available in Advanced and above plans + + The billing start date. Must be between 10 years in the past and 10 years in the future + responses: + '201': + description: Add a product to the deal + content: + application/json: + schema: + title: AddDealProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + allOf: + - type: object + properties: + id: + type: integer + description: The ID of the deal-product (the ID of the product attached to the deal) + sum: + type: number + description: The sum of all the products attached to the deal + tax: + type: number + description: The product tax + deal_id: + type: integer + description: The ID of the deal + name: + type: string + description: The product name + product_id: + type: integer + description: The ID of the product + product_variation_id: + type: integer + nullable: true + description: The ID of the product variation + add_time: + type: string + description: The date and time when the product was added to the deal + update_time: + type: string + description: The date and time when the deal product was last updated + comments: + type: string + description: The comments of the product + currency: + type: string + description: The currency associated with the deal product + discount: + type: number + default: 0 + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + discount_type: + type: string + enum: + - percentage + - amount + default: percentage + description: The type of the discount's value + quantity: + type: integer + description: The quantity of the product + item_price: + type: number + description: The price value of the product + tax_method: + type: string + enum: + - exclusive + - inclusive + - none + description: 'The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount. By default, the user setting value for tax options will be used. Changing this in one product affects the rest of the products attached to the deal' + is_enabled: + type: boolean + description: Whether this product is enabled for the deal + default: true + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + + To set `billing_frequency` different than `one-time`, the deal must not have installments associated + + A deal can have up to 20 products attached with `billing_frequency` different than `one-time` + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + properties: + billing_start_date: + default: null + type: string + format: YYYY-MM-DD + nullable: true + description: | + Only available in Advanced and above plans + + The billing start date. Must be between 10 years in the past and 10 years in the future + example: + success: true + data: + id: 3 + sum: 90 + tax: 0 + deal_id: 1 + name: Mechanical Pencil + product_id: 1 + product_variation_id: null + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + comments: '' + currency: USD + discount: 0 + quantity: 1 + item_price: 90 + tax_method: inclusive + discount_type: percentage + is_enabled: true + billing_frequency: one-time + billing_frequency_cycles: null + billing_start_date: '2019-12-19' + '/deals/{id}/products/{product_attachment_id}': + patch: + summary: Update the product attached to a deal + description: Updates the details of the product that has been attached to a deal. + x-token-cost: 5 + operationId: updateDealProduct + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'products:full' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: path + name: product_attachment_id + required: true + schema: + type: integer + description: The ID of the deal-product (the ID of the product attached to the deal) + requestBody: + content: + application/json: + schema: + title: updateDealProductRequest + allOf: + - title: dealProductRequestBody + type: object + properties: + product_id: + type: integer + description: The ID of the product + item_price: + type: number + description: The price value of the product + quantity: + type: number + description: The quantity of the product + tax: + type: number + default: 0 + description: The product tax + comments: + type: string + description: The comments of the product + discount: + type: number + default: 0 + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + is_enabled: + type: boolean + description: | + Whether this product is enabled for the deal + + Not possible to disable the product if the deal has installments associated and the product is the last one enabled + + Not possible to enable the product if the deal has installments associated and the product is recurring + default: true + tax_method: + type: string + enum: + - exclusive + - inclusive + - none + description: 'The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount. By default, the user setting value for tax options will be used. Changing this in one product affects the rest of the products attached to the deal' + discount_type: + type: string + enum: + - percentage + - amount + default: percentage + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + product_variation_id: + type: integer + nullable: true + description: The ID of the product variation + - type: object + properties: + billing_frequency: + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + + To set `billing_frequency` different than `one-time`, the deal must not have installments associated + + A deal can have up to 20 products attached with `billing_frequency` different than `one-time` + - type: object + properties: + billing_frequency_cycles: + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + properties: + billing_start_date: + type: string + format: YYYY-MM-DD + nullable: true + description: | + Only available in Advanced and above plans + + The billing start date. Must be between 10 years in the past and 10 years in the future + responses: + '200': + description: Add a product to the deal + content: + application/json: + schema: + title: AddDealProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + allOf: + - type: object + properties: + id: + type: integer + description: The ID of the deal-product (the ID of the product attached to the deal) + sum: + type: number + description: The sum of all the products attached to the deal + tax: + type: number + description: The product tax + deal_id: + type: integer + description: The ID of the deal + name: + type: string + description: The product name + product_id: + type: integer + description: The ID of the product + product_variation_id: + type: integer + nullable: true + description: The ID of the product variation + add_time: + type: string + description: The date and time when the product was added to the deal + update_time: + type: string + description: The date and time when the deal product was last updated + comments: + type: string + description: The comments of the product + currency: + type: string + description: The currency associated with the deal product + discount: + type: number + default: 0 + description: The value of the discount. The `discount_type` field can be used to specify whether the value is an amount or a percentage + discount_type: + type: string + enum: + - percentage + - amount + default: percentage + description: The type of the discount's value + quantity: + type: integer + description: The quantity of the product + item_price: + type: number + description: The price value of the product + tax_method: + type: string + enum: + - exclusive + - inclusive + - none + description: 'The tax option to be applied to the products. When using `inclusive`, the tax percentage will already be included in the price. When using `exclusive`, the tax will not be included in the price. When using `none`, no tax will be added. Use the `tax` field for defining the tax percentage amount. By default, the user setting value for tax options will be used. Changing this in one product affects the rest of the products attached to the deal' + is_enabled: + type: boolean + description: Whether this product is enabled for the deal + default: true + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + + To set `billing_frequency` different than `one-time`, the deal must not have installments associated + + A deal can have up to 20 products attached with `billing_frequency` different than `one-time` + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + properties: + billing_start_date: + default: null + type: string + format: YYYY-MM-DD + nullable: true + description: | + Only available in Advanced and above plans + + The billing start date. Must be between 10 years in the past and 10 years in the future + example: + success: true + data: + id: 3 + sum: 90 + tax: 0 + deal_id: 1 + name: Mechanical Pencil + product_id: 1 + product_variation_id: null + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + comments: '' + currency: USD + discount: 0 + quantity: 1 + item_price: 90 + tax_method: inclusive + discount_type: percentage + is_enabled: true + billing_frequency: one-time + billing_frequency_cycles: null + billing_start_date: '2019-12-19' + delete: + summary: Delete an attached product from a deal + description: 'Deletes a product attachment from a deal, using the `product_attachment_id`.' + x-token-cost: 3 + operationId: deleteDealProduct + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:full' + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: path + name: product_attachment_id + required: true + schema: + type: integer + description: The product attachment ID + responses: + '200': + description: Delete an attached product from a deal + content: + application/json: + schema: + title: DeleteDealProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: The ID of an attached product that was deleted from the deal + example: + success: true + data: + id: 123 + '/deals/{id}/discounts': + get: + summary: List discounts added to a deal + description: Lists discounts attached to a deal. + x-token-cost: 10 + operationId: getAdditionalDiscounts + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + responses: + '200': + description: List of discounts added to deal + content: + application/json: + schema: + title: GetAdditionalDiscountsResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: array + description: Array containing data for all discounts added to a deal + items: + type: object + properties: + id: + type: string + description: The ID of the additional discount + type: + type: string + enum: + - percentage + - amount + description: Determines whether the discount is applied as a percentage or a fixed amount. + amount: + type: number + description: The discount amount. + description: + type: string + description: The name of the discount. + deal_id: + type: integer + description: The ID of the deal the discount was added to. + created_at: + type: string + description: The date and time of when the discount was created in the ISO 8601 format. + created_by: + type: integer + description: The ID of the user that created the discount. + updated_at: + type: string + description: The date and time of when the discount was created in the ISO 8601 format. + updated_by: + type: integer + description: The ID of the user that last updated the discount. + example: + success: true + data: + - id: 30195b0e-7577-4f52-a5cf-f3ee39b9d1e0 + description: 10% + amount: 10 + type: percentage + deal_id: 1 + created_at: '2024-03-12T10:30:05Z' + created_by: 1 + updated_at: '2024-03-12T10:30:05Z' + updated_by: 1 + post: + summary: Add a discount to a deal + description: 'Adds a discount to a deal changing, the deal value if the deal has one-time products attached.' + x-token-cost: 5 + operationId: postAdditionalDiscount + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + title: AddAdditionalDiscountRequestBody + required: + - description + - amount + - type + properties: + description: + type: string + description: The name of the discount. + amount: + type: number + description: The discount amount. Must be a positive number (excluding 0). + type: + type: string + enum: + - percentage + - amount + description: Determines whether the discount is applied as a percentage or a fixed amount. + responses: + '201': + description: Discount added to deal + content: + application/json: + schema: + title: AddAdditionalDiscountResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: string + description: The ID of the additional discount + type: + type: string + enum: + - percentage + - amount + description: Determines whether the discount is applied as a percentage or a fixed amount. + amount: + type: number + description: The discount amount. + description: + type: string + description: The name of the discount. + deal_id: + type: integer + description: The ID of the deal the discount was added to. + created_at: + type: string + description: The date and time of when the discount was created in the ISO 8601 format. + created_by: + type: integer + description: The ID of the user that created the discount. + updated_at: + type: string + description: The date and time of when the discount was created in the ISO 8601 format. + updated_by: + type: integer + description: The ID of the user that last updated the discount. + example: + success: true + data: + id: 30195b0e-7577-4f52-a5cf-f3ee39b9d1e0 + description: 10% + amount: 10 + type: percentage + deal_id: 1 + created_at: '2024-03-12T10:30:05Z' + created_by: 1 + updated_at: '2024-03-12T10:30:05Z' + updated_by: 1 + '/deals/{id}/discounts/{discount_id}': + patch: + summary: Update a discount added to a deal + description: 'Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.' + x-token-cost: 5 + operationId: updateAdditionalDiscount + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: path + name: discount_id + required: true + schema: + type: integer + description: The ID of the discount + requestBody: + content: + application/json: + schema: + title: updateAdditionalDiscountRequestBody + properties: + description: + type: string + description: The name of the discount. + amount: + type: number + description: The discount amount. Must be a positive number (excluding 0). + type: + type: string + enum: + - percentage + - amount + description: Determines whether the discount is applied as a percentage or a fixed amount. + responses: + '200': + description: Edited discount. + content: + application/json: + schema: + title: UpdateAdditionalDiscountResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: string + description: The ID of the additional discount + type: + type: string + enum: + - percentage + - amount + description: Determines whether the discount is applied as a percentage or a fixed amount. + amount: + type: number + description: The discount amount. + description: + type: string + description: The name of the discount. + deal_id: + type: integer + description: The ID of the deal the discount was added to. + created_at: + type: string + description: The date and time of when the discount was created in the ISO 8601 format. + created_by: + type: integer + description: The ID of the user that created the discount. + updated_at: + type: string + description: The date and time of when the discount was created in the ISO 8601 format. + updated_by: + type: integer + description: The ID of the user that last updated the discount. + example: + success: true + data: + id: 30195b0e-7577-4f52-a5cf-f3ee39b9d1e0 + description: 10% + amount: 10 + type: percentage + deal_id: 1 + created_at: '2024-03-12T10:30:05Z' + created_by: 1 + updated_at: '2024-03-12T10:30:05Z' + updated_by: 1 + delete: + summary: Delete a discount from a deal + description: 'Removes a discount from a deal, changing the deal value if the deal has one-time products attached.' + x-token-cost: 3 + operationId: deleteAdditionalDiscount + tags: + - Deals + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: path + name: discount_id + required: true + schema: + type: integer + description: The ID of the discount + responses: + '200': + description: The ID of the deleted discount. + content: + application/json: + schema: + title: DeleteAdditionalDiscountResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: The ID of the discount that was deleted from the deal + example: + success: true + data: + id: 123 + /deals/installments: + get: + summary: List installments added to a list of deals + description: | + Lists installments attached to a list of deals. + + Only available in Advanced and above plans. + x-token-cost: 10 + operationId: getInstallments + tags: + - Deals + - Beta + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: query + name: deal_ids + required: true + schema: + type: array + items: + type: integer + description: An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided. + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `billing_date`, `deal_id`.' + schema: + default: id + type: string + enum: + - id + - billing_date + - deal_id + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + default: asc + type: string + enum: + - asc + - desc + responses: + '200': + description: List installments added to a deal + content: + application/json: + schema: + title: GetInstallmentsResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: array + description: Array containing data for all installments added to a deal + items: + type: object + properties: + id: + type: integer + description: The ID of the installment + amount: + type: number + description: The installment amount. + billing_date: + type: string + description: The date which the installment will be charged. + description: + type: string + description: The name of installment. + deal_id: + type: integer + description: The ID of the deal the installment was added to. + example: + success: true + data: + - id: 1 + amount: 10 + billing_date: '2025-03-10' + deal_id: 1 + description: Delivery Fee + '/deals/{id}/installments': + post: + summary: Add an installment to a deal + description: | + Adds an installment to a deal. + + An installment can only be added if the deal includes at least one one-time product. + If the deal contains at least one recurring product, adding installments is not allowed. + + Only available in Advanced and above plans. + x-token-cost: 5 + operationId: postInstallment + tags: + - Deals + - Beta + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + title: AddInstallmentRequestBody + required: + - description + - amount + - billing_date + properties: + description: + type: string + description: The name of the installment. + amount: + type: number + description: The installment amount. Must be a positive number (excluding 0). + billing_date: + type: string + description: The date which the installment will be charged. Must be in the format YYYY-MM-DD. + responses: + '200': + description: Installment added to deal + content: + application/json: + schema: + title: AddAInstallmentResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: The ID of the installment + amount: + type: number + description: The installment amount. + billing_date: + type: string + description: The date which the installment will be charged. + description: + type: string + description: The name of installment. + deal_id: + type: integer + description: The ID of the deal the installment was added to. + example: + success: true + data: + id: 1 + amount: 10 + billing_date: '2025-03-10' + deal_id: 1 + description: Delivery Fee + '/deals/{id}/installments/{installment_id}': + patch: + summary: Update an installment added to a deal + description: | + Edits an installment added to a deal. + + Only available in Advanced and above plans. + x-token-cost: 5 + operationId: updateInstallment + tags: + - Deals + - Beta + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: path + name: installment_id + required: true + schema: + type: integer + description: The ID of the installment + requestBody: + content: + application/json: + schema: + title: UpdateInstallmentRequestBody + properties: + description: + type: string + description: The name of the installment. + amount: + type: number + description: The installment amount. Must be a positive number (excluding 0). + billing_date: + type: string + description: The date which the installment will be charged. Must be in the format YYYY-MM-DD. + responses: + '200': + description: Edited installment. + content: + application/json: + schema: + title: UpdateInstallmentResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: The ID of the installment + amount: + type: number + description: The installment amount. + billing_date: + type: string + description: The date which the installment will be charged. + description: + type: string + description: The name of installment. + deal_id: + type: integer + description: The ID of the deal the installment was added to. + example: + success: true + data: + id: 1 + amount: 10 + billing_date: '2025-03-10' + deal_id: 1 + description: Delivery Fee + delete: + summary: Delete an installment from a deal + description: | + Removes an installment from a deal. + + Only available in Advanced and above plans. + x-token-cost: 3 + operationId: deleteInstallment + tags: + - Deals + - Beta + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + parameters: + - in: path + name: id + description: The ID of the deal + required: true + schema: + type: integer + - in: path + name: installment_id + required: true + schema: + type: integer + description: The ID of the installment + responses: + '200': + description: The ID of the deleted installment. + content: + application/json: + schema: + title: DeleteInstallmentResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: The ID of the installment that was deleted from the deal + example: + success: true + data: + id: 1 + '/deals/{id}/convert/lead': + post: + security: + - api_key: [] + - oauth2: + - 'deals:full' + tags: + - Deals + - Beta + summary: Convert a deal to a lead (BETA) + description: 'Initiates a conversion of a deal to a lead. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. There are exceptions for entities like invoices or history that are not transferred and remain linked to the original deal. If the conversion is successful, the deal is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/deals/{deal_id}/convert/status/{conversion_id} endpoint.' + operationId: convertDealToLead + x-token-cost: 40 + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The ID of the deal to convert + responses: + '200': + description: Successful response containing payload in the `data` field + content: + application/json: + schema: + title: AddConvertDealToLeadResponse + type: object + properties: + success: + type: boolean + data: + type: object + description: An object containing conversion job id that performs the conversion + required: + - conversion_id + properties: + conversion_id: + description: The ID of the conversion job that can be used to retrieve conversion status and details. The ID has UUID format. + type: string + format: uuid + additional_data: + type: object + nullable: true + example: null + example: + success: true + data: + conversion_id: 4b40248b-945a-4802-b996-60fdff8c5c69 + additional_data: null + '404': + description: A resource describing an error + content: + application/json: + schema: + type: object + title: GetConvertResponse + properties: + success: + type: boolean + example: false + error: + type: string + description: The description of the error + error_info: + type: string + description: A message describing how to solve the problem + data: + type: object + nullable: true + example: null + additional_data: + type: object + nullable: true + example: null + example: + success: false + error: Entity was not found + error_info: Object was not found. + data: null + additional_data: null + '/deals/{id}/convert/status/{conversion_id}': + get: + security: + - api_key: [] + - oauth2: + - 'deals:full' + - 'deals:read' + tags: + - Deals + - Beta + summary: Get Deal conversion status (BETA) + description: 'Returns information about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Lead ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.' + operationId: getDealConversionStatus + x-token-cost: 1 + parameters: + - in: path + name: id + required: true + schema: + type: integer + description: The ID of a deal + - in: path + name: conversion_id + required: true + schema: + type: string + format: uuid + description: The ID of the conversion + responses: + '200': + description: Successful response containing payload in the `data` field + content: + application/json: + example: + success: true + data: + lead_id: 9f3e6e50-9d99-11ee-9538-29c81a92c0d1 + conversion_id: 4b40248b-945a-4802-b996-60fdff8c5c69 + status: completed + additional_data: null + schema: + title: GetConvertResponse + type: object + required: + - success + - data + properties: + success: + type: boolean + data: + type: object + description: An object containing conversion status. After successful conversion the converted entity ID is also present. + required: + - conversion_id + - status + properties: + lead_id: + description: The ID of the new lead. + type: string + format: uuid + deal_id: + description: The ID of the new deal. + type: integer + conversion_id: + description: The ID of the conversion job. The ID can be used to retrieve conversion status and details. The ID has UUID format. + type: string + format: uuid + status: + description: Status of the conversion job. + type: string + enum: + - not_started + - running + - completed + - failed + - rejected + additional_data: + type: object + nullable: true + example: null + '404': + description: A resource describing an error + content: + application/json: + schema: + type: object + title: GetConvertResponse + properties: + success: + type: boolean + example: false + error: + type: string + description: The description of the error + error_info: + type: string + description: A message describing how to solve the problem + data: + type: object + nullable: true + example: null + additional_data: + type: object + nullable: true + example: null + example: + success: false + error: Entity was not found + error_info: Object was not found. + data: null + additional_data: null + /persons: + get: + summary: Get all persons + description: 'Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.' + x-token-cost: 10 + operationId: getPersons + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: query + name: filter_id + schema: + type: integer + description: 'If supplied, only persons matching the specified filter are returned' + - in: query + name: ids + description: 'Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.' + schema: + type: string + - in: query + name: owner_id + schema: + type: integer + description: 'If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.' + - in: query + name: org_id + schema: + type: integer + description: 'If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.' + - in: query + name: updated_since + schema: + type: string + description: 'If set, only persons with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: updated_until + schema: + type: string + description: 'If set, only persons with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `update_time`, `add_time`.' + schema: + type: string + default: id + enum: + - id + - update_time + - add_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. + schema: + type: string + enum: + - next_activity_id + - last_activity_id + - open_deals_count + - related_open_deals_count + - closed_deals_count + - related_closed_deals_count + - participant_open_deals_count + - participant_closed_deals_count + - email_messages_count + - activities_count + - done_activities_count + - undone_activities_count + - files_count + - notes_count + - followers_count + - won_deals_count + - related_won_deals_count + - lost_deals_count + - related_lost_deals_count + - last_incoming_mail_time + - last_outgoing_mail_time + - marketing_status + - doi_status + - in: query + name: custom_fields + description: 'Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Get all persons + content: + application/json: + schema: + type: object + title: GetPersonsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Persons array + items: + type: object + properties: + id: + type: integer + description: The ID of the person + name: + type: string + description: The name of the person + first_name: + type: string + description: The first name of the person + last_name: + type: string + description: The last name of the person + owner_id: + type: integer + description: The ID of the user who owns the person + org_id: + type: integer + description: The ID of the organization linked to the person + add_time: + type: string + description: The creation date and time of the person + update_time: + type: string + description: The last updated date and time of the person + emails: + type: array + description: The emails of the person + items: + type: object + properties: + value: + type: string + description: The email address of the person + primary: + type: boolean + description: Whether the email is primary or not + label: + type: string + description: The email address classification label + phones: + type: array + description: The phones of the person + items: + type: object + properties: + value: + type: string + description: The phone number of the person + primary: + type: boolean + description: Whether the phone number is primary or not + label: + type: string + description: The phone number classification label + is_deleted: + type: boolean + description: Whether the person is deleted or not + visible_to: + type: integer + description: The visibility of the person + label_ids: + type: array + description: The IDs of labels assigned to the person + items: + type: integer + picture_id: + type: integer + description: The ID of the picture associated with the person + postal_address: + type: object + description: 'Postal address of the person, included if contact sync is enabled for the company' + properties: + value: + type: string + description: The full address of the person + country: + type: string + description: Country of the person + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the person + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the person + locality: + type: string + description: Locality (e.g. city) of the person + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the person + route: + type: string + description: Route (e.g. street) of the person + street_number: + type: string + description: Street number of the person + postal_code: + type: string + description: Postal code of the person + notes: + type: string + description: 'Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company' + im: + type: array + description: 'The instant messaging accounts of the person, included if contact sync is enabled for the company' + items: + type: object + properties: + value: + type: string + description: The instant messaging account of the person + primary: + type: boolean + description: Whether the instant messaging account is primary or not + label: + type: string + description: The instant messaging account classification label + birthday: + type: string + description: 'The birthday of the person, included if contact sync is enabled for the company' + job_title: + type: string + description: 'The job title of the person, included if contact sync is enabled for the company' + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + name: Person Name + first_name: Person + last_name: Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + emails: + - value: email1@email.com + primary: true + label: work + - value: email2@email.com + primary: false + label: home + phones: + - value: '12345' + primary: true + label: work + - value: '54321' + primary: false + label: home + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + picture_id: 1 + custom_fields: {} + notes: Notes from contact sync + im: + - value: skypeusername + primary: true + label: skype + - value: whatsappusername + primary: false + label: whatsapp + birthday: '2000-12-31' + job_title: Manager + postal_address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a new person + description: 'Adds a new person. If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field.' + x-token-cost: 5 + operationId: addPerson + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:full' + requestBody: + content: + application/json: + schema: + required: + - title + type: object + properties: + name: + type: string + description: The name of the person + owner_id: + type: integer + description: The ID of the user who owns the person + org_id: + type: integer + description: The ID of the organization linked to the person + add_time: + type: string + description: The creation date and time of the person + update_time: + type: string + description: The last updated date and time of the person + emails: + type: array + description: The emails of the person + items: + type: object + properties: + value: + type: string + description: The email address of the person + primary: + type: boolean + description: Whether the email is primary or not + label: + type: boolean + description: The email address classification label + phones: + type: array + description: The phones of the person + items: + type: object + properties: + value: + type: string + description: The phone number of the person + primary: + type: boolean + description: Whether the phone number is primary or not + label: + type: boolean + description: The phone number classification label + visible_to: + type: integer + description: The visibility of the person + label_ids: + type: array + description: The IDs of labels assigned to the person + items: + type: integer + marketing_status: + type: string + description: 'If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.
ValueDescription
`no_consent`The customer has not given consent to receive any marketing communications
`unsubscribed`The customers have unsubscribed from ALL marketing communications
`subscribed`The customers are subscribed and are counted towards marketing caps
`archived`The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for
' + enum: + - no_consent + - unsubscribed + - subscribed + - archived + responses: + '200': + description: Add person + content: + application/json: + schema: + type: object + title: UpsertPersonResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertPersonResponseData + properties: + data: + type: object + properties: + id: + type: integer + description: The ID of the person + name: + type: string + description: The name of the person + first_name: + type: string + description: The first name of the person + last_name: + type: string + description: The last name of the person + owner_id: + type: integer + description: The ID of the user who owns the person + org_id: + type: integer + description: The ID of the organization linked to the person + add_time: + type: string + description: The creation date and time of the person + update_time: + type: string + description: The last updated date and time of the person + emails: + type: array + description: The emails of the person + items: + type: object + properties: + value: + type: string + description: The email address of the person + primary: + type: boolean + description: Whether the email is primary or not + label: + type: string + description: The email address classification label + phones: + type: array + description: The phones of the person + items: + type: object + properties: + value: + type: string + description: The phone number of the person + primary: + type: boolean + description: Whether the phone number is primary or not + label: + type: string + description: The phone number classification label + is_deleted: + type: boolean + description: Whether the person is deleted or not + visible_to: + type: integer + description: The visibility of the person + label_ids: + type: array + description: The IDs of labels assigned to the person + items: + type: integer + picture_id: + type: integer + description: The ID of the picture associated with the person + postal_address: + type: object + description: 'Postal address of the person, included if contact sync is enabled for the company' + properties: + value: + type: string + description: The full address of the person + country: + type: string + description: Country of the person + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the person + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the person + locality: + type: string + description: Locality (e.g. city) of the person + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the person + route: + type: string + description: Route (e.g. street) of the person + street_number: + type: string + description: Street number of the person + postal_code: + type: string + description: Postal code of the person + notes: + type: string + description: 'Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company' + im: + type: array + description: 'The instant messaging accounts of the person, included if contact sync is enabled for the company' + items: + type: object + properties: + value: + type: string + description: The instant messaging account of the person + primary: + type: boolean + description: Whether the instant messaging account is primary or not + label: + type: string + description: The instant messaging account classification label + birthday: + type: string + description: 'The birthday of the person, included if contact sync is enabled for the company' + job_title: + type: string + description: 'The job title of the person, included if contact sync is enabled for the company' + description: The person object + example: + success: true + data: + id: 1 + name: Person Name + first_name: Person + last_name: Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + emails: + - value: email1@email.com + primary: true + label: work + - value: email2@email.com + primary: false + label: home + phones: + - value: '12345' + primary: true + label: work + - value: '54321' + primary: false + label: home + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + picture_id: 1 + custom_fields: {} + notes: Notes from contact sync + im: + - value: skypeusername + primary: true + label: skype + - value: whatsappusername + primary: false + label: whatsapp + birthday: '2000-12-31' + job_title: Manager + postal_address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + '/persons/{id}': + delete: + summary: Delete a person + description: 'Marks a person as deleted. After 30 days, the person will be permanently deleted.' + x-token-cost: 3 + operationId: deletePerson + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the person + required: true + schema: + type: integer + responses: + '200': + description: Delete person + content: + application/json: + schema: + title: DeletePersonResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: Deleted person ID + example: + success: true + data: + id: 1 + get: + summary: Get details of a person + description: 'Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.' + x-token-cost: 1 + operationId: getPerson + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the person + required: true + schema: + type: integer + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include. `marketing_status` and `doi_status` can only be included if the company has marketing app enabled. + schema: + type: string + enum: + - next_activity_id + - last_activity_id + - open_deals_count + - related_open_deals_count + - closed_deals_count + - related_closed_deals_count + - participant_open_deals_count + - participant_closed_deals_count + - email_messages_count + - activities_count + - done_activities_count + - undone_activities_count + - files_count + - notes_count + - followers_count + - won_deals_count + - related_won_deals_count + - lost_deals_count + - related_lost_deals_count + - last_incoming_mail_time + - last_outgoing_mail_time + - marketing_status + - doi_status + - in: query + name: custom_fields + description: 'Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + responses: + '200': + description: Get person + content: + application/json: + schema: + type: object + title: UpsertPersonResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertPersonResponseData + properties: + data: + type: object + properties: + id: + type: integer + description: The ID of the person + name: + type: string + description: The name of the person + first_name: + type: string + description: The first name of the person + last_name: + type: string + description: The last name of the person + owner_id: + type: integer + description: The ID of the user who owns the person + org_id: + type: integer + description: The ID of the organization linked to the person + add_time: + type: string + description: The creation date and time of the person + update_time: + type: string + description: The last updated date and time of the person + emails: + type: array + description: The emails of the person + items: + type: object + properties: + value: + type: string + description: The email address of the person + primary: + type: boolean + description: Whether the email is primary or not + label: + type: string + description: The email address classification label + phones: + type: array + description: The phones of the person + items: + type: object + properties: + value: + type: string + description: The phone number of the person + primary: + type: boolean + description: Whether the phone number is primary or not + label: + type: string + description: The phone number classification label + is_deleted: + type: boolean + description: Whether the person is deleted or not + visible_to: + type: integer + description: The visibility of the person + label_ids: + type: array + description: The IDs of labels assigned to the person + items: + type: integer + picture_id: + type: integer + description: The ID of the picture associated with the person + postal_address: + type: object + description: 'Postal address of the person, included if contact sync is enabled for the company' + properties: + value: + type: string + description: The full address of the person + country: + type: string + description: Country of the person + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the person + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the person + locality: + type: string + description: Locality (e.g. city) of the person + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the person + route: + type: string + description: Route (e.g. street) of the person + street_number: + type: string + description: Street number of the person + postal_code: + type: string + description: Postal code of the person + notes: + type: string + description: 'Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company' + im: + type: array + description: 'The instant messaging accounts of the person, included if contact sync is enabled for the company' + items: + type: object + properties: + value: + type: string + description: The instant messaging account of the person + primary: + type: boolean + description: Whether the instant messaging account is primary or not + label: + type: string + description: The instant messaging account classification label + birthday: + type: string + description: 'The birthday of the person, included if contact sync is enabled for the company' + job_title: + type: string + description: 'The job title of the person, included if contact sync is enabled for the company' + description: The person object + example: + success: true + data: + id: 1 + name: Person Name + first_name: Person + last_name: Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + emails: + - value: email1@email.com + primary: true + label: work + - value: email2@email.com + primary: false + label: home + phones: + - value: '12345' + primary: true + label: work + - value: '54321' + primary: false + label: home + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + picture_id: 1 + custom_fields: {} + notes: Notes from contact sync + im: + - value: skypeusername + primary: true + label: skype + - value: whatsappusername + primary: false + label: whatsapp + birthday: '2000-12-31' + job_title: Manager + postal_address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + patch: + summary: Update a person + description: 'Updates the properties of a person.
If the company uses the [Campaigns product](https://pipedrive.readme.io/docs/campaigns-in-pipedrive-api), then this endpoint will also accept and return the `marketing_status` field.' + x-token-cost: 5 + operationId: updatePerson + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the person + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the person + owner_id: + type: integer + description: The ID of the user who owns the person + org_id: + type: integer + description: The ID of the organization linked to the person + add_time: + type: string + description: The creation date and time of the person + update_time: + type: string + description: The last updated date and time of the person + emails: + type: array + description: The emails of the person + items: + type: object + properties: + value: + type: string + description: The email address of the person + primary: + type: boolean + description: Whether the email is primary or not + label: + type: boolean + description: The email address classification label + phones: + type: array + description: The phones of the person + items: + type: object + properties: + value: + type: string + description: The phone number of the person + primary: + type: boolean + description: Whether the phone number is primary or not + label: + type: boolean + description: The phone number classification label + visible_to: + type: integer + description: The visibility of the person + label_ids: + type: array + description: The IDs of labels assigned to the person + items: + type: integer + marketing_status: + type: string + description: 'If the person does not have a valid email address, then the marketing status is **not set** and `no_consent` is returned for the `marketing_status` value when the new person is created. If the change is forbidden, the status will remain unchanged for every call that tries to modify the marketing status. Please be aware that it is only allowed **once** to change the marketing status from an old status to a new one.
ValueDescription
`no_consent`The customer has not given consent to receive any marketing communications
`unsubscribed`The customers have unsubscribed from ALL marketing communications
`subscribed`The customers are subscribed and are counted towards marketing caps
`archived`The customers with `subscribed` status can be moved to `archived` to save consent, but they are not paid for
' + enum: + - no_consent + - unsubscribed + - subscribed + - archived + responses: + '200': + description: Edit person + content: + application/json: + schema: + type: object + title: UpsertPersonResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertPersonResponseData + properties: + data: + type: object + properties: + id: + type: integer + description: The ID of the person + name: + type: string + description: The name of the person + first_name: + type: string + description: The first name of the person + last_name: + type: string + description: The last name of the person + owner_id: + type: integer + description: The ID of the user who owns the person + org_id: + type: integer + description: The ID of the organization linked to the person + add_time: + type: string + description: The creation date and time of the person + update_time: + type: string + description: The last updated date and time of the person + emails: + type: array + description: The emails of the person + items: + type: object + properties: + value: + type: string + description: The email address of the person + primary: + type: boolean + description: Whether the email is primary or not + label: + type: string + description: The email address classification label + phones: + type: array + description: The phones of the person + items: + type: object + properties: + value: + type: string + description: The phone number of the person + primary: + type: boolean + description: Whether the phone number is primary or not + label: + type: string + description: The phone number classification label + is_deleted: + type: boolean + description: Whether the person is deleted or not + visible_to: + type: integer + description: The visibility of the person + label_ids: + type: array + description: The IDs of labels assigned to the person + items: + type: integer + picture_id: + type: integer + description: The ID of the picture associated with the person + postal_address: + type: object + description: 'Postal address of the person, included if contact sync is enabled for the company' + properties: + value: + type: string + description: The full address of the person + country: + type: string + description: Country of the person + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the person + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the person + locality: + type: string + description: Locality (e.g. city) of the person + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the person + route: + type: string + description: Route (e.g. street) of the person + street_number: + type: string + description: Street number of the person + postal_code: + type: string + description: Postal code of the person + notes: + type: string + description: 'Contact sync notes of the person, maximum 10 000 characters, included if contact sync is enabled for the company' + im: + type: array + description: 'The instant messaging accounts of the person, included if contact sync is enabled for the company' + items: + type: object + properties: + value: + type: string + description: The instant messaging account of the person + primary: + type: boolean + description: Whether the instant messaging account is primary or not + label: + type: string + description: The instant messaging account classification label + birthday: + type: string + description: 'The birthday of the person, included if contact sync is enabled for the company' + job_title: + type: string + description: 'The job title of the person, included if contact sync is enabled for the company' + description: The person object + example: + success: true + data: + id: 1 + name: Person Name + first_name: Person + last_name: Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + emails: + - value: email1@email.com + primary: true + label: work + - value: email2@email.com + primary: false + label: home + phones: + - value: '12345' + primary: true + label: work + - value: '54321' + primary: false + label: home + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + picture_id: 1 + custom_fields: {} + notes: Notes from contact sync + im: + - value: skypeusername + primary: true + label: skype + - value: whatsappusername + primary: false + label: whatsapp + birthday: '2000-12-31' + job_title: Manager + postal_address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + '/persons/{id}/followers': + get: + summary: List followers of a person + description: Lists users who are following the person. + x-token-cost: 10 + operationId: getPersonFollowers + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the person + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowersResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Followers array + items: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - user_id: 1 + add_time: '2021-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a follower to a person + description: Adds a user as a follower to the person. + x-token-cost: 5 + operationId: addPersonFollower + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the person + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + required: + - user_id + type: object + properties: + user_id: + type: integer + description: The ID of the user to add as a follower + responses: + '201': + description: Add a follower + content: + application/json: + schema: + type: object + title: AddFollowerResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + description: The follower object + example: + success: true + data: + user_id: 1 + add_time: '2021-01-01T00:00:00Z' + '/persons/{id}/followers/changelog': + get: + summary: List followers changelog of a person + description: Lists changelogs about users have followed the person. + x-token-cost: 10 + operationId: getPersonFollowersChangelog + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the person + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowerChangelogsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Follower changelogs array + items: + type: object + title: FollowerChangelogItem + properties: + action: + type: string + description: The type of change + actor_user_id: + type: integer + description: The ID of the user who did the change + follower_user_id: + type: integer + description: The ID of the user who was following the entity + time: + type: string + description: The time at which the change happened + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - action: added + actor_user_id: 1 + follower_user_id: 1 + time: '2024-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/persons/{id}/followers/{follower_id}': + delete: + summary: Delete a follower from a person + description: Deletes a user follower from the person. + x-token-cost: 3 + operationId: deletePersonFollower + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the person + required: true + schema: + type: integer + - in: path + name: follower_id + required: true + schema: + type: integer + description: The ID of the following user + responses: + '200': + description: Remove a follower + content: + application/json: + schema: + title: DeleteFollowerResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + user_id: + type: integer + description: Deleted follower user ID + example: + success: true + data: + user_id: 1 + /organizations: + get: + summary: Get all organizations + description: Returns data about all organizations. + x-token-cost: 10 + operationId: getOrganizations + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: query + name: filter_id + schema: + type: integer + description: 'If supplied, only organizations matching the specified filter are returned' + - in: query + name: ids + description: 'Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.' + schema: + type: string + - in: query + name: owner_id + schema: + type: integer + description: 'If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored.' + - in: query + name: updated_since + schema: + type: string + description: 'If set, only organizations with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: updated_until + schema: + type: string + description: 'If set, only organizations with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.' + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `update_time`, `add_time`.' + schema: + type: string + default: id + enum: + - id + - update_time + - add_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include + schema: + type: string + enum: + - next_activity_id + - last_activity_id + - open_deals_count + - related_open_deals_count + - closed_deals_count + - related_closed_deals_count + - email_messages_count + - people_count + - activities_count + - done_activities_count + - undone_activities_count + - files_count + - notes_count + - followers_count + - won_deals_count + - related_won_deals_count + - lost_deals_count + - related_lost_deals_count + - in: query + name: custom_fields + description: 'Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Get all organizations + content: + application/json: + schema: + type: object + title: GetOrganizationsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Organizations array + items: + type: object + title: OrganizationItem + properties: + id: + type: integer + description: The ID of the organization + name: + type: string + description: The name of the organization + owner_id: + type: integer + description: The ID of the user who owns the organization + add_time: + type: string + description: The creation date and time of the organization + update_time: + type: string + description: The last updated date and time of the organization + is_deleted: + type: boolean + description: Whether the organization is deleted or not + visible_to: + type: integer + description: The visibility of the organization + address: + type: object + properties: + value: + type: string + description: The full address of the organization + country: + type: string + description: Country of the organization + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the organization + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the organization + locality: + type: string + description: Locality (e.g. city) of the organization + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the organization + route: + type: string + description: Route (e.g. street) of the organization + street_number: + type: string + description: Street number of the organization + postal_code: + type: string + description: Postal code of the organization + label_ids: + type: array + description: The IDs of labels assigned to the organization + items: + type: integer + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + name: Organization Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + custom_fields: {} + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a new organization + description: Adds a new organization. + x-token-cost: 5 + operationId: addOrganization + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:full' + requestBody: + content: + application/json: + schema: + required: + - title + type: object + properties: + name: + type: string + description: The name of the organization + owner_id: + type: integer + description: The ID of the user who owns the organization + add_time: + type: string + description: The creation date and time of the organization + update_time: + type: string + description: The last updated date and time of the organization + visible_to: + type: integer + description: The visibility of the organization + label_ids: + type: array + description: The IDs of labels assigned to the organization + items: + type: integer + responses: + '200': + description: Add organization + content: + application/json: + schema: + type: object + title: UpsertOrganizationResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertOrganizationResponseData + properties: + data: + type: object + title: OrganizationItem + properties: + id: + type: integer + description: The ID of the organization + name: + type: string + description: The name of the organization + owner_id: + type: integer + description: The ID of the user who owns the organization + add_time: + type: string + description: The creation date and time of the organization + update_time: + type: string + description: The last updated date and time of the organization + is_deleted: + type: boolean + description: Whether the organization is deleted or not + visible_to: + type: integer + description: The visibility of the organization + address: + type: object + properties: + value: + type: string + description: The full address of the organization + country: + type: string + description: Country of the organization + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the organization + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the organization + locality: + type: string + description: Locality (e.g. city) of the organization + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the organization + route: + type: string + description: Route (e.g. street) of the organization + street_number: + type: string + description: Street number of the organization + postal_code: + type: string + description: Postal code of the organization + label_ids: + type: array + description: The IDs of labels assigned to the organization + items: + type: integer + description: The organization object + example: + success: true + data: + id: 1 + name: Organization Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + custom_fields: {} + '/organizations/{id}': + delete: + summary: Delete a organization + description: 'Marks a organization as deleted. After 30 days, the organization will be permanently deleted.' + x-token-cost: 3 + operationId: deleteOrganization + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the organization + required: true + schema: + type: integer + responses: + '200': + description: Delete organization + content: + application/json: + schema: + title: DeleteOrganizationResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: Deleted organization ID + example: + success: true + data: + id: 1 + get: + summary: Get details of a organization + description: Returns the details of a specific organization. + x-token-cost: 1 + operationId: getOrganization + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the organization + required: true + schema: + type: integer + - in: query + name: include_fields + description: Optional comma separated string array of additional fields to include + schema: + type: string + enum: + - next_activity_id + - last_activity_id + - open_deals_count + - related_open_deals_count + - closed_deals_count + - related_closed_deals_count + - email_messages_count + - people_count + - activities_count + - done_activities_count + - undone_activities_count + - files_count + - notes_count + - followers_count + - won_deals_count + - related_won_deals_count + - lost_deals_count + - related_lost_deals_count + - in: query + name: custom_fields + description: 'Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + responses: + '200': + description: Get organization + content: + application/json: + schema: + type: object + title: UpsertOrganizationResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertOrganizationResponseData + properties: + data: + type: object + title: OrganizationItem + properties: + id: + type: integer + description: The ID of the organization + name: + type: string + description: The name of the organization + owner_id: + type: integer + description: The ID of the user who owns the organization + add_time: + type: string + description: The creation date and time of the organization + update_time: + type: string + description: The last updated date and time of the organization + is_deleted: + type: boolean + description: Whether the organization is deleted or not + visible_to: + type: integer + description: The visibility of the organization + address: + type: object + properties: + value: + type: string + description: The full address of the organization + country: + type: string + description: Country of the organization + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the organization + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the organization + locality: + type: string + description: Locality (e.g. city) of the organization + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the organization + route: + type: string + description: Route (e.g. street) of the organization + street_number: + type: string + description: Street number of the organization + postal_code: + type: string + description: Postal code of the organization + label_ids: + type: array + description: The IDs of labels assigned to the organization + items: + type: integer + description: The organization object + example: + success: true + data: + id: 1 + name: Organization Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + custom_fields: {} + patch: + summary: Update a organization + description: Updates the properties of a organization. + x-token-cost: 5 + operationId: updateOrganization + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the organization + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the organization + owner_id: + type: integer + description: The ID of the user who owns the organization + add_time: + type: string + description: The creation date and time of the organization + update_time: + type: string + description: The last updated date and time of the organization + visible_to: + type: integer + description: The visibility of the organization + label_ids: + type: array + description: The IDs of labels assigned to the organization + items: + type: integer + responses: + '200': + description: Edit organization + content: + application/json: + schema: + type: object + title: UpsertOrganizationResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertOrganizationResponseData + properties: + data: + type: object + title: OrganizationItem + properties: + id: + type: integer + description: The ID of the organization + name: + type: string + description: The name of the organization + owner_id: + type: integer + description: The ID of the user who owns the organization + add_time: + type: string + description: The creation date and time of the organization + update_time: + type: string + description: The last updated date and time of the organization + is_deleted: + type: boolean + description: Whether the organization is deleted or not + visible_to: + type: integer + description: The visibility of the organization + address: + type: object + properties: + value: + type: string + description: The full address of the organization + country: + type: string + description: Country of the organization + admin_area_level_1: + type: string + description: Admin area level 1 (e.g. state) of the organization + admin_area_level_2: + type: string + description: Admin area level 2 (e.g. county) of the organization + locality: + type: string + description: Locality (e.g. city) of the organization + sublocality: + type: string + description: Sublocality (e.g. neighborhood) of the organization + route: + type: string + description: Route (e.g. street) of the organization + street_number: + type: string + description: Street number of the organization + postal_code: + type: string + description: Postal code of the organization + label_ids: + type: array + description: The IDs of labels assigned to the organization + items: + type: integer + description: The organization object + example: + success: true + data: + id: 1 + name: Organization Name + owner_id: 1 + org_id: 1 + add_time: '2021-01-01T00:00:00Z' + update_time: '2021-01-01T00:00:00Z' + address: + value: 123 Main St + country: USA + admin_area_level_1: CA + admin_area_level_2: Santa Clara + locality: Sunnyvale + sublocality: Downtown + route: Main St + street_number: '123' + postal_code: '94085' + is_deleted: false + visible_to: 7 + label_ids: + - 1 + - 2 + - 3 + custom_fields: {} + '/organizations/{id}/followers': + get: + summary: List followers of an organization + description: Lists users who are following the organization. + x-token-cost: 10 + operationId: getOrganizationFollowers + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the organization + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowersResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Followers array + items: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - user_id: 1 + add_time: '2021-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a follower to an organization + description: Adds a user as a follower to the organization. + x-token-cost: 5 + operationId: addOrganizationFollower + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the organization + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + required: + - user_id + type: object + properties: + user_id: + type: integer + description: The ID of the user to add as a follower + responses: + '201': + description: Add a follower + content: + application/json: + schema: + type: object + title: AddFollowerResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + description: The follower object + example: + success: true + data: + user_id: 1 + add_time: '2021-01-01T00:00:00Z' + '/organizations/{id}/followers/changelog': + get: + summary: List followers changelog of an organization + description: Lists changelogs about users have followed the organization. + x-token-cost: 10 + operationId: getOrganizationFollowersChangelog + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the organization + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowerChangelogsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Follower changelogs array + items: + type: object + title: FollowerChangelogItem + properties: + action: + type: string + description: The type of change + actor_user_id: + type: integer + description: The ID of the user who did the change + follower_user_id: + type: integer + description: The ID of the user who was following the entity + time: + type: string + description: The time at which the change happened + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - action: added + actor_user_id: 1 + follower_user_id: 1 + time: '2024-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/organizations/{id}/followers/{follower_id}': + delete: + summary: Delete a follower from an organization + description: Deletes a user follower from the organization. + x-token-cost: 3 + operationId: deleteOrganizationFollower + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:full' + parameters: + - in: path + name: id + description: The ID of the organization + required: true + schema: + type: integer + - in: path + name: follower_id + required: true + schema: + type: integer + description: The ID of the following user + responses: + '200': + description: Remove a follower + content: + application/json: + schema: + title: DeleteFollowerResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + user_id: + type: integer + description: Deleted follower user ID + example: + success: true + data: + user_id: 1 + /products: + get: + summary: Get all products + description: Returns data about all products. + x-token-cost: 10 + operationId: getProducts + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + parameters: + - in: query + name: owner_id + schema: + type: integer + description: 'If supplied, only products owned by the given user will be returned' + - in: query + name: ids + description: 'Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.' + schema: + type: string + - in: query + name: filter_id + schema: + type: integer + description: The ID of the filter to use + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `name`, `add_time`, `update_time`.' + schema: + type: string + default: id + enum: + - id + - name + - add_time + - update_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: custom_fields + description: 'Comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for a smaller response.
A maximum of 15 keys is allowed.' + schema: + type: string + responses: + '200': + description: List of products + content: + application/json: + schema: + title: GetProductsResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: array + description: Array containing data for all products + items: + title: GetProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + allOf: + - title: BaseProduct + allOf: + - type: object + properties: + id: + type: number + description: The ID of the product + name: + type: string + description: The name of the product + code: + type: string + description: The product code + unit: + type: string + description: The unit in which this product is sold + tax: + type: number + description: The tax percentage + default: 0 + is_deleted: + type: boolean + description: Whether this product will be made marked as deleted or not + default: false + is_linkable: + type: boolean + description: Whether this product can be added to a deal or not + default: true + visible_to: + allOf: + - type: number + enum: + - 1 + - 3 + - 5 + - 7 + description: Visibility of the product + owner_id: + type: integer + description: Information about the Pipedrive user who owns the product + custom_fields: + type: object + additionalProperties: true + description: An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + title: PricesArray + properties: + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: product_id (number), currency (string), price (number), cost (number), direct_cost (number | null), notes (string)' + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + name: Mechanical Pencil + code: MPENCIL + description: Product description + unit: '' + tax: 0 + category: Retail + is_linkable: true + is_deleted: false + visible_to: 3 + owner_id: 1234 + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + billing_frequency: monthly + billing_frequency_cycles: 4 + prices: + - product_id: 1 + price: 5 + currency: EUR + cost: 2 + direct_cost: 1 + notes: this is a note + custom_fields: + 6d74315176adcc4c97108440449b93ba57d20704: 16 + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a product + description: 'Adds a new product to the Products inventory. For more information, see the tutorial for adding a product.' + x-token-cost: 5 + operationId: addProduct + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + requestBody: + content: + application/json: + schema: + title: addProductRequest + allOf: + - required: + - name + type: object + properties: + name: + type: string + description: The name of the product. Cannot be an empty string + - title: productRequest + type: object + properties: + code: + type: string + description: The product code + description: + type: string + description: The product description + unit: + type: string + description: The unit in which this product is sold + tax: + type: number + description: The tax percentage + default: 0 + category: + type: number + description: The category of the product + owner_id: + type: integer + description: 'The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used' + is_linkable: + type: boolean + description: Whether this product can be added to a deal or not + default: true + visible_to: + type: number + allOf: + - type: number + enum: + - 1 + - 3 + - 5 + - 7 + description: 'The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner''s visibility group
`5`Owner''s visibility group and sub-groups
`7`Entire company
' + prices: + type: array + items: + type: object + description: 'An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `direct_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and the user''s default currency will be assigned.' + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + responses: + '201': + description: Add product data + content: + application/json: + schema: + title: GetProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + allOf: + - title: BaseProduct + allOf: + - type: object + properties: + id: + type: number + description: The ID of the product + name: + type: string + description: The name of the product + code: + type: string + description: The product code + unit: + type: string + description: The unit in which this product is sold + tax: + type: number + description: The tax percentage + default: 0 + is_deleted: + type: boolean + description: Whether this product will be made marked as deleted or not + default: false + is_linkable: + type: boolean + description: Whether this product can be added to a deal or not + default: true + visible_to: + allOf: + - type: number + enum: + - 1 + - 3 + - 5 + - 7 + description: Visibility of the product + owner_id: + type: integer + description: Information about the Pipedrive user who owns the product + custom_fields: + type: object + additionalProperties: true + description: An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + title: PricesArray + properties: + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: product_id (number), currency (string), price (number), cost (number), direct_cost (number | null), notes (string)' + example: + success: true + data: + id: 1 + name: Mechanical Pencil + code: MPENCIL + description: Product description + unit: '' + tax: 0 + category: Retail + is_linkable: true + is_deleted: false + visible_to: 3 + owner_id: 1234 + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + billing_frequency: monthly + billing_frequency_cycles: 4 + prices: + - product_id: 1 + price: 5 + currency: EUR + cost: 2 + direct_cost: 1 + notes: this is a note + custom_fields: + 6d74315176adcc4c97108440449b93ba57d20704: 16 + '/products/{id}/followers': + get: + summary: List followers of a product + description: Lists users who are following the product. + x-token-cost: 10 + operationId: getProductFollowers + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowersResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Followers array + items: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - user_id: 1 + add_time: '2021-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a follower to a product + description: Adds a user as a follower to the product. + x-token-cost: 5 + operationId: addProductFollower + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + required: + - user_id + type: object + properties: + user_id: + type: integer + description: The ID of the user to add as a follower + responses: + '201': + description: Add a follower + content: + application/json: + schema: + type: object + title: AddFollowerResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + description: The follower object + example: + success: true + data: + user_id: 1 + add_time: '2021-01-01T00:00:00Z' + '/products/{id}/followers/changelog': + get: + summary: List followers changelog of a product + description: Lists changelogs about users have followed the product. + x-token-cost: 10 + operationId: getProductFollowersChangelog + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowerChangelogsResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Follower changelogs array + items: + type: object + title: FollowerChangelogItem + properties: + action: + type: string + description: The type of change + actor_user_id: + type: integer + description: The ID of the user who did the change + follower_user_id: + type: integer + description: The ID of the user who was following the entity + time: + type: string + description: The time at which the change happened + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - action: added + actor_user_id: 1 + follower_user_id: 1 + time: '2024-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/products/{id}/followers/{follower_id}': + delete: + summary: Delete a follower from a product + description: Deletes a user follower from the product. + x-token-cost: 3 + operationId: deleteProductFollower + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + - in: path + name: follower_id + required: true + schema: + type: integer + description: The ID of the following user + responses: + '200': + description: Remove a follower + content: + application/json: + schema: + title: DeleteFollowerResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + user_id: + type: integer + description: Deleted follower user ID + example: + success: true + data: + user_id: 1 + /products/search: + get: + summary: Search products + description: 'Searches all products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope.' + x-token-cost: 20 + operationId: searchProducts + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + - 'search:read' + parameters: + - in: query + name: term + required: true + schema: + type: string + description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + - in: query + name: fields + schema: + type: string + enum: + - code + - custom_fields + - name + description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields here.' + - in: query + name: exact_match + schema: + type: boolean + description: 'When enabled, only full exact matches against the given term are returned. It is not case sensitive.' + - in: query + name: include_fields + schema: + type: string + enum: + - product.price + description: Supports including optional fields in the results which are not provided by default + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Success + content: + application/json: + schema: + title: GetProductSearchResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + properties: + items: + type: array + description: The array of found items + items: + type: object + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + properties: + id: + type: integer + description: The ID of the product + type: + type: string + description: The type of the item + name: + type: string + description: The name of the product + code: + type: integer + description: The code of the product + visible_to: + type: integer + description: The visibility of the product + owner: + type: object + properties: + id: + type: integer + description: The ID of the owner of the product + custom_fields: + type: array + items: + type: string + description: The custom fields + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + items: + - result_score: 0.8766 + item: + id: 1 + type: product + name: Some product + code: 123 + visible_to: 3 + owner: + id: 1 + custom_fields: [] + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/products/{id}': + delete: + summary: Delete a product + description: 'Marks a product as deleted. After 30 days, the product will be permanently deleted.' + x-token-cost: 3 + operationId: deleteProduct + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + responses: + '200': + description: Deletes a product + content: + application/json: + schema: + title: DeleteProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + description: The ID of the removed product + type: integer + example: + success: true + data: + id: 1 + get: + summary: Get one product + description: Returns data about a specific product. + x-token-cost: 1 + operationId: getProduct + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + responses: + '200': + description: Get product information by id + content: + application/json: + schema: + title: GetProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + allOf: + - title: BaseProduct + allOf: + - type: object + properties: + id: + type: number + description: The ID of the product + name: + type: string + description: The name of the product + code: + type: string + description: The product code + unit: + type: string + description: The unit in which this product is sold + tax: + type: number + description: The tax percentage + default: 0 + is_deleted: + type: boolean + description: Whether this product will be made marked as deleted or not + default: false + is_linkable: + type: boolean + description: Whether this product can be added to a deal or not + default: true + visible_to: + allOf: + - type: number + enum: + - 1 + - 3 + - 5 + - 7 + description: Visibility of the product + owner_id: + type: integer + description: Information about the Pipedrive user who owns the product + custom_fields: + type: object + additionalProperties: true + description: An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + title: PricesArray + properties: + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: product_id (number), currency (string), price (number), cost (number), direct_cost (number | null), notes (string)' + example: + success: true + data: + id: 1 + name: Mechanical Pencil + code: MPENCIL + description: Product description + unit: '' + tax: 0 + category: Retail + is_linkable: true + is_deleted: false + visible_to: 3 + owner_id: 1234 + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + billing_frequency: monthly + billing_frequency_cycles: 4 + prices: + - product_id: 1 + price: 5 + currency: EUR + cost: 2 + direct_cost: 1 + notes: this is a note + custom_fields: + 6d74315176adcc4c97108440449b93ba57d20704: 16 + patch: + summary: Update a product + description: Updates product data. + x-token-cost: 5 + operationId: updateProduct + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + title: updateProductRequest + allOf: + - type: object + properties: + name: + type: string + description: The name of the product. Cannot be an empty string + - title: productRequest + type: object + properties: + code: + type: string + description: The product code + description: + type: string + description: The product description + unit: + type: string + description: The unit in which this product is sold + tax: + type: number + description: The tax percentage + default: 0 + category: + type: number + description: The category of the product + owner_id: + type: integer + description: 'The ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used' + is_linkable: + type: boolean + description: Whether this product can be added to a deal or not + default: true + visible_to: + type: number + allOf: + - type: number + enum: + - 1 + - 3 + - 5 + - 7 + description: 'The visibility of the product. If omitted, the visibility will be set to the default visibility setting of this item type for the authorized user. Read more about visibility groups here.

Essential / Advanced plan

ValueDescription
`1`Owner & followers
`3`Entire company

Professional / Enterprise plan

ValueDescription
`1`Owner only
`3`Owner''s visibility group
`5`Owner''s visibility group and sub-groups
`7`Entire company
' + prices: + type: array + items: + type: object + description: 'An array of objects, each containing: `currency` (string), `price` (number), `cost` (number, optional), `direct_cost` (number, optional). Note that there can only be one price per product per currency. When `prices` is omitted altogether, a default price of 0 and the user''s default currency will be assigned.' + - type: object + properties: + billing_frequency: + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + - type: object + properties: + billing_frequency_cycles: + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + responses: + '200': + description: Updates product data + content: + application/json: + schema: + title: UpdateProductResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + allOf: + - title: BaseProduct + allOf: + - type: object + properties: + id: + type: number + description: The ID of the product + name: + type: string + description: The name of the product + code: + type: string + description: The product code + unit: + type: string + description: The unit in which this product is sold + tax: + type: number + description: The tax percentage + default: 0 + is_deleted: + type: boolean + description: Whether this product will be made marked as deleted or not + default: false + is_linkable: + type: boolean + description: Whether this product can be added to a deal or not + default: true + visible_to: + allOf: + - type: number + enum: + - 1 + - 3 + - 5 + - 7 + description: Visibility of the product + owner_id: + type: integer + description: Information about the Pipedrive user who owns the product + custom_fields: + type: object + additionalProperties: true + description: An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes + - type: object + properties: + billing_frequency: + default: one-time + type: string + enum: + - one-time + - annually + - semi-annually + - quarterly + - monthly + - weekly + description: | + Only available in Advanced and above plans + + How often a customer is billed for access to a service or product + - type: object + properties: + billing_frequency_cycles: + default: null + type: integer + nullable: true + description: | + Only available in Advanced and above plans + + The number of times the billing frequency repeats for a product in a deal + + When `billing_frequency` is set to `one-time`, this field must be `null` + + When `billing_frequency` is set to `weekly`, this field cannot be `null` + + For all the other values of `billing_frequency`, `null` represents a product billed indefinitely + + Must be a positive integer less or equal to 208 + - type: object + title: PricesArray + properties: + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: product_id (number), currency (string), price (number), cost (number), direct_cost (number | null), notes (string)' + example: + success: true + data: + id: 1 + name: Mechanical Pencil + code: MPENCIL + description: Product description + unit: '' + tax: 0 + category: Retail + is_linkable: true + is_deleted: false + visible_to: 3 + owner_id: 1234 + add_time: '2019-12-19T11:36:49Z' + update_time: '2019-12-19T11:36:49Z' + billing_frequency: monthly + billing_frequency_cycles: 4 + prices: + - product_id: 1 + price: 5 + currency: EUR + cost: 2 + direct_cost: 1 + notes: this is a note + custom_fields: + 6d74315176adcc4c97108440449b93ba57d20704: 16 + '/products/{id}/variations': + get: + summary: Get all product variations + description: Returns data about all product variations. + x-token-cost: 10 + operationId: getProductVariations + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:read' + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + responses: + '200': + description: List of product variations + content: + application/json: + schema: + title: GetProductVariationsResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: array + description: Array containing data for all products + items: + type: object + properties: + id: + type: number + description: The ID of the product variation + name: + type: string + description: The name of the product variation + product_id: + type: integer + description: The ID of the product + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: product_variation_id (number), currency (string), price (number), cost (number), direct_cost (number) , notes (string)' + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 2 + name: Upgraded Mechanical Pencil + product_id: 1 + prices: + - product_variation_id: 2 + price: 5 + currency: EUR + cost: 2 + direct_cost: 3 + notes: This is the price for the upgraded mechanical pencil + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a product variation + description: Adds a new product variation. + x-token-cost: 5 + operationId: addProductVariation + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + title: addProductVariationRequest + required: + - name + type: object + properties: + name: + type: string + description: The name of the product variation. The maximum length is 255 characters. + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: currency (string), price (number), cost (number, optional), direct_cost (number, optional), notes (string, optional). When prices is omitted altogether, a default price of 0, a default cost of 0, a default direct_cost of 0 and the user''s default currency will be assigned.' + responses: + '201': + description: Add a product variation + content: + application/json: + schema: + title: GetProductVariationResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: number + description: The ID of the product variation + name: + type: string + description: The name of the product variation + product_id: + type: integer + description: The ID of the product + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: product_variation_id (number), currency (string), price (number), cost (number), direct_cost (number) , notes (string)' + example: + success: true + data: + id: 2 + name: Upgraded Mechanical Pencil + product_id: 1 + prices: + - product_variation_id: 2 + price: 5 + currency: EUR + cost: 2 + direct_cost: 3 + notes: This is the price for the upgraded mechanical pencil + '/products/{id}/variations/{product_variation_id}': + patch: + summary: Update a product variation + description: Updates product variation data. + x-token-cost: 5 + operationId: updateProductVariation + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + - in: path + name: product_variation_id + description: The ID of the product variation + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + title: updateProductVariationRequest + type: object + properties: + name: + type: string + description: The name of the product variation. The maximum length is 255 characters. + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: currency (string), price (number), cost (number, optional), direct_cost (number, optional), notes (string, optional). When prices is omitted altogether, a default price of 0, a default cost of 0, a default direct_cost of 0 and the user''s default currency will be assigned.' + responses: + '200': + description: Update product variation data + content: + application/json: + schema: + title: GetProductVariationResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: number + description: The ID of the product variation + name: + type: string + description: The name of the product variation + product_id: + type: integer + description: The ID of the product + prices: + type: array + items: + type: object + description: 'Array of objects, each containing: product_variation_id (number), currency (string), price (number), cost (number), direct_cost (number) , notes (string)' + example: + success: true + data: + id: 2 + name: Upgraded Mechanical Pencil + product_id: 1 + prices: + - product_variation_id: 2 + price: 5 + currency: EUR + cost: 2 + direct_cost: 3 + notes: This is the price for the upgraded mechanical pencil + delete: + summary: Delete a product variation + description: Deletes a product variation. + x-token-cost: 3 + operationId: deleteProductVariation + tags: + - Products + security: + - api_key: [] + - oauth2: + - 'products:full' + parameters: + - in: path + name: id + description: The ID of the product + required: true + schema: + type: integer + - in: path + name: product_variation_id + description: The ID of the product variation + required: true + schema: + type: integer + responses: + '200': + description: Delete a product variation + content: + application/json: + schema: + title: DeleteProductVariationResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: The ID of a deleted product variant + example: + success: true + data: + id: 123 + /leads/search: + get: + summary: Search leads + description: 'Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.' + x-token-cost: 20 + operationId: searchLeads + tags: + - Leads + security: + - api_key: [] + - oauth2: + - 'leads:read' + - 'leads:full' + - 'search:read' + parameters: + - in: query + name: term + required: true + schema: + type: string + description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + - in: query + name: fields + schema: + type: string + enum: + - custom_fields + - notes + - title + description: A comma-separated string array. The fields to perform the search from. Defaults to all of them. + - in: query + name: exact_match + schema: + type: boolean + description: 'When enabled, only full exact matches against the given term are returned. It is not case sensitive.' + - in: query + name: person_id + schema: + type: integer + description: Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. + - in: query + name: organization_id + schema: + type: integer + description: Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. + - in: query + name: include_fields + schema: + type: string + enum: + - lead.was_seen + description: Supports including optional fields in the results which are not provided by default + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Success + content: + application/json: + schema: + title: GetLeadSearchResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: GetLeadSearchResponseData + properties: + data: + type: object + properties: + items: + type: array + description: The array of leads + items: + type: object + title: LeadSearchItem + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + properties: + id: + type: string + description: The ID of the lead + type: + type: string + description: The type of the item + title: + type: string + description: The title of the lead + owner: + type: object + properties: + id: + type: integer + description: The ID of the owner of the lead + person: + type: object + properties: + id: + type: integer + description: The ID of the person the lead is associated with + name: + type: string + description: The name of the person the lead is associated with + organization: + type: object + properties: + id: + type: integer + description: The ID of the organization the lead is associated with + name: + type: string + description: The name of the organization the lead is associated with + phones: + type: array + items: + type: string + emails: + type: array + items: + type: string + custom_fields: + type: array + items: + type: string + description: Custom fields + notes: + type: array + description: An array of notes + items: + type: string + value: + type: integer + description: The value of the lead + currency: + type: string + description: The currency of the lead + visible_to: + type: integer + description: The visibility of the lead + is_archived: + type: boolean + description: A flag indicating whether the lead is archived or not + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + items: + - result_score: 0.29 + item: + id: 39c433f0-8a4c-11ec-8728-09968f0a1ca0 + type: lead + title: John Doe lead + owner: + id: 1 + person: + id: 1 + name: John Doe + organization: + id: 1 + name: John company + phones: [] + emails: + - john@doe.com + custom_fields: [] + notes: [] + value: 100 + currency: USD + visible_to: 3 + is_archived: false + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + '/leads/{id}/convert/deal': + post: + security: + - api_key: [] + - oauth2: + - 'leads:full' + tags: + - Leads + - Beta + summary: Convert a lead to a deal (BETA) + description: 'Initiates a conversion of a lead to a deal. The return value is an ID of a job that was assigned to perform the conversion. Related entities (notes, files, emails, activities, ...) are transferred during the process to the target entity. If the conversion is successful, the lead is marked as deleted. To retrieve the created entity ID and the result of the conversion, call the /api/v2/leads/{lead_id}/convert/status/{conversion_id} endpoint.' + operationId: convertLeadToDeal + x-token-cost: 40 + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: The ID of the lead to convert + requestBody: + content: + application/json: + schema: + additionalProperties: false + type: object + properties: + stage_id: + description: 'The ID of a stage the created deal will be added to. Please note that a pipeline will be assigned automatically based on the `stage_id`. If omitted, the deal will be placed in the first stage of the default pipeline.' + type: integer + pipeline_id: + description: 'The ID of a pipeline the created deal will be added to. By default, the deal will be added to the first stage of the specified pipeline. Please note that `pipeline_id` and `stage_id` should not be used together as `pipeline_id` will be ignored.' + type: integer + responses: + '200': + description: Successful response containing payload in the `data` field + content: + application/json: + schema: + title: AddConvertLeadToDealResponse + type: object + properties: + success: + type: boolean + data: + type: object + description: An object containing conversion job id that performs the conversion + required: + - conversion_id + properties: + conversion_id: + description: The ID of the conversion job that can be used to retrieve conversion status and details. The ID has UUID format. + type: string + format: uuid + additional_data: + type: object + nullable: true + example: null + example: + success: true + data: + conversion_id: 4b40248b-945a-4802-b996-60fdff8c5c69 + additional_data: null + '404': + description: A resource describing an error + content: + application/json: + schema: + type: object + title: GetConvertResponse + properties: + success: + type: boolean + example: false + error: + type: string + description: The description of the error + error_info: + type: string + description: A message describing how to solve the problem + data: + type: object + nullable: true + example: null + additional_data: + type: object + nullable: true + example: null + example: + success: false + error: Entity was not found + error_info: Object was not found. + data: null + additional_data: null + '/leads/{id}/convert/status/{conversion_id}': + get: + security: + - api_key: [] + - oauth2: + - 'leads:full' + - 'leads:read' + tags: + - Leads + - Beta + summary: Get Lead conversion status (BETA) + description: 'Returns data about the conversion. Status is always present and its value (not_started, running, completed, failed, rejected) represents the current state of the conversion. Deal ID is only present if the conversion was successfully finished. This data is only temporary and removed after a few days.' + operationId: getLeadConversionStatus + x-token-cost: 1 + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: The ID of a lead + - in: path + name: conversion_id + required: true + schema: + type: string + format: uuid + description: The ID of the conversion + responses: + '200': + description: Successful response containing payload in the `data` field + content: + application/json: + example: + success: true + data: + deal_id: 33 + conversion_id: 4b40248b-945a-4802-b996-60fdff8c5c69 + status: completed + additional_data: null + schema: + title: GetConvertResponse + type: object + required: + - success + - data + properties: + success: + type: boolean + data: + type: object + description: An object containing conversion status. After successful conversion the converted entity ID is also present. + required: + - conversion_id + - status + properties: + lead_id: + description: The ID of the new lead. + type: string + format: uuid + deal_id: + description: The ID of the new deal. + type: integer + conversion_id: + description: The ID of the conversion job. The ID can be used to retrieve conversion status and details. The ID has UUID format. + type: string + format: uuid + status: + description: Status of the conversion job. + type: string + enum: + - not_started + - running + - completed + - failed + - rejected + additional_data: + type: object + nullable: true + example: null + '404': + description: A resource describing an error + content: + application/json: + schema: + type: object + title: GetConvertResponse + properties: + success: + type: boolean + example: false + error: + type: string + description: The description of the error + error_info: + type: string + description: A message describing how to solve the problem + data: + type: object + nullable: true + example: null + additional_data: + type: object + nullable: true + example: null + example: + success: false + error: Entity was not found + error_info: Object was not found. + data: null + additional_data: null + /organizations/search: + get: + summary: Search organizations + description: 'Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope.' + x-token-cost: 20 + operationId: searchOrganization + tags: + - Organizations + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + - 'search:read' + parameters: + - in: query + name: term + required: true + schema: + type: string + description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + - in: query + name: fields + schema: + type: string + enum: + - address + - custom_fields + - notes + - name + description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields here.' + - in: query + name: exact_match + schema: + type: boolean + description: 'When enabled, only full exact matches against the given term are returned. It is not case sensitive.' + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Success + content: + application/json: + schema: + title: GetOrganizationSearchResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + properties: + items: + type: array + description: The array of found items + items: + type: object + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + properties: + id: + type: integer + description: The ID of the organization + type: + type: string + description: The type of the item + name: + type: string + description: The name of the organization + address: + type: string + description: The address of the organization + visible_to: + type: integer + description: The visibility of the organization + owner: + type: object + properties: + id: + type: integer + description: The ID of the owner of the deal + custom_fields: + type: array + items: + type: string + description: Custom fields + notes: + type: array + description: An array of notes + items: + type: string + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + items: + - result_score: 0.316 + item: + id: 1 + type: organization + name: Organization name + address: 'Mustamäe tee 3a, 10615 Tallinn' + visible_to: 3 + owner: + id: 1 + custom_fields: [] + notes: [] + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + /persons/search: + get: + summary: Search persons + description: 'Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found persons can be filtered by organization ID.' + x-token-cost: 20 + operationId: searchPersons + tags: + - Persons + security: + - api_key: [] + - oauth2: + - 'contacts:read' + - 'contacts:full' + - 'search:read' + parameters: + - in: query + name: term + required: true + schema: + type: string + description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + - in: query + name: fields + schema: + type: string + enum: + - custom_fields + - email + - notes + - phone + - name + description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields here.' + - in: query + name: exact_match + schema: + type: boolean + description: 'When enabled, only full exact matches against the given term are returned. It is not case sensitive.' + - in: query + name: organization_id + schema: + type: integer + description: Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000. + - in: query + name: include_fields + schema: + type: string + enum: + - person.picture + description: Supports including optional fields in the results which are not provided by default + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Success + content: + application/json: + schema: + title: GetPersonSearchResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: object + properties: + items: + type: array + description: The array of found items + items: + type: object + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + properties: + id: + type: integer + description: The ID of the person + type: + type: string + description: The type of the item + name: + type: string + description: The name of the person + phones: + type: array + description: An array of phone numbers + items: + type: string + emails: + type: array + description: An array of email addresses + items: + type: string + visible_to: + type: integer + description: The visibility of the person + owner: + type: object + properties: + id: + type: integer + description: The ID of the owner of the person + organization: + type: object + properties: + id: + type: integer + description: The ID of the organization the person is associated with + name: + type: string + description: The name of the organization the person is associated with + custom_fields: + type: array + items: + type: string + description: Custom fields + notes: + type: array + description: An array of notes + items: + type: string + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + items: + - result_score: 0.5092 + item: + id: 1 + type: person + name: Jane Doe + phones: + - +372 555555555 + emails: + - jane@pipedrive.com + visible_to: 3 + owner: + id: 1 + organization: + id: 1 + name: Organization name + address: null + custom_fields: [] + notes: [] + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + /itemSearch: + get: + summary: Perform a search from multiple item types + description: Performs a search from your choice of item types and fields. + x-token-cost: 20 + operationId: searchItem + tags: + - ItemSearch + security: + - api_key: [] + - oauth2: + - 'search:read' + parameters: + - in: query + name: term + required: true + schema: + type: string + description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. + - in: query + name: item_types + schema: + type: string + enum: + - deal + - person + - organization + - product + - lead + - file + - mail_attachment + - project + description: A comma-separated string array. The type of items to perform the search from. Defaults to all. + - in: query + name: fields + schema: + type: string + enum: + - address + - code + - custom_fields + - email + - name + - notes + - organization_name + - person_name + - phone + - title + - description + description: 'A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:
Item typeField
Deal`custom_fields`, `notes`, `title`
Person`custom_fields`, `email`, `name`, `notes`, `phone`
Organization`address`, `custom_fields`, `name`, `notes`
Product`code`, `custom_fields`, `name`
Lead`custom_fields`, `notes`, `email`, `organization_name`, `person_name`, `phone`, `title`
File`name`
Mail attachment`name`
Project `custom_fields`, `notes`, `title`, `description`

Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields here.
When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use `search_for_related_items`.' + - in: query + name: search_for_related_items + schema: + type: boolean + description: 'When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization' + - in: query + name: exact_match + schema: + type: boolean + description: 'When enabled, only full exact matches against the given term are returned. It is not case sensitive.' + - in: query + name: include_fields + schema: + type: string + enum: + - deal.cc_email + - person.picture + - product.price + description: A comma-separated string array. Supports including optional fields in the results which are not provided by default. + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Success + content: + application/json: + schema: + title: GetItemSearchResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: GetItemSearchResponseData + properties: + data: + type: object + properties: + items: + type: array + description: The array of found items + items: + type: object + title: ItemSearchItem + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + description: Item + related_items: + type: array + description: The array of related items if `search_for_related_items` was enabled + items: + type: object + title: ItemSearchItem + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + description: Item + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + items: + - result_score: 1.22724 + item: + id: 42 + type: deal + title: Sample Deal + value: 53883 + currency: USD + status: open + visible_to: 3 + owner: + id: 69 + stage: + id: 3 + name: Demo Scheduled + person: + id: 6 + name: Sample Person + organization: + id: 9 + name: Sample Organization + address: 'Dabas, Hungary' + custom_fields: + - Sample text + notes: + - Sample note + - result_score: 0.31335002 + item: + id: 9 + type: organization + name: Sample Organization + address: 'Dabas, Hungary' + visible_to: 3 + owner: + id: 69 + custom_fields: [] + notes: [] + - result_score: 0.29955 + item: + id: 6 + type: person + name: Sample Person + phones: + - '555123123' + - +372 (55) 123468 + - '0231632772' + emails: + - primary@email.com + - secondary@email.com + visible_to: 1 + owner: + id: 69 + organization: + id: 9 + name: Sample Organization + address: 'Dabas, Hungary' + custom_fields: + - Custom Field Text + notes: + - Person note + - result_score: 0.0093 + item: + id: 4 + type: mail_attachment + name: Sample mail attachment.txt + url: /files/4/download + - result_score: 0.0093 + item: + id: 3 + type: file + name: Sample file attachment.txt + url: /files/3/download + deal: + id: 42 + title: Sample Deal + person: + id: 6 + name: Sample Person + organization: + id: 9 + name: Sample Organization + address: 'Dabas, Hungary' + - result_score: 0.0011999999 + item: + id: 1 + type: product + name: Sample Product + code: product-code + visible_to: 3 + owner: + id: 69 + custom_fields: [] + related_items: + - result_score: 0 + item: + id: 2 + type: deal + title: Other deal + value: 100 + currency: USD + status: open + visible_to: 3 + owner: + id: 1 + stage: + id: 1 + name: Lead In + person: + id: 1 + name: Sample Person + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + /itemSearch/field: + get: + summary: Perform a search using a specific field from an item type + description: 'Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).' + x-token-cost: 20 + operationId: searchItemByField + tags: + - ItemSearch + security: + - api_key: [] + - oauth2: + - 'search:read' + parameters: + - in: query + name: term + required: true + schema: + type: string + description: The search term to look for. Minimum 2 characters (or 1 if `match` is `exact`). Please note that the search term has to be URL encoded. + - in: query + name: entity_type + required: true + schema: + type: string + enum: + - deal + - lead + - person + - organization + - product + - project + description: The type of the field to perform the search from + - in: query + name: match + schema: + type: string + default: exact + enum: + - exact + - beginning + - middle + description: 'The type of match used against the term. The search is case sensitive.

E.g. in case of searching for a value `monkey`, .' + - in: query + name: field + required: true + schema: + type: string + description: 'The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields'' API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: `address`, `varchar`, `text`, `varchar_auto`, `double`, `monetary` and `phone`. Read more about searching by custom fields here.' + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Success + content: + application/json: + schema: + title: GetItemSearchFieldResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: The array of found fields + items: + type: object + title: ItemSearchItem + properties: + result_score: + type: number + description: Search result relevancy + item: + type: object + description: Item + additional_data: + type: object + description: Pagination related data + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + name: Jane Doe + - id: 2 + name: John Doe + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + /stages: + get: + summary: Get all stages + description: Returns data about all stages. + x-token-cost: 5 + operationId: getStages + tags: + - Stages + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + - admin + parameters: + - in: query + name: pipeline_id + schema: + type: integer + description: 'The ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched.' + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `update_time`, `add_time`, `order_nr`.' + schema: + type: string + default: id + enum: + - id + - update_time + - add_time + - order_nr + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Get all stages + content: + application/json: + schema: + title: GetStagesResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: array + description: The array of stages + items: + type: object + title: StageItem + properties: + id: + type: integer + description: The ID of the stage + order_nr: + type: integer + description: Defines the order of the stage + name: + type: string + description: The name of the stage + is_deleted: + type: boolean + description: Whether the stage is marked as deleted or not + deal_probability: + type: integer + description: The success probability percentage of the deal. Used/shown when the deal weighted values are used. + pipeline_id: + type: integer + description: The ID of the pipeline to add the stage to + is_deal_rot_enabled: + type: boolean + description: Whether deals in this stage can become rotten + days_to_rotten: + type: integer + nullable: true + description: The number of days the deals not updated in this stage would become rotten. Applies only if the `is_deal_rot_enabled` is set. + add_time: + type: string + description: The stage creation time + update_time: + type: string + description: The stage update time + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + order_nr: 1 + name: Stage Name + is_deleted: false + deal_probability: 100 + pipeline_id: 1 + is_deal_rot_enabled: true + days_to_rotten: 2 + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a new stage + description: 'Adds a new stage, returns the ID upon success.' + x-token-cost: 5 + operationId: addStage + tags: + - Stages + security: + - api_key: [] + - oauth2: + - admin + requestBody: + content: + application/json: + schema: + title: addStageRequest + required: + - name + - pipeline_id + type: object + properties: + name: + type: string + description: The name of the stage + pipeline_id: + type: integer + description: The ID of the pipeline to add stage to + deal_probability: + type: integer + description: The success probability percentage of the deal. Used/shown when deal weighted values are used. + is_deal_rot_enabled: + type: boolean + description: Whether deals in this stage can become rotten + days_to_rotten: + type: integer + description: The number of days the deals not updated in this stage would become rotten. Applies only if the `is_deal_rot_enabled` is set. + responses: + '200': + description: Add a new stage + content: + application/json: + schema: + title: UpsertStageResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + title: StageItem + properties: + id: + type: integer + description: The ID of the stage + order_nr: + type: integer + description: Defines the order of the stage + name: + type: string + description: The name of the stage + is_deleted: + type: boolean + description: Whether the stage is marked as deleted or not + deal_probability: + type: integer + description: The success probability percentage of the deal. Used/shown when the deal weighted values are used. + pipeline_id: + type: integer + description: The ID of the pipeline to add the stage to + is_deal_rot_enabled: + type: boolean + description: Whether deals in this stage can become rotten + days_to_rotten: + type: integer + nullable: true + description: The number of days the deals not updated in this stage would become rotten. Applies only if the `is_deal_rot_enabled` is set. + add_time: + type: string + description: The stage creation time + update_time: + type: string + description: The stage update time + description: The stage object + example: + success: true + data: + id: 1 + order_nr: 1 + name: Stage Name + is_deleted: false + deal_probability: 100 + pipeline_id: 1 + is_deal_rot_enabled: true + days_to_rotten: 2 + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + '/stages/{id}': + delete: + summary: Delete a stage + description: Marks a stage as deleted. + x-token-cost: 3 + operationId: deleteStage + tags: + - Stages + security: + - api_key: [] + - oauth2: + - admin + parameters: + - in: path + name: id + description: The ID of the stage + required: true + schema: + type: integer + responses: + '200': + description: Delete stage + content: + application/json: + schema: + title: DeleteStageResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: Deleted stage ID + example: + success: true + data: + id: 1 + get: + summary: Get one stage + description: Returns data about a specific stage. + x-token-cost: 1 + operationId: getStage + tags: + - Stages + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + - admin + parameters: + - in: path + name: id + description: The ID of the stage + required: true + schema: + type: integer + responses: + '200': + description: Get one stages + content: + application/json: + schema: + title: UpsertStageResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + title: StageItem + properties: + id: + type: integer + description: The ID of the stage + order_nr: + type: integer + description: Defines the order of the stage + name: + type: string + description: The name of the stage + is_deleted: + type: boolean + description: Whether the stage is marked as deleted or not + deal_probability: + type: integer + description: The success probability percentage of the deal. Used/shown when the deal weighted values are used. + pipeline_id: + type: integer + description: The ID of the pipeline to add the stage to + is_deal_rot_enabled: + type: boolean + description: Whether deals in this stage can become rotten + days_to_rotten: + type: integer + nullable: true + description: The number of days the deals not updated in this stage would become rotten. Applies only if the `is_deal_rot_enabled` is set. + add_time: + type: string + description: The stage creation time + update_time: + type: string + description: The stage update time + description: The stage object + example: + success: true + data: + id: 1 + order_nr: 1 + name: Stage Name + is_deleted: false + deal_probability: 100 + pipeline_id: 1 + is_deal_rot_enabled: true + days_to_rotten: 2 + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + patch: + summary: Update stage details + description: Updates the properties of a stage. + x-token-cost: 5 + operationId: updateStage + tags: + - Stages + security: + - api_key: [] + - oauth2: + - admin + parameters: + - in: path + name: id + description: The ID of the stage + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + title: updateStageRequest + type: object + properties: + name: + type: string + description: The name of the stage + pipeline_id: + type: integer + description: The ID of the pipeline to add stage to + deal_probability: + type: integer + description: The success probability percentage of the deal. Used/shown when deal weighted values are used. + is_deal_rot_enabled: + type: boolean + description: Whether deals in this stage can become rotten + days_to_rotten: + type: integer + description: The number of days the deals not updated in this stage would become rotten. Applies only if the `is_deal_rot_enabled` is set. + responses: + '200': + description: Update an existing stage + content: + application/json: + schema: + title: UpsertStageResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + title: StageItem + properties: + id: + type: integer + description: The ID of the stage + order_nr: + type: integer + description: Defines the order of the stage + name: + type: string + description: The name of the stage + is_deleted: + type: boolean + description: Whether the stage is marked as deleted or not + deal_probability: + type: integer + description: The success probability percentage of the deal. Used/shown when the deal weighted values are used. + pipeline_id: + type: integer + description: The ID of the pipeline to add the stage to + is_deal_rot_enabled: + type: boolean + description: Whether deals in this stage can become rotten + days_to_rotten: + type: integer + nullable: true + description: The number of days the deals not updated in this stage would become rotten. Applies only if the `is_deal_rot_enabled` is set. + add_time: + type: string + description: The stage creation time + update_time: + type: string + description: The stage update time + description: The stage object + example: + success: true + data: + id: 1 + order_nr: 1 + name: Stage Name + is_deleted: false + deal_probability: 100 + pipeline_id: 1 + is_deal_rot_enabled: true + days_to_rotten: 2 + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + /pipelines: + get: + summary: Get all pipelines + description: Returns data about all pipelines. + x-token-cost: 5 + operationId: getPipelines + tags: + - Pipelines + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + - admin + parameters: + - in: query + name: sort_by + description: 'The field to sort by. Supported fields: `id`, `update_time`, `add_time`.' + schema: + type: string + default: id + enum: + - id + - update_time + - add_time + - in: query + name: sort_direction + description: 'The sorting direction. Supported values: `asc`, `desc`.' + schema: + type: string + default: asc + enum: + - asc + - desc + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: Get all pipelines + content: + application/json: + schema: + type: object + title: GetPipelinesResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Pipelines array + items: + type: object + properties: + id: + type: integer + description: The ID of the pipeline + name: + type: string + description: The name of the pipeline + order_nr: + type: integer + description: Defines the order of pipelines. The pipeline with the lowest `order_nr` is considered the default. + is_selected: + type: boolean + description: Whether this pipeline is selected or not + is_deleted: + type: boolean + description: Whether this pipeline is marked as deleted or not + is_deal_probability_enabled: + type: boolean + description: Whether deal probability is disabled or enabled for this pipeline + add_time: + type: string + description: The pipeline creation time + update_time: + type: string + description: The pipeline update time + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - id: 1 + name: Pipeline Name + order_nr: 1 + is_deleted: false + is_deal_probability_enabled: true + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + is_selected: true + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ + post: + summary: Add a new pipeline + description: Adds a new pipeline. + x-token-cost: 5 + operationId: addPipeline + tags: + - Pipelines + security: + - api_key: [] + - oauth2: + - admin + requestBody: + content: + application/json: + schema: + required: + - name + type: object + properties: + name: + type: string + description: The name of the pipeline + is_deal_probability_enabled: + type: boolean + default: false + description: Whether deal probability is disabled or enabled for this pipeline + responses: + '200': + description: Add pipeline + content: + application/json: + schema: + type: object + title: UpsertPipelineResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertPipelineResponseData + properties: + data: + type: object + properties: + id: + type: integer + description: The ID of the pipeline + name: + type: string + description: The name of the pipeline + order_nr: + type: integer + description: Defines the order of pipelines. The pipeline with the lowest `order_nr` is considered the default. + is_selected: + type: boolean + description: Whether this pipeline is selected or not + is_deleted: + type: boolean + description: Whether this pipeline is marked as deleted or not + is_deal_probability_enabled: + type: boolean + description: Whether deal probability is disabled or enabled for this pipeline + add_time: + type: string + description: The pipeline creation time + update_time: + type: string + description: The pipeline update time + description: The pipeline object + example: + success: true + data: + id: 1 + name: Pipeline Name + order_nr: 1 + is_deleted: false + is_deal_probability_enabled: true + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + is_selected: true + '/pipelines/{id}': + delete: + summary: Delete a pipeline + description: Marks a pipeline as deleted. + x-token-cost: 3 + operationId: deletePipeline + tags: + - Pipelines + security: + - api_key: [] + - oauth2: + - admin + parameters: + - in: path + name: id + description: The ID of the pipeline + required: true + schema: + type: integer + responses: + '200': + description: Delete pipeline + content: + application/json: + schema: + title: DeletePipelineResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + data: + type: object + properties: + id: + type: integer + description: Deleted Pipeline ID + example: + success: true + data: + id: 1 + get: + summary: Get one pipeline + description: Returns data about a specific pipeline. + x-token-cost: 1 + operationId: getPipeline + tags: + - Pipelines + security: + - api_key: [] + - oauth2: + - 'deals:read' + - 'deals:full' + - admin + parameters: + - in: path + name: id + description: The ID of the pipeline + required: true + schema: + type: integer + responses: + '200': + description: Get pipeline + content: + application/json: + schema: + type: object + title: UpsertPipelineResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertPipelineResponseData + properties: + data: + type: object + properties: + id: + type: integer + description: The ID of the pipeline + name: + type: string + description: The name of the pipeline + order_nr: + type: integer + description: Defines the order of pipelines. The pipeline with the lowest `order_nr` is considered the default. + is_selected: + type: boolean + description: Whether this pipeline is selected or not + is_deleted: + type: boolean + description: Whether this pipeline is marked as deleted or not + is_deal_probability_enabled: + type: boolean + description: Whether deal probability is disabled or enabled for this pipeline + add_time: + type: string + description: The pipeline creation time + update_time: + type: string + description: The pipeline update time + description: The pipeline object + example: + success: true + data: + id: 1 + name: Pipeline Name + order_nr: 1 + is_deleted: false + is_deal_probability_enabled: true + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + is_selected: true + patch: + summary: Update a pipeline + description: Updates the properties of a pipeline. + x-token-cost: 5 + operationId: updatePipeline + tags: + - Pipelines + security: + - api_key: [] + - oauth2: + - admin + parameters: + - in: path + name: id + description: The ID of the pipeline + required: true + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the pipeline + is_deal_probability_enabled: + type: boolean + default: false + description: Whether deal probability is disabled or enabled for this pipeline + responses: + '200': + description: Edit pipeline + content: + application/json: + schema: + type: object + title: UpsertPipelineResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + title: UpsertPipelineResponseData + properties: + data: + type: object + properties: + id: + type: integer + description: The ID of the pipeline + name: + type: string + description: The name of the pipeline + order_nr: + type: integer + description: Defines the order of pipelines. The pipeline with the lowest `order_nr` is considered the default. + is_selected: + type: boolean + description: Whether this pipeline is selected or not + is_deleted: + type: boolean + description: Whether this pipeline is marked as deleted or not + is_deal_probability_enabled: + type: boolean + description: Whether deal probability is disabled or enabled for this pipeline + add_time: + type: string + description: The pipeline creation time + update_time: + type: string + description: The pipeline update time + description: The pipeline object + example: + success: true + data: + id: 1 + name: Pipeline Name + order_nr: 1 + is_deleted: false + is_deal_probability_enabled: true + add_time: '2024-01-01T00:00:00Z' + update_time: '2024-01-01T00:00:00Z' + is_selected: true + '/users/{id}/followers': + get: + summary: List followers of a user + description: Lists users who are following the user. + x-token-cost: 10 + operationId: getUserFollowers + tags: + - Users + security: + - api_key: [] + - oauth2: + - 'users:read' + parameters: + - in: path + name: id + description: The ID of the user + required: true + schema: + type: integer + - in: query + name: limit + description: 'For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.' + schema: + type: integer + example: 100 + - in: query + name: cursor + required: false + schema: + type: string + description: 'For pagination, the marker (an opaque string value) representing the first item on the next page' + responses: + '200': + description: List entity followers + content: + application/json: + schema: + type: object + title: GetFollowersResponse + allOf: + - title: baseResponse + type: object + properties: + success: + type: boolean + description: If the response is successful or not + - type: object + properties: + data: + type: array + description: Followers array + items: + type: object + title: FollowerItem + properties: + user_id: + type: integer + description: The ID of the user following the entity + add_time: + type: string + description: The add time of the following + additional_data: + type: object + description: The additional data of the list + properties: + next_cursor: + type: string + description: The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned. + example: + success: true + data: + - user_id: 1 + add_time: '2021-01-01T00:00:00Z' + additional_data: + next_cursor: eyJmaWVsZCI6ImlkIiwiZmllbGRWYWx1ZSI6Nywic29ydERpcmVjdGlvbiI6ImFzYyIsImlkIjo3fQ +components: + securitySchemes: + basic_authentication: + type: http + scheme: basic + description: 'Base 64 encoded string containing the `client_id` and `client_secret` values. The header value should be `Basic `.' + api_key: + type: apiKey + name: x-api-token + in: header + oauth2: + type: oauth2 + description: 'For more information, see https://pipedrive.readme.io/docs/marketplace-oauth-authorization' + flows: + authorizationCode: + authorizationUrl: 'https://oauth.pipedrive.com/oauth/authorize' + tokenUrl: 'https://oauth.pipedrive.com/oauth/token' + refreshUrl: 'https://oauth.pipedrive.com/oauth/token' + scopes: + base: Read settings of the authorized user and currencies in an account + 'deals:read': 'Read most of the data about deals and related entities - deal fields, products, followers, participants; all notes, files, filters, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal)' + 'deals:full': 'Create, read, update and delete deals, its participants and followers; all files, notes, and filters. It also includes read access to deal fields, pipelines, stages, and statistics. Does not include access to activities (except the last and next activity related to a deal)' + 'mail:read': Read mail threads and messages + 'mail:full': 'Read, update and delete mail threads. Also grants read access to mail messages' + 'activities:read': 'Read activities, its fields and types; all files and filters' + 'activities:full': 'Create, read, update and delete activities and all files and filters. Also includes read access to activity fields and types' + 'contacts:read': 'Read the data about persons and organizations, their related fields and followers; also all notes, files, filters' + 'contacts:full': 'Create, read, update and delete persons and organizations and their followers; all notes, files, filters. Also grants read access to contacts-related fields' + 'products:read': 'Read products, its fields, files, followers and products connected to a deal' + 'products:full': 'Create, read, update and delete products and its fields; add products to deals' + 'projects:read': 'Read projects and its fields, tasks and project templates' + 'projects:full': 'Create, read, update and delete projects and its fields; add projects templates and project related tasks' + 'users:read': 'Read data about users (people with access to a Pipedrive account), their permissions, roles and followers' + 'recents:read': 'Read all recent changes occurred in an account. Includes data about activities, activity types, deals, files, filters, notes, persons, organizations, pipelines, stages, products and users' + 'search:read': 'Search across the account for deals, persons, organizations, files and products, and see details about the returned results' + admin: 'Allows to do many things that an administrator can do in a Pipedrive company account - create, read, update and delete pipelines and its stages; deal, person and organization fields; activity types; users and permissions, etc. It also allows the app to create webhooks and fetch and delete webhooks that are created by the app' + 'leads:read': Read data about leads and lead labels + 'leads:full': 'Create, read, update and delete leads and lead labels' + phone-integration: 'Enables advanced call integration features like logging call duration and other metadata, and play call recordings inside Pipedrive' + 'goals:read': Read data on all goals + 'goals:full': 'Create, read, update and delete goals' + video-calls: Allows application to register as a video call integration provider and create conference links + messengers-integration: Allows application to register as a messengers integration provider and allows them to deliver incoming messages and their statuses \ No newline at end of file diff --git a/packages/v1-ready/pipedrive/test/Api.test.js b/packages/v1-ready/pipedrive/test/Api.test.js new file mode 100644 index 0000000..973fab2 --- /dev/null +++ b/packages/v1-ready/pipedrive/test/Api.test.js @@ -0,0 +1,157 @@ +const chai = require('chai'); +const {expect} = chai; +const should = chai.should(); +const {Api} = require('../api'); +const {mockApi} = require('../../../../test/utils/mockApi'); + +const MockedApi = mockApi(Api, { + authenticationMode: 'browser', + filteringScope: (url) => { + return /^https:[/][/].+[.]pipedrive[.]com/.test(url); + }, +}); + +describe('Pipedrive API class', async () => { + let api; + before(async function () { + await MockedApi.initialize({test: this.test}); + api = await MockedApi.mock(); + }); + + after(async function () { + await MockedApi.clean({test: this.test}); + }); + + describe('User', async () => { + it('should list user profile', async () => { + const response = await api.getUser(); + chai.assert.hasAllKeys(response.data, [ + 'id', + 'name', + 'company_country', + 'company_domain', + 'company_id', + 'company_name', + 'default_currency', + 'locale', + 'lang', + 'last_login', + 'language', + 'email', + 'phone', + 'created', + 'modified', + 'signup_flow_variation', + 'has_created_company', + 'is_admin', + 'active_flag', + 'timezone_name', + 'timezone_offset', + 'role_id', + 'icon_url', + 'is_you', + ]); + }); + }); + + describe('Deals', async () => { + it('should list deals', async () => { + const response = await api.listDeals(); + response.data.length.should.above(0); + response.data[0].should.have.property('id'); + return response; + }); + }); + + describe('Activities', async () => { + const mockActivity = {}; + it('should list all Activity Fields', async () => { + const response = await api.listActivityFields(); + const isRequired = response.data.filter( + (field) => field.mandatory_flag + ); + + for (const field of isRequired) { + mockActivity[field.key] = 'blah'; + } + }); + it('should create an email activity', async () => { + const activity = { + subject: 'Example Activtiy from the local grave', + type: 'email', + due_date: new Date('2021-12-03T15:06:38.700Z'), + user_id: '1811658', + }; + const response = await api.createActivity(activity); + response.success.should.equal(true); + }); + it('should get activities', async () => { + const response = await api.listActivities({ + query: { + user_id: 0, // Gets activities for all users, instead of just the auth'ed user + }, + }); + response.data[0].should.have.property('id'); + response.data.length.should.above(0); + return response; + }); + }); + + describe('Users', async () => { + it('should get users', async () => { + const response = await api.listUsers(); + response.data.should.be.an('array').of.length.greaterThan(0); + response.data[0].should.have.keys( + 'active_flag', + 'created', + 'default_currency', + 'email', + 'has_created_company', + 'icon_url', + 'id', + 'is_admin', + 'is_you', + 'lang', + 'last_login', + 'locale', + 'modified', + 'name', + 'phone', + 'role_id', + 'signup_flow_variation', + 'timezone_name', + 'timezone_offset' + ); + return response; + }); + }); + + describe('Bad Auth', async () => { + it('should refresh bad auth token', async () => { + // Needed to paste a valid JWT, otherwise it's testing the wrong error. + // TODO expand on other error types. + const badAccessToken = + 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzZWFuLm1hdHRoZXdzQGxlZnRob29rLmNvbSIsImlhdCI6MTYzNTUzMDk3OCwiZXhwIjoxNjM1NTM4MTc4LCJiZW50byI6ImFwcDFlIiwiYWN0Ijp7InN1YiI6IlZob0NzMFNRZ25Fa2RDanRkaFZLemV5bXBjNW9valZoRXB2am03Rjh1UVEiLCJuYW1lIjoiTGVmdCBIb29rIiwiaXNzIjoiZmxhZ3NoaXAiLCJ0eXBlIjoiYXBwIn0sIm9yZ191c2VyX2lkIjoxLCJhdWQiOiJMZWZ0IEhvb2siLCJzY29wZXMiOiJBSkFBOEFIUUFCQUJRQT09Iiwib3JnX2d1aWQiOiJmNzY3MDEzZC1mNTBiLTRlY2QtYjM1My0zNWU0MWQ5Y2RjNGIiLCJvcmdfc2hvcnRuYW1lIjoibGVmdGhvb2tzYW5kYm94In0.XFmIai0GpAePsYeA4MjRntZS3iW6effmKmIhT7SBzTQ'; + api.access_token = badAccessToken; + + await api.listDeals(); + api.access_token.should.not.equal(badAccessToken); + }); + + it('should throw error with invalid refresh token', async () => { + try { + api.access_token = + 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzZWFuLm1hdHRoZXdzQGxlZnRob29rLmNvbSIsImlhdCI6MTYzNTUzMDk3OCwiZXhwIjoxNjM1NTM4MTc4LCJiZW50byI6ImFwcDFlIiwiYWN0Ijp7InN1YiI6IlZob0NzMFNRZ25Fa2RDanRkaFZLemV5bXBjNW9valZoRXB2am03Rjh1UVEiLCJuYW1lIjoiTGVmdCBIb29rIiwiaXNzIjoiZmxhZ3NoaXAiLCJ0eXBlIjoiYXBwIn0sIm9yZ191c2VyX2lkIjoxLCJhdWQiOiJMZWZ0IEhvb2siLCJzY29wZXMiOiJBSkFBOEFIUUFCQUJRQT09Iiwib3JnX2d1aWQiOiJmNzY3MDEzZC1mNTBiLTRlY2QtYjM1My0zNWU0MWQ5Y2RjNGIiLCJvcmdfc2hvcnRuYW1lIjoibGVmdGhvb2tzYW5kYm94In0.XFmIai0GpAePsYeA4MjRntZS3iW6effmKmIhT7SBzTQ'; + api.refresh_token = 'nolongervalid'; + await api.listDeals(); + throw new Error('Expected error not thrown'); + } catch (e) { + e.message.should.contain( + '-----------------------------------------------------\n' + + 'An error ocurred while fetching an external resource.\n' + + '-----------------------------------------------------' + ); + } + }); + }); +}); diff --git a/packages/v1-ready/pipedrive/test/Manager.test.js b/packages/v1-ready/pipedrive/test/Manager.test.js new file mode 100644 index 0000000..32b386a --- /dev/null +++ b/packages/v1-ready/pipedrive/test/Manager.test.js @@ -0,0 +1,138 @@ +const chai = require('chai'); +const {expect} = chai; +const PipedriveManager = require('../manager'); +const Authenticator = require('../../../../test/utils/Authenticator'); +const TestUtils = require('../../../../test/utils/TestUtils'); + +// eslint-disable-next-line no-only-tests/no-only-tests +describe('Pipedrive Manager', async () => { + let manager; + before(async () => { + this.userManager = await TestUtils.getLoggedInTestUserManagerInstance(); + + manager = await PipedriveManager.getInstance({ + userId: this.userManager.getUserId(), + }); + const res = await manager.getAuthorizationRequirements(); + + chai.assert.hasAnyKeys(res, ['url', 'type']); + const {url} = res; + const response = await Authenticator.oauth2(url); + const baseArr = response.base.split('/'); + response.entityType = baseArr[baseArr.length - 1]; + delete response.base; + + const ids = await manager.processAuthorizationCallback({ + userId: this.userManager.getUserId(), + data: response.data, + }); + chai.assert.hasAllKeys(ids, ['credential_id', 'entity_id', 'type']); + }); + + describe('getInstance tests', async () => { + it('should return a manager instance without credential or entity data', async () => { + const userId = this.userManager.getUserId(); + const freshManager = await PipedriveManager.getInstance({ + userId, + }); + expect(freshManager).to.haveOwnProperty('api'); + expect(freshManager).to.haveOwnProperty('userId'); + expect(freshManager.userId).to.equal(userId); + expect(freshManager.entity).to.be.undefined; + expect(freshManager.credential).to.be.undefined; + }); + + it('should return a manager instance with a credential ID', async () => { + const userId = this.userManager.getUserId(); + const freshManager = await PipedriveManager.getInstance({ + userId, + credentialId: manager.credential.id, + }); + expect(freshManager).to.haveOwnProperty('api'); + expect(freshManager).to.haveOwnProperty('userId'); + expect(freshManager.userId).to.equal(userId); + expect(freshManager.entity).to.be.undefined; + expect(freshManager.credential).to.exist; + }); + + it('should return a fresh manager instance with an entity ID', async () => { + const userId = this.userManager.getUserId(); + const freshManager = await PipedriveManager.getInstance({ + userId, + entityId: manager.entity.id, + }); + expect(freshManager).to.haveOwnProperty('api'); + expect(freshManager).to.haveOwnProperty('userId'); + expect(freshManager.userId).to.equal(userId); + expect(freshManager.entity).to.exist; + expect(freshManager.credential).to.exist; + }); + }); + + describe('getAuthorizationRequirements tests', async () => { + it('should return authorization requirements of username and password', async () => { + // Check authorization requirements + const res = await manager.getAuthorizationRequirements(); + expect(res.type).to.equal('oauth2'); + chai.assert.hasAllKeys(res, ['url', 'type']); + }); + }); + + describe('processAuthorizationCallback tests', async () => { + it('asserts that the original manager has a working credential', async () => { + const res = await manager.testAuth(); + expect(res).to.be.true; + }); + }); + + describe('getEntityOptions tests', async () => { + // NA + }); + + describe('findOrCreateEntity tests', async () => { + it('should create a new entity for the selected profile and attach to manager', async () => { + const userDetails = await manager.api.getUser(); + const entityRes = await manager.findOrCreateEntity({ + companyId: userDetails.data.company_id, + companyName: userDetails.data.company_name, + }); + + expect(entityRes.entity_id).to.exist; + }); + }); + describe('testAuth tests', async () => { + it('Should refresh token and update the credential with new token', async () => { + const badAccessToken = 'smith'; + manager.api.access_token = badAccessToken; + await manager.testAuth(); + + const posttoken = manager.api.access_token; + expect('smith').to.not.equal(posttoken); + const credential = await manager.credentialMO.get( + manager.entity.credential + ); + expect(credential.accessToken).to.equal(posttoken); + }); + }); + + describe('receiveNotification tests', async () => { + it('should fail to refresh token and mark auth as invalid', async () => { + // Need to use a valid but old refresh token, + // so we need to refresh first + const oldRefresh = manager.api.refresh_token; + const badAccessToken = + 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzZWFuLm1hdHRoZXdzQGxlZnRob29rLmNvbSIsImlhdCI6MTYzNTUzMDk3OCwiZXhwIjoxNjM1NTM4MTc4LCJiZW50byI6ImFwcDFlIiwiYWN0Ijp7InN1YiI6IlZob0NzMFNRZ25Fa2RDanRkaFZLemV5bXBjNW9valZoRXB2am03Rjh1UVEiLCJuYW1lIjoiTGVmdCBIb29rIiwiaXNzIjoiZmxhZ3NoaXAiLCJ0eXBlIjoiYXBwIn0sIm9yZ191c2VyX2lkIjoxLCJhdWQiOiJMZWZ0IEhvb2siLCJzY29wZXMiOiJBSkFBOEFIUUFCQUJRQT09Iiwib3JnX2d1aWQiOiJmNzY3MDEzZC1mNTBiLTRlY2QtYjM1My0zNWU0MWQ5Y2RjNGIiLCJvcmdfc2hvcnRuYW1lIjoibGVmdGhvb2tzYW5kYm94In0.XFmIai0GpAePsYeA4MjRntZS3iW6effmKmIhT7SBzTQ'; + manager.api.access_token = badAccessToken; + await manager.testAuth(); + expect(manager.api.access_token).to.not.equal(badAccessToken); + manager.api.access_token = badAccessToken; + manager.api.refresh_token = undefined; + + const authTest = await manager.testAuth(); + const credential = await manager.credentialMO.get( + manager.entity.credential + ); + credential.auth_is_valid.should.equal(false); + }); + }); +}); diff --git a/packages/v1-ready/zoho-crm/api.js b/packages/v1-ready/zoho-crm/api.js index 18f42de..823cf52 100644 --- a/packages/v1-ready/zoho-crm/api.js +++ b/packages/v1-ready/zoho-crm/api.js @@ -1,169 +1,605 @@ -const FormData = require('form-data'); -const {OAuth2Requester, get} = require('@friggframework/core'); +const { OAuth2Requester, get } = require('@friggframework/core'); class Api extends OAuth2Requester { constructor(params) { super(params); - // The majority of the properties for OAuth are default loaded by OAuth2Requester. - // This includes the `client_id`, `client_secret`, `scopes`, and `redirect_uri`. - this.baseUrl = 'https://www.zohoapis.com/crm/v6'; - this.authorizationUri = encodeURI( - `https://accounts.zoho.com/oauth/v2/auth?scope=${this.scope}&client_id=${this.client_id}&redirect_uri=${this.redirect_uri}&response_type=code&access_type=offline` - ); + this.baseUrl = 'https://www.zohoapis.com/crm/v8'; + + // OAuth2 configuration + this.authorizationUri = 'https://accounts.zoho.com/oauth/v2/auth'; this.tokenUri = 'https://accounts.zoho.com/oauth/v2/token'; - this.access_token = get(params, 'access_token', null); - this.refresh_token = get(params, 'refresh_token', null); + this.client_id = get(params, 'client_id', process.env.ZOHO_CLIENT_ID); + this.client_secret = get(params, 'client_secret', process.env.ZOHO_CLIENT_SECRET); + this.redirect_uri = get(params, 'redirect_uri', process.env.ZOHO_REDIRECT_URI); + this.scope = get(params, 'scope', 'ZohoCRM.modules.ALL,ZohoCRM.users.ALL'); this.URLs = { - // Users + // Users endpoints users: '/users', - user: (userId) => `/users/${userId}`, + userById: (userId) => `/users/${userId}`, + currentUser: '/users?type=CurrentUser', + + // Records endpoints (module-based) + records: (module) => `/${module}`, + recordById: (module, recordId) => `/${module}/${recordId}`, + recordsUpsert: (module) => `/${module}/upsert`, + recordsDeleted: (module) => `/${module}/deleted`, + + // Common modules + leads: '/Leads', + leadById: (leadId) => `/Leads/${leadId}`, + accounts: '/Accounts', + accountById: (accountId) => `/Accounts/${accountId}`, + contacts: '/Contacts', + contactById: (contactId) => `/Contacts/${contactId}`, + deals: '/Deals', + dealById: (dealId) => `/Deals/${dealId}`, + tasks: '/Tasks', + taskById: (taskId) => `/Tasks/${taskId}`, + events: '/Events', + eventById: (eventId) => `/Events/${eventId}`, + calls: '/Calls', + callById: (callId) => `/Calls/${callId}`, + + // Organization and settings + org: '/org', + modules: '/settings/modules', + fields: (module) => `/settings/fields?module=${module}`, + layouts: (module) => `/settings/layouts?module=${module}`, + customViews: (module) => `/settings/custom_views?module=${module}`, - // Roles - roles: '/settings/roles', - role: (roleId) => `/settings/roles/${roleId}`, + // Search and query + search: '/search', + coql: '/coql', - // Profiles - profiles: '/settings/profiles', + // Files and attachments + attachments: (module, recordId) => `/${module}/${recordId}/Attachments`, + photos: (module, recordId) => `/${module}/${recordId}/photo`, + + // Related records + relatedRecords: (module, recordId, relatedModule) => `/${module}/${recordId}/${relatedModule}`, }; } - getAuthUri() { - return this.authorizationUri; + async getAuthorizationUri() { + return `${this.authorizationUri}?response_type=code&client_id=${this.client_id}&scope=${this.scope}&redirect_uri=${this.redirect_uri}&access_type=offline`; } - async getTokenFromCode(code) { - // I had to override OAuth2Requester.getTokenFromCode method so I could send a form-data, - // as described in the docs: https://www.zoho.com/crm/developer/docs/api/v6/access-refresh.html - const formData = new FormData(); - formData.append('grant_type', 'authorization_code'); - formData.append('client_id', this.client_id); - formData.append('client_secret', this.client_secret); - formData.append('redirect_uri', this.redirect_uri); - formData.append('scope', this.scope); - formData.append('code', code); - const options = { - body: formData, - headers: formData.getHeaders(), - url: this.tokenUri, - }; - const response = await this._post(options, false); - await this.setTokens(response); - return response; + // Users API methods + async getUsers(options = {}) { + const query = this._cleanParams({ + type: options.type, + page: options.page, + per_page: options.per_page, + ids: options.ids + }); + + return this._get({ + url: this.baseUrl + this.URLs.users, + query + }); } - addJsonHeaders(options) { - const jsonHeaders = { - 'content-type': 'application/json', - Accept: 'application/json', - }; - options.headers = { - ...jsonHeaders, - ...options.headers, - } + async getUserById(userId) { + return this._get({ + url: this.baseUrl + this.URLs.userById(userId) + }); } - async _get(options, stringify) { - this.addJsonHeaders(options); - return super._get(options, stringify); + async getCurrentUser() { + return this._get({ + url: this.baseUrl + this.URLs.currentUser + }); } - async _post(options, stringify) { - this.addJsonHeaders(options); - return super._post(options, stringify); + async createUsers(body) { + return this._post({ + url: this.baseUrl + this.URLs.users, + body, + headers: { + 'Content-Type': 'application/json' + } + }); } - async _put(options, stringify) { - this.addJsonHeaders(options); - return super._put(options, stringify); + async updateUsers(body) { + return this._put({ + url: this.baseUrl + this.URLs.users, + body, + headers: { + 'Content-Type': 'application/json' + } + }); } - async _delete(options) { - this.addJsonHeaders(options); - const response = await super._delete(options); - return await this.parsedBody(response); + async updateUser(userId, body) { + return this._put({ + url: this.baseUrl + this.URLs.userById(userId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); } - // ************************** Users ********************************** - // https://www.zoho.com/crm/developer/docs/api/v6/get-users.html + async deleteUser(userId) { + return this._delete({ + url: this.baseUrl + this.URLs.userById(userId) + }); + } + + // Generic Records API methods + async getRecords(module, options = {}) { + const query = this._cleanParams({ + approved: options.approved, + converted: options.converted, + cvid: options.cvid, + ids: options.ids, + uid: options.uid, + fields: options.fields, + sort_by: options.sort_by, + sort_order: options.sort_order, + page: options.page, + per_page: options.per_page, + startDateTime: options.startDateTime, + endDateTime: options.endDateTime, + territory_id: options.territory_id, + include_child: options.include_child, + page_token: options.page_token + }); - async listUsers(queryParams = {}) { return this._get({ - url: this.baseUrl + this.URLs.users, - query: {...queryParams}, + url: this.baseUrl + this.URLs.records(module), + query }); } - async getUser(userId) { + async getRecordById(module, recordId, options = {}) { + const query = this._cleanParams({ + approved: options.approved, + converted: options.converted, + cvid: options.cvid, + uid: options.uid, + fields: options.fields, + startDateTime: options.startDateTime, + endDateTime: options.endDateTime, + territory_id: options.territory_id, + include_child: options.include_child + }); + return this._get({ - url: this.baseUrl + this.URLs.user(userId), + url: this.baseUrl + this.URLs.recordById(module, recordId), + query }); } - async createUser(body = {}) { + async createRecords(module, body) { return this._post({ - url: this.baseUrl + this.URLs.users, - body: body + url: this.baseUrl + this.URLs.records(module), + body, + headers: { + 'Content-Type': 'application/json' + } }); } - async updateUser(userId, body = {}) { + async updateRecords(module, body) { return this._put({ - url: this.baseUrl + this.URLs.user(userId), - body: body, + url: this.baseUrl + this.URLs.records(module), + body, + headers: { + 'Content-Type': 'application/json' + } }); } - async deleteUser(userId) { + async updateRecord(module, recordId, body) { + return this._put({ + url: this.baseUrl + this.URLs.recordById(module, recordId), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async upsertRecords(module, body) { + return this._post({ + url: this.baseUrl + this.URLs.recordsUpsert(module), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async deleteRecords(module, ids) { + const query = { ids }; return this._delete({ - url: this.baseUrl + this.URLs.user(userId), + url: this.baseUrl + this.URLs.records(module), + query + }); + } + + async deleteRecord(module, recordId) { + return this._delete({ + url: this.baseUrl + this.URLs.recordById(module, recordId) + }); + } + + async getDeletedRecords(module, options = {}) { + const query = this._cleanParams({ + type: options.type, + page: options.page, + per_page: options.per_page, + ids: options.ids + }); + + return this._get({ + url: this.baseUrl + this.URLs.recordsDeleted(module), + query + }); + } + + // Leads API methods + async getLeads(options = {}) { + return this.getRecords('Leads', options); + } + + async getLeadById(leadId, options = {}) { + return this.getRecordById('Leads', leadId, options); + } + + async createLeads(body) { + return this.createRecords('Leads', body); + } + + async updateLeads(body) { + return this.updateRecords('Leads', body); + } + + async updateLead(leadId, body) { + return this.updateRecord('Leads', leadId, body); + } + + async deleteLeads(ids) { + return this.deleteRecords('Leads', ids); + } + + async deleteLead(leadId) { + return this.deleteRecord('Leads', leadId); + } + + // Accounts API methods + async getAccounts(options = {}) { + return this.getRecords('Accounts', options); + } + + async getAccountById(accountId, options = {}) { + return this.getRecordById('Accounts', accountId, options); + } + + async createAccounts(body) { + return this.createRecords('Accounts', body); + } + + async updateAccounts(body) { + return this.updateRecords('Accounts', body); + } + + async updateAccount(accountId, body) { + return this.updateRecord('Accounts', accountId, body); + } + + async deleteAccounts(ids) { + return this.deleteRecords('Accounts', ids); + } + + async deleteAccount(accountId) { + return this.deleteRecord('Accounts', accountId); + } + + // Contacts API methods + async getContacts(options = {}) { + return this.getRecords('Contacts', options); + } + + async getContactById(contactId, options = {}) { + return this.getRecordById('Contacts', contactId, options); + } + + async createContacts(body) { + return this.createRecords('Contacts', body); + } + + async updateContacts(body) { + return this.updateRecords('Contacts', body); + } + + async updateContact(contactId, body) { + return this.updateRecord('Contacts', contactId, body); + } + + async deleteContacts(ids) { + return this.deleteRecords('Contacts', ids); + } + + async deleteContact(contactId) { + return this.deleteRecord('Contacts', contactId); + } + + // Deals API methods + async getDeals(options = {}) { + return this.getRecords('Deals', options); + } + + async getDealById(dealId, options = {}) { + return this.getRecordById('Deals', dealId, options); + } + + async createDeals(body) { + return this.createRecords('Deals', body); + } + + async updateDeals(body) { + return this.updateRecords('Deals', body); + } + + async updateDeal(dealId, body) { + return this.updateRecord('Deals', dealId, body); + } + + async deleteDeals(ids) { + return this.deleteRecords('Deals', ids); + } + + async deleteDeal(dealId) { + return this.deleteRecord('Deals', dealId); + } + + // Tasks API methods + async getTasks(options = {}) { + return this.getRecords('Tasks', options); + } + + async getTaskById(taskId, options = {}) { + return this.getRecordById('Tasks', taskId, options); + } + + async createTasks(body) { + return this.createRecords('Tasks', body); + } + + async updateTasks(body) { + return this.updateRecords('Tasks', body); + } + + async updateTask(taskId, body) { + return this.updateRecord('Tasks', taskId, body); + } + + async deleteTasks(ids) { + return this.deleteRecords('Tasks', ids); + } + + async deleteTask(taskId) { + return this.deleteRecord('Tasks', taskId); + } + + // Events API methods + async getEvents(options = {}) { + return this.getRecords('Events', options); + } + + async getEventById(eventId, options = {}) { + return this.getRecordById('Events', eventId, options); + } + + async createEvents(body) { + return this.createRecords('Events', body); + } + + async updateEvents(body) { + return this.updateRecords('Events', body); + } + + async updateEvent(eventId, body) { + return this.updateRecord('Events', eventId, body); + } + + async deleteEvents(ids) { + return this.deleteRecords('Events', ids); + } + + async deleteEvent(eventId) { + return this.deleteRecord('Events', eventId); + } + + // Calls API methods + async getCalls(options = {}) { + return this.getRecords('Calls', options); + } + + async getCallById(callId, options = {}) { + return this.getRecordById('Calls', callId, options); + } + + async createCalls(body) { + return this.createRecords('Calls', body); + } + + async updateCalls(body) { + return this.updateRecords('Calls', body); + } + + async updateCall(callId, body) { + return this.updateRecord('Calls', callId, body); + } + + async deleteCalls(ids) { + return this.deleteRecords('Calls', ids); + } + + async deleteCall(callId) { + return this.deleteRecord('Calls', callId); + } + + // Organization and settings methods + async getOrganization() { + return this._get({ + url: this.baseUrl + this.URLs.org + }); + } + + async getModules() { + return this._get({ + url: this.baseUrl + this.URLs.modules + }); + } + + async getFields(module) { + return this._get({ + url: this.baseUrl + this.URLs.fields(module) + }); + } + + async getLayouts(module) { + return this._get({ + url: this.baseUrl + this.URLs.layouts(module) }); } - // ************************** Roles ********************************** - // https://www.zoho.com/crm/developer/docs/api/v6/get-roles.html - - async listRoles() { + async getCustomViews(module) { return this._get({ - url: this.baseUrl + this.URLs.roles + url: this.baseUrl + this.URLs.customViews(module) }); } - async getRole(roleId) { + // Search and query methods + async search(options = {}) { + const query = this._cleanParams({ + criteria: options.criteria, + email: options.email, + phone: options.phone, + word: options.word, + page: options.page, + per_page: options.per_page + }); + return this._get({ - url: this.baseUrl + this.URLs.role(roleId) + url: this.baseUrl + this.URLs.search, + query }); } - async createRole(body = {}) { + async coqlQuery(queryString) { return this._post({ - url: this.baseUrl + this.URLs.roles, - body: body + url: this.baseUrl + this.URLs.coql, + body: { select_query: queryString }, + headers: { + 'Content-Type': 'application/json' + } }); } - async updateRole(roleId, body = {}) { + // Related records methods + async getRelatedRecords(module, recordId, relatedModule, options = {}) { + const query = this._cleanParams({ + page: options.page, + per_page: options.per_page, + fields: options.fields + }); + + return this._get({ + url: this.baseUrl + this.URLs.relatedRecords(module, recordId, relatedModule), + query + }); + } + + async createRelatedRecords(module, recordId, relatedModule, body) { + return this._post({ + url: this.baseUrl + this.URLs.relatedRecords(module, recordId, relatedModule), + body, + headers: { + 'Content-Type': 'application/json' + } + }); + } + + async updateRelatedRecords(module, recordId, relatedModule, body) { return this._put({ - url: this.baseUrl + this.URLs.role(roleId), - body: body, + url: this.baseUrl + this.URLs.relatedRecords(module, recordId, relatedModule), + body, + headers: { + 'Content-Type': 'application/json' + } }); } - async deleteRole(roleId, queryParams = {}) { + async deleteRelatedRecords(module, recordId, relatedModule, relatedIds) { + const query = { ids: relatedIds }; return this._delete({ - url: this.baseUrl + this.URLs.role(roleId), - query: {...queryParams}, + url: this.baseUrl + this.URLs.relatedRecords(module, recordId, relatedModule), + query }); } - // ************************** Profiles ********************************** - // https://www.zoho.com/crm/developer/docs/api/v6/get-profiles.html - - async listProfiles() { + // Attachments methods + async getAttachments(module, recordId) { return this._get({ - url: this.baseUrl + this.URLs.profiles + url: this.baseUrl + this.URLs.attachments(module, recordId) + }); + } + + async uploadAttachment(module, recordId, file) { + const FormData = require('form-data'); + const formData = new FormData(); + formData.append('file', file); + + return this._post({ + url: this.baseUrl + this.URLs.attachments(module, recordId), + body: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); + } + + // Helper methods + _cleanParams(params) { + const cleaned = {}; + Object.keys(params).forEach(key => { + if (params[key] !== undefined && params[key] !== null) { + cleaned[key] = params[key]; + } }); + return cleaned; + } + + // Legacy compatibility methods (for existing code) + async listUsers(options = {}) { + return this.getUsers(options); + } + + async find(module, options = {}) { + return this.getRecords(module, options); + } + + async findById(module, recordId, options = {}) { + return this.getRecordById(module, recordId, options); + } + + async create(module, body) { + return this.createRecords(module, body); + } + + async update(module, body) { + return this.updateRecords(module, body); + } + + async delete(module, ids) { + return this.deleteRecords(module, ids); } } -module.exports = {Api}; +module.exports = { Api }; diff --git a/packages/v1-ready/zoho-crm/definition.js b/packages/v1-ready/zoho-crm/definition.js index 4c188b8..9c98847 100644 --- a/packages/v1-ready/zoho-crm/definition.js +++ b/packages/v1-ready/zoho-crm/definition.js @@ -1,43 +1,44 @@ require('dotenv').config(); -const {Api} = require('./api'); -const {get} = require('@friggframework/core'); +const { Api } = require('./api'); +const { get } = require('@friggframework/core'); const config = require('./defaultConfig.json') const Definition = { API: Api, - getName: function() { + getName: function () { return config.name }, moduleName: config.name, + modelName: 'ZohoCRM', requiredAuthMethods: { - getToken: async function(api, params) { - const code = get(params.data, 'code'); - await api.getTokenFromCode(code); + getToken: async function (api, params) { + const code = get(params.data, 'code'); + return await api.getTokenFromCode(code); }, - apiPropertiesToPersist: { + apiPropertiesToPersist: { credential: ['access_token', 'refresh_token'], entity: [], }, getCredentialDetails: async function (api, userId) { - const response = await api.listUsers({type: 'CurrentUser'}); + const response = await api.listUsers({ type: 'CurrentUser' }); const currentUser = response.users[0]; return { - identifiers: {externalId: currentUser.id, user: userId}, + identifiers: { externalId: currentUser.id, user: userId }, details: {}, }; }, getEntityDetails: async function (api, callbackParams, tokenResponse, userId) { - const response = await api.listUsers({type: 'CurrentUser'}); + const response = await api.listUsers({ type: 'CurrentUser' }); const currentUser = response.users[0]; return { - identifiers: {externalId: currentUser.id, user: userId}, + identifiers: { externalId: currentUser.id, user: userId }, details: { name: currentUser.email }, } }, - testAuthRequest: async function(api) { - return await api.listUsers(); + testAuthRequest: async function (api) { + return await api.listUsers(); }, }, env: { @@ -48,4 +49,4 @@ const Definition = { } }; -module.exports = {Definition}; \ No newline at end of file +module.exports = { Definition }; \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/package.json b/packages/v1-ready/zoho-crm/package.json index a3c2cce..ce63f2b 100644 --- a/packages/v1-ready/zoho-crm/package.json +++ b/packages/v1-ready/zoho-crm/package.json @@ -11,7 +11,7 @@ "author": "", "license": "MIT", "devDependencies": { - "@friggframework/devtools": "^1.1.2", + "@friggframework/devtools": "^2.0.0-next.24", "@friggframework/test": "^1.1.2", "dotenv": "^16.0.3", "eslint": "^8.22.0", @@ -20,7 +20,7 @@ "prettier": "^2.7.1" }, "dependencies": { - "@friggframework/core": "^1.1.2" + "@friggframework/core": "^2.0.0-next.24" }, "publishConfig": { "access": "public" diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/README.md b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/README.md new file mode 100644 index 0000000..1b8a000 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/README.md @@ -0,0 +1,11 @@ +# Zoho CRM OpenAPI v8.0 Spec + +This folder contains the OpenAPI specification for Zoho CRM API version 8.0. + +## Source + +The specification was sourced from the official Zoho CRM OpenAPI repository: + +- GitHub: [Zohocorp-Pvt-Ltd/crm-oas (commit c405723)](https://github.com/Zohocorp-Pvt-Ltd/crm-oas/tree/c4057231ed9fbba907c4d6aefd8cd932d6e45b87/v8.0) + +Please refer to the above repository for the latest updates and documentation. \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/apis.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/apis.json new file mode 100644 index 0000000..81a01a4 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/apis.json @@ -0,0 +1,270 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "apis", + "description": "__apis", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/__apis": { + "get": { + "operationId": "Get Supported API", + "parameters": [ + { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "__apis": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "operation_types": { + "type": "array", + "items": { + "type": "object", + "properties": { + "method": { + "type": "string" + }, + "oauth_scope": { + "type": "string" + }, + "max_credits": { + "type": "integer", + "format": "int32" + }, + "min_credits": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "method", + "oauth_scope", + "max_credits", + "min_credits" + ] + } + } + }, + "required": [ + "path", + "operation_types" + ] + } + } + }, + "required": [ + "__apis" + ] + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/DependendField_Missing_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.read", + "ZohoCRM.settings.modules.all", + "ZohoCRM.settings.all" + ] + } + ], + "components": { + "schemas": { + "Invalid_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "MANDATORY_NOT_FOUND" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/DETAIL_1" + }, + { + "$ref": "#/components/schemas/DETAIL_2" + }, + { + "$ref": "#/components/schemas/DETAIL_3" + }, + { + "$ref": "#/components/schemas/DETAIL_4" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "DependendField_Missing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "details": { + "type": "object", + "properties": { + "dependee": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "json_path": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "param_name": { + "type": "string" + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "DETAIL_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "param_name": { + "type": "string" + } + } + }, + "DETAIL_2": { + "type": "object", + "properties": { + "json_path": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "param_name": { + "type": "string" + } + } + }, + "DETAIL_3": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "param_name": { + "type": "string" + } + } + }, + "DETAIL_4": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "param_name": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/appointment_preference.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/appointment_preference.json new file mode 100644 index 0000000..8a279e3 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/appointment_preference.json @@ -0,0 +1,445 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "appointment_preference", + "description": "Appointment Preference", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://www.zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/appointment_preferences": { + "get": { + "operationId": "Get Appointment Preference", + "parameters": [ + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "appointment_preferences": { + "$ref": "#/components/schemas/Appointment_Preference" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Appointment Preference", + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "appointment_preferences": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "appointment_preferences": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Dependant_Mismatch_API_Exception" + } + ] + } + } + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.appointments.ALL" + ] + } + ], + "components": { + "schemas": { + "Appointment_Preference": { + "type": "object", + "properties": { + "show_job_sheet": { + "type": "boolean", + "nullable": true + }, + "when_duration_exceeds": { + "type": "string", + "nullable": true + }, + "when_appointment_completed": { + "type": "string", + "enum": [ + "do_not_create_deal", + "create_deal" + ], + "nullable": true + }, + "allow_booking_outside_service_availability": { + "type": "boolean", + "nullable": true + }, + "allow_booking_outside_businesshours": { + "type": "boolean" + }, + "deal_record_configuration": { + "type": "object", + "properties": { + "layout": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "field_mappings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "static", + "merge_field" + ], + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "type", + "value", + "field" + ] + } + }, + "id": { + "type": "string" + } + }, + "required": [ + "layout", + "field_mappings" + ] + } + }, + "required": [ + "show_job_sheet", + "when_duration_exceeds", + "when_appointment_completed", + "allow_booking_outside_service_availability", + "deal_record_configuration" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "Appointments preferences updated successfully" + ] + }, + "details": { + "type": "object" + } + } + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + } + }, + "Primary_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Supported_Values": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "do_not_create_deal", + "create_deal" + ] + } + } + } + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Primary_Details" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Supported_Values" + } + ] + } + } + }, + "Dependant_Mismatch_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_MISMATCH" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "dependee": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "parameters": { + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/assignment_rules.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/assignment_rules.json new file mode 100644 index 0000000..9f95ba8 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/assignment_rules.json @@ -0,0 +1,731 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "assignment_rules", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/automation/assignment_rules": { + "get": { + "operationId": "Get Assignment Rules", + "parameters": [ + { + "name": "module", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/GetRulesResponse" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Assignment Rules", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Assignment Rules", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/RSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/automation/assignment_rules/{id}": { + "get": { + "operationId": "Get Assignment Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/GetRulesResponse" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Assignment Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/RSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Assignment Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/RSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.assignment_rules.ALL" + ] + } + ], + "components": { + "schemas": { + "default_assignee": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "user": { + "type": "object", + "properties": { + "zuid": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "name": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string" + } + }, + "required": [ + "zuid", + "name", + "id" + ] + }, + "assignment_rules": { + "type": "object", + "properties": { + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "default_assignee": { + "$ref": "#/components/schemas/default_assignee" + }, + "api_name": { + "type": "string" + }, + "modified_by": { + "$ref": "#/components/schemas/user" + }, + "created_by": { + "$ref": "#/components/schemas/user" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "description": { + "type": "string", + "nullable": true + } + }, + "required": [ + "created_time", + "modified_time", + "default_assignee", + "api_name", + "modified_by", + "created_by", + "id", + "name", + "module", + "description" + ] + }, + "RulesWrapper": { + "type": "object", + "properties": { + "assignment_rules": { + "items": { + "$ref": "#/components/schemas/assignment_rules" + }, + "type": "array" + } + }, + "required": [ + "assignment_rules" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "assignment_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "assignment_rules" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidModuleError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string", + "enum": [ + "the module name given seems to be invalid" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string", + "enum": [ + "One of the expected parameter is missing" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/MandatoryParamDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "MandatoryErrorWrapper": { + "type": "object", + "properties": { + "assignment_rules": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "assignment_rules" + ] + }, + "InvalidTypeErrorWrapper": { + "type": "object", + "properties": { + "assignment_rules": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "assignment_rules" + ] + }, + "InvalidValueErrorWrapper": { + "type": "object", + "properties": { + "assignment_rules": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "assignment_rules" + ] + }, + "Invalid_Data": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the name given seems to be invalid", + "the default_assignee given seems to be invalid", + "the id given seems to be invalid" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidDataWrapper": { + "type": "object", + "properties": { + "assignment_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + } + }, + "required": [ + "assignment_rules" + ] + }, + "DUPLICATE_DATA": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the given assignment rule name already exists" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "DuplicateDataWrapper": { + "type": "object", + "properties": { + "assignment_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DUPLICATE_DATA" + } + ] + }, + "type": "array" + } + }, + "required": [ + "assignment_rules" + ] + } + }, + "responses": { + "GetRulesResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/RulesWrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "RSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidModuleError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/MandatoryErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidDataWrapper" + }, + { + "$ref": "#/components/schemas/DuplicateDataWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidModuleError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RulesWrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/associate_email.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/associate_email.json new file mode 100644 index 0000000..49736b0 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/associate_email.json @@ -0,0 +1,511 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "associate_email", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{recordId}/actions/associate_email": { + "post": { + "operationId": "associate", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/recordId" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/Body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/actions/email_available": { + "get": { + "operationId": "email_available", + "parameters": [ + { + "$ref": "#/components/parameters/orginal_message_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/AvailableResponse" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.emails.{module_API_name}.ALL", + "ZohoCRM.modules.emails.ALL" + ] + } + ], + "components": { + "schemas": { + "from": { + "type": "object", + "properties": { + "user_name": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]zoho[.]com" + } + }, + "required": [ + "user_name", + "email" + ] + }, + "attachments": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "to": { + "type": "object", + "properties": { + "user_name": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]zoho[.]com" + } + }, + "required": [ + "user_name", + "email" + ] + }, + "ModuleMap": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "linked_record": { + "type": "object", + "properties": { + "module": { + "$ref": "#/components/schemas/ModuleMap" + }, + "id": { + "type": "string" + } + }, + "required": [ + "module", + "id" + ] + }, + "associate_email": { + "type": "object", + "properties": { + "from": { + "$ref": "#/components/schemas/from" + }, + "to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/to" + } + }, + "cc": { + "items": { + "$ref": "#/components/schemas/to" + }, + "type": "array" + }, + "bcc": { + "items": { + "$ref": "#/components/schemas/to" + }, + "type": "array" + }, + "attachments": { + "items": { + "$ref": "#/components/schemas/attachments" + }, + "type": "array" + }, + "content": { + "type": "string" + }, + "mail_format": { + "type": "string", + "enum": [ + "html", + "text" + ] + }, + "subject": { + "type": "string", + "minLength": 1, + "maxLength": 250 + }, + "original_message_id": { + "type": "string" + }, + "sent": { + "type": "boolean" + }, + "date_time": { + "type": "string", + "format": "date-time" + }, + "linked_record": { + "$ref": "#/components/schemas/linked_record" + } + }, + "required": [ + "from", + "to", + "original_message_id", + "sent", + "date_time", + "linked_record" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "Emails": { + "items": { + "$ref": "#/components/schemas/associate_email" + }, + "type": "array" + } + }, + "required": [ + "Emails" + ] + }, + "record": { + "type": "object", + "properties": { + "module": { + "$ref": "#/components/schemas/ModuleMap" + }, + "id": { + "type": "string" + }, + "linked_record": { + "$ref": "#/components/schemas/linked_record" + } + }, + "required": [ + "module", + "id", + "linked_record" + ] + }, + "available": { + "type": "object", + "properties": { + "available": { + "type": "boolean" + }, + "record": { + "$ref": "#/components/schemas/record" + }, + "linked_record": { + "$ref": "#/components/schemas/linked_record" + } + }, + "required": [ + "available", + "record" + ] + }, + "details": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + } + }, + "required": [ + "message_id" + ] + }, + "SUCCESS": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "Emails": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SUCCESS" + } + ] + }, + "type": "array" + } + }, + "required": [ + "Emails" + ] + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + }, + "InvalidDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "expected_data_type" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryDetails" + }, + { + "$ref": "#/components/schemas/MandatoryParamDetails" + }, + { + "$ref": "#/components/schemas/InvalidDetails" + } + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "ErrorWrapper": { + "type": "object", + "properties": { + "Emails": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + }, + "type": "array" + } + }, + "required": [ + "Emails" + ] + } + }, + "responses": { + "AvailableResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/available" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorWrapper" + }, + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "recordId": { + "name": "recordId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "orginal_message_id": { + "name": "orginal_message_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "Body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/attachments.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/attachments.json new file mode 100644 index 0000000..4e6047a --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/attachments.json @@ -0,0 +1,731 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "attachments", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{record_id}/Attachments": { + "post": { + "operationId": "Upload Url Attachments", + "parameters": [ + { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/attachmentUrl" + }, + { + "$ref": "#/components/parameters/title" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "get": { + "operationId": "Get Attachments", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/page_token" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Attachments" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Attachments", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/{module}/{record_id}/Attachments/{id}": { + "get": { + "operationId": "Get Attachment", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ImageResponse" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Attachment", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.{module_API_name}.ALL", + "ZohoCRM.modules.attachments.ALL" + ] + } + ], + "components": { + "schemas": { + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + }, + "owner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "Success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "#/components/schemas/owner" + }, + "Created_By": { + "$ref": "#/components/schemas/owner" + } + }, + "required": [ + "id", + "Modified_Time", + "Created_Time", + "Modified_By", + "Created_By" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "Parent_Id": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + }, + "Attachment": { + "type": "object", + "properties": { + "Owner": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Parent_Id": { + "$ref": "#/components/schemas/Parent_Id" + }, + "$sharing_permission": { + "type": "string" + }, + "$attachment_type": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "File_Name": { + "type": "string", + "nullable": true + }, + "Size": { + "type": "string" + }, + "$editable": { + "type": "boolean" + }, + "$file_id": { + "type": "string" + }, + "$type": { + "type": "string" + }, + "$se_module": { + "type": "string" + }, + "$state": { + "type": "string" + }, + "$link_url": { + "type": "string", + "nullable": true + } + }, + "required": [ + "Owner", + "Modified_By", + "Created_By", + "Parent_Id", + "id", + "Modified_Time", + "Created_Time", + "File_Name", + "Size", + "$editable", + "$file_id", + "$type", + "$se_module", + "$state", + "$link_url" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + }, + "required": [ + "per_page", + "page", + "count", + "more_records" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "details": { + "type": "object", + "properties": { + "related_status": { + "type": "string", + "enum": [ + "invalid" + ] + }, + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "related_status", + "resource_path_index" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "details", + "code", + "message", + "status" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_REQUEST" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "expected_type": { + "type": "string", + "nullable": true + } + }, + "required": [ + "expected_type" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "Attachments": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Attachment" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "data", + "info" + ] + } + ] + } + } + } + }, + "ImageResponse": { + "description": "", + "content": { + "image/png": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "attachmentUrl": { + "name": "attachmentUrl", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "title": { + "name": "title", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "fields": { + "name": "fields", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "page_token": { + "name": "page_token", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/audit_log_export.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/audit_log_export.json new file mode 100644 index 0000000..36f420d --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/audit_log_export.json @@ -0,0 +1,738 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "audit_log_export", + "description": "Bulk Read", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/audit_log_export": { + "post": { + "operationId": "Create AuditLog Export", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BodyWrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ScheduledResponse" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/DependentMismatchError" + }, + { + "$ref": "#/components/schemas/ExpectedFieldMissingError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/NotSupportedError" + }, + { + "$ref": "#/components/schemas/DependentFieldError" + }, + { + "$ref": "#/components/schemas/InvalidValueError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/AmbiguityError" + }, + { + "$ref": "#/components/schemas/LimitExccededResponse" + }, + { + "$ref": "#/components/schemas/DependentFieldException" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Exported Auditlogs", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ResponseWrapper" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlPattern" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/audit_log_export/{id}": { + "get": { + "operationId": "Get Exported AuditLog", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ResponseWrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlPattern" + } + ] + } + } + } + } + } + } + }, + "/{download_url}": { + "get": { + "operationId": "Download Export Audit Log Result", + "parameters": [ + { + "$ref": "#/components/parameters/download_url" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + ] + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Forbidden" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.audit_logs.CREATE" + ] + } + ], + "components": { + "schemas": { + "BodyWrapper": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "$ref": "#/components/schemas/AuditLogExport" + }, + "type": "array" + } + }, + "required": [ + "audit_log_export" + ] + }, + "ResponseWrapper": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "$ref": "#/components/schemas/AuditLogExport" + }, + "type": "array" + } + } + }, + "AuditLogExport": { + "type": "object", + "properties": { + "criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "created_by": { + "$ref": "#/components/schemas/User" + }, + "download_links": { + "type": "array", + "items": { + "type": "string", + "nullable": true + } + }, + "job_start_time": { + "type": "string", + "format": "date-time" + }, + "job_end_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "expiry_date": { + "type": "string", + "format": "date-time", + "nullable": true + } + }, + "required": [ + "criteria" + ] + }, + "Criteria": { + "type": "object", + "properties": { + "field": { + "$ref": "#/components/schemas/Field" + }, + "comparator": { + "type": "string" + }, + "value": { + "type": "object" + }, + "group_operator": { + "type": "string" + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "field", + "comparator", + "value", + "group_operator", + "group" + ] + }, + "Module": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Field": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + }, + "ScheduledResponse": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Scheduled" + } + ] + }, + "type": "array" + } + } + }, + "DependentFieldException": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DependetMismatch" + } + ] + }, + "type": "array" + } + } + }, + "DependetMismatch": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_MISMATCH" + ] + }, + "details": { + "$ref": "#/components/schemas/DependetDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "DependetDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "dependee": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/BodyErrorDetails" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "dependee", + "api_name", + "json_path" + ] + }, + "Scheduled": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SCHEDULED" + ] + }, + "details": { + "$ref": "#/components/schemas/Id" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + } + }, + "Id": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "NotSupported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_SUPPORTED" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "LimitExcceded": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "details": { + "$ref": "#/components/schemas/LimitDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "LimitDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "limit": { + "type": "string" + } + } + }, + "LimitExccededResponse": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/LimitExcceded" + } + ] + }, + "type": "array" + } + } + }, + "InvalidValueError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + } + }, + "NotSupportedError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/NotSupported" + } + ] + }, + "type": "array" + } + } + }, + "ExpectedFieldMissingError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/ExpectedFieldMissingError" + } + ] + }, + "type": "array" + } + } + }, + "DependentFieldError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/DependentFieldError" + } + ] + }, + "type": "array" + } + } + }, + "MandatoryError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + } + }, + "DependentMismatchError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/DependentMismatchError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidUrlPattern": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Forbidden": { + "type": "object", + "properties": { + "x-error": { + "type": "string" + }, + "info": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "AmbiguityError": { + "type": "object", + "properties": { + "audit_log_export": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/AmbiguityError" + } + ] + }, + "type": "array" + } + } + }, + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "download_url": { + "name": "download_url", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/available_currencies.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/available_currencies.json new file mode 100644 index 0000000..bdc8722 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/available_currencies.json @@ -0,0 +1,146 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "available_currencies", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/org/currencies/actions/available_currencies": { + "get": { + "operationId": "Get Available Currencies", + "responses": { + "200": { + "$ref": "#/components/responses/GetAvailableCurrencies" + }, + "500": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.currencies.{operation_type}" + ] + } + ], + "components": { + "schemas": { + "currency": { + "type": "object", + "properties": { + "display_value": { + "type": "string" + }, + "decimal_separator": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "thousand_separator": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "iso_code": { + "type": "string" + }, + "decimal_places": { + "type": "string" + } + }, + "required": [ + "display_value", + "decimal_separator", + "symbol", + "thousand_separator", + "display_name", + "iso_code", + "decimal_places" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "available_currencies": { + "items": { + "$ref": "#/components/schemas/currency" + }, + "type": "array" + } + }, + "required": [ + "available_currencies" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "responses": { + "GetAvailableCurrencies": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/backup.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/backup.json new file mode 100644 index 0000000..5563798 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/backup.json @@ -0,0 +1,776 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "backup", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/bulk/v8/backup": { + "post": { + "operationId": "SCHEDULE", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + }, + "get": { + "operationId": "Get DETAILS", + "responses": { + "200": { + "$ref": "#/components/responses/BackupResponse" + } + } + } + }, + "/crm/bulk/v8/backup/urls": { + "get": { + "operationId": "Get URLS", + "responses": { + "200": { + "$ref": "#/components/responses/UrlsResponse" + }, + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/crm/bulk/v8/backup/history": { + "get": { + "operationId": "HISTORY", + "parameters": [ + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/HistoryResponse" + } + } + } + }, + "/crm/bulk/v8/backup/{id}/actions/cancel": { + "put": { + "operationId": "Cancel", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + } + }, + "/{download_url}": { + "get": { + "operationId": "Download Backed Up Data", + "parameters": [ + { + "$ref": "#/components/parameters/download_url" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + }, + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.bulk.backup.ALL" + ] + } + ], + "components": { + "schemas": { + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + }, + "requester": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "zuid": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "zuid" + ] + }, + "backup": { + "type": "object", + "properties": { + "rrule": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + }, + "start_date": { + "type": "string", + "format": "date-time" + }, + "scheduled_date": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + }, + "requester": { + "$ref": "#/components/schemas/requester" + } + }, + "required": [ + "rrule", + "id", + "start_date", + "scheduled_date", + "status", + "requester" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "backup": { + "$ref": "#/components/schemas/backup" + } + }, + "required": [ + "backup" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "backup": { + "$ref": "#/components/schemas/backup" + } + }, + "required": [ + "backup" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "backup": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + } + }, + "required": [ + "backup" + ] + }, + "Already_Canceled": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "ALREADY_CANCELLED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Request_Body_Not_Readable": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUEST_BODY_NOT_READABLE" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Data": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/Invalid_Details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Already_Scheduled": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "BACKUP_ALREADY_SCHEDULED" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Resource_Not_Found": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "RESOURCE_NOT_FOUND" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Inprogress": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INPROGRESS" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "backup": { + "oneOf": [ + { + "$ref": "#/components/schemas/Already_Scheduled" + }, + { + "$ref": "#/components/schemas/Already_Canceled" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Inprogress" + } + ] + } + }, + "required": [ + "backup" + ] + }, + "history": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "log_time": { + "type": "string", + "format": "date-time" + }, + "action": { + "type": "string" + }, + "repeat_type": { + "type": "string", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32" + }, + "file_name": { + "type": "string", + "nullable": true + }, + "state": { + "type": "string", + "nullable": true + }, + "done_by": { + "$ref": "#/components/schemas/requester" + } + }, + "required": [ + "id", + "log_time", + "action", + "repeat_type", + "count", + "file_name", + "state", + "done_by" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + }, + "HistoryWrapper": { + "type": "object", + "properties": { + "history": { + "items": { + "$ref": "#/components/schemas/history" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "history", + "info" + ] + }, + "urls": { + "type": "object", + "properties": { + "data_links": { + "type": "array", + "items": { + "type": "string" + } + }, + "attachment_links": { + "type": "array", + "items": { + "type": "string" + } + }, + "expiry_date": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "data_links", + "attachment_links", + "expiry_date" + ] + }, + "UrlsWrapper": { + "type": "object", + "properties": { + "urls": { + "$ref": "#/components/schemas/urls" + } + }, + "required": [ + "urls" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "RESOURCE_NOT_FOUND", + "ALREADY_CANCELLED", + "BACKUP_ALREADY_SCHEDULED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + } + }, + "responses": { + "BackupResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "Error_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/Resource_Not_Found" + }, + { + "$ref": "#/components/schemas/Request_Body_Not_Readable" + } + ] + } + } + } + }, + "HistoryResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/HistoryWrapper" + } + ] + } + } + } + }, + "UrlsResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/UrlsWrapper" + } + ] + } + } + } + }, + "NoContent": { + "description": "" + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "download_url": { + "name": "download_url", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/blueprint.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/blueprint.json new file mode 100644 index 0000000..66ef669 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/blueprint.json @@ -0,0 +1,949 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "blueprint", + "description": "Blue Print", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/{record_id}/actions/blueprint": { + "get": { + "operationId": "Get BluePrint", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.all" + ] + } + ] + }, + "put": { + "operationId": "Update BluePrint", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.all" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Next_Transition": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "criteria_matched": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + }, + "View_Type": { + "type": "object", + "properties": { + "view": { + "type": "boolean", + "nullable": true + }, + "edit": { + "type": "boolean", + "nullable": true + }, + "create": { + "type": "boolean", + "nullable": true + }, + "quick_create": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "view", + "edit", + "create", + "quick_create" + ] + }, + "Layout": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name" + ] + }, + "ToolTip": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "value" + ] + }, + "Formula": { + "type": "object", + "properties": { + "return_type": { + "type": "string", + "nullable": true + }, + "expression": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "return_type", + "expression" + ] + }, + "Auto_Number": { + "type": "object", + "properties": { + "prefix": { + "type": "string", + "nullable": true + }, + "suffix": { + "type": "string", + "nullable": true + }, + "start_number": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "prefix", + "suffix", + "start_number" + ] + }, + "Lookup_And_Subform": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "module": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "display_label", + "api_name", + "module", + "id" + ] + }, + "Currency": { + "type": "object", + "properties": { + "rounding_option": { + "type": "string", + "nullable": true + }, + "precision": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "rounding_option", + "precision" + ] + }, + "escalation": { + "type": "object", + "properties": { + "days": { + "type": "integer", + "format": "int32" + }, + "status": { + "type": "string" + } + } + }, + "Process_Info": { + "type": "object", + "properties": { + "field_id": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "is_continuous": { + "type": "boolean", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "continuous": { + "type": "boolean", + "nullable": true + }, + "field_label": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "column_name": { + "type": "string", + "nullable": true + }, + "field_value": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "field_name": { + "type": "string", + "nullable": true + }, + "escalation": { + "$ref": "#/components/schemas/escalation" + }, + "current_picklist": { + "$ref": "#/components/schemas/current_picklist" + } + }, + "required": [ + "field_id", + "is_continuous", + "api_name", + "continuous", + "field_label", + "name", + "column_name", + "field_value", + "id", + "field_name" + ] + }, + "current_picklist": { + "type": "object", + "properties": { + "colour_code": { + "type": "string" + }, + "id": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "Lookup_Field": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name" + ] + }, + "Association_Details": { + "type": "object", + "properties": { + "lookup_field": { + "$ref": "#/components/schemas/Lookup_Field" + }, + "related_field": { + "$ref": "#/components/schemas/Lookup_Field" + } + }, + "required": [ + "lookup_field", + "related_field" + ] + }, + "Crypt": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "nullable": true + }, + "column": { + "type": "string", + "nullable": true + }, + "table": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "mode", + "column", + "table", + "status" + ] + }, + "Multi_Select_Lookup": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "linking_module": { + "type": "string", + "nullable": true + }, + "lookup_apiname": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "connectedlookup_apiname": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "display_label", + "linking_module", + "lookup_apiname", + "api_name", + "connectedlookup_apiname", + "id" + ] + }, + "Field": { + "type": "object", + "properties": { + "external": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/external" + }, + "display_type": { + "type": "integer", + "format": "int32", + "enum": [ + -1, + 2 + ] + }, + "filterable": { + "type": "boolean" + }, + "pick_list_values_sorted_lexically": { + "type": "boolean" + }, + "sortable": { + "type": "boolean" + }, + "ui_type": { + "type": "integer", + "format": "int32" + }, + "private": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/private" + }, + "system_mandatory": { + "type": "boolean", + "nullable": true + }, + "webhook": { + "type": "boolean", + "nullable": true + }, + "json_type": { + "type": "string", + "nullable": true + }, + "crypt": { + "$ref": "#/components/schemas/Crypt" + }, + "field_label": { + "type": "string", + "nullable": true + }, + "tooltip": { + "$ref": "#/components/schemas/ToolTip" + }, + "created_source": { + "type": "string", + "nullable": true + }, + "layouts": { + "$ref": "#/components/schemas/Layout" + }, + "field_read_only": { + "type": "boolean", + "nullable": true + }, + "content": { + "type": "string", + "nullable": true + }, + "display_label": { + "type": "string", + "nullable": true + }, + "validation_rule": { + "type": "string", + "nullable": true + }, + "read_only": { + "type": "boolean", + "nullable": true + }, + "association_details": { + "$ref": "#/components/schemas/Association_Details" + }, + "multi_module_lookup": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/multi_module_lookup" + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "id": { + "type": "string", + "nullable": true + }, + "custom_field": { + "type": "boolean", + "nullable": true + }, + "lookup": { + "$ref": "#/components/schemas/Lookup_And_Subform" + }, + "convert_mapping": { + "type": "object", + "nullable": true + }, + "visible": { + "type": "boolean", + "nullable": true + }, + "length": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "column_name": { + "type": "string", + "nullable": true + }, + "_type": { + "type": "string", + "nullable": true + }, + "view_type": { + "$ref": "#/components/schemas/View_Type" + }, + "transition_sequence": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "unique": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/unique" + }, + "history_tracking": { + "type": "boolean", + "nullable": true + }, + "data_type": { + "type": "string", + "nullable": true + }, + "formula": { + "$ref": "#/components/schemas/Formula" + }, + "decimal_place": { + "type": "string", + "nullable": true + }, + "multiselectlookup": { + "$ref": "#/components/schemas/Multi_Select_Lookup" + }, + "pick_list_values": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/pick_list_values" + }, + "type": "array" + }, + "auto_number": { + "$ref": "#/components/schemas/Auto_Number" + }, + "personality_name": { + "type": "string", + "nullable": true + }, + "mandatory": { + "type": "boolean", + "nullable": true + }, + "quick_sequence_number": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "profiles": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "permission_type": { + "type": "string" + } + } + } + } + }, + "required": [ + "system_mandatory", + "webhook", + "json_type", + "crypt", + "field_label", + "tooltip", + "created_source", + "layouts", + "field_read_only", + "content", + "display_label", + "validation_rule", + "read_only", + "association_details", + "multi_module_lookup", + "currency", + "id", + "custom_field", + "lookup", + "convert_mapping", + "visible", + "length", + "column_name", + "_type", + "view_type", + "transition_sequence", + "api_name", + "unique", + "history_tracking", + "data_type", + "formula", + "decimal_place", + "multiselectlookup", + "pick_list_values", + "auto_number", + "personality_name", + "mandatory", + "quick_sequence_number" + ] + }, + "Transition": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "execution_time": { + "type": "string", + "format": "date-time" + }, + "sequence": { + "type": "integer", + "format": "int32" + }, + "next_transitions": { + "items": { + "$ref": "#/components/schemas/Next_Transition" + }, + "type": "array" + }, + "parent_transition": { + "$ref": "#/components/schemas/Transition" + }, + "percent_partial_save": { + "type": "number", + "format": "double", + "nullable": true + }, + "data": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "next_field_value": { + "type": "string", + "nullable": true + }, + "text_color_code": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "criteria_matched": { + "type": "boolean", + "nullable": true + }, + "id": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "fields": { + "items": { + "$ref": "#/components/schemas/Field" + }, + "type": "array" + }, + "color_code": { + "type": "string", + "nullable": true + }, + "criteria_message": { + "type": "string", + "nullable": true + } + }, + "required": [ + "next_transitions", + "percent_partial_save", + "data", + "next_field_value", + "text_color_code", + "name", + "criteria_matched", + "id", + "fields", + "color_code", + "criteria_message" + ] + }, + "Blue_Print": { + "type": "object", + "properties": { + "transition_id": { + "type": "string", + "nullable": true + }, + "data": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "process_info": { + "$ref": "#/components/schemas/Process_Info" + }, + "transitions": { + "items": { + "$ref": "#/components/schemas/Transition" + }, + "type": "array" + } + }, + "required": [ + "transition_id", + "data", + "process_info", + "transitions" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "blueprint": { + "$ref": "#/components/schemas/Blue_Print" + } + }, + "required": [ + "blueprint" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "transition updated successfully" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "blueprint": { + "items": { + "$ref": "#/components/schemas/Blue_Print" + }, + "type": "array" + } + }, + "required": [ + "blueprint" + ] + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "RECORD_NOT_IN_PROCESS", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid oauth token", + "record not in process", + "Please check if the URL trying to access is a correct one", + "invalid transition", + "The http request method type is not a valid one", + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "message": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "info_message": { + "type": "string" + }, + "parent_api_name": { + "type": "string" + } + }, + "required": [ + "api_name", + "message", + "expected_data_type", + "info_message", + "parent_api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_read.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_read.json new file mode 100644 index 0000000..dc79ac0 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_read.json @@ -0,0 +1,1037 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "bulk_read", + "description": "Bulk Read", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/bulk/v8/read": { + "post": { + "operationId": "Create Bulk Read Job", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Request_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + }, + "info": { + "type": "object" + } + }, + "required": [ + "data", + "info" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Bulk_Read_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Request_Body_Not_Supported" + }, + { + "$ref": "#/components/schemas/Field_Criteria_Not_Supported" + }, + { + "$ref": "#/components/schemas/Ambiguous_Criteria" + }, + { + "$ref": "#/components/schemas/Invalid_Callback" + }, + { + "$ref": "#/components/schemas/Group_Operator_Not_Supported" + }, + { + "$ref": "#/components/schemas/Page_Range_Exceeded" + }, + { + "$ref": "#/components/schemas/Module_Not_Supported" + }, + { + "$ref": "#/components/schemas/Cvid_Not_Supported" + }, + { + "$ref": "#/components/schemas/Bulk_Read_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Criteria" + }, + { + "$ref": "#/components/schemas/Value_Type_Not_Supported" + } + ] + } + } + } + } + } + } + }, + "/crm/bulk/v8/read/{job_id}": { + "get": { + "operationId": "Get Bulk Read Job Details", + "parameters": [ + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Not_Found" + } + ] + } + } + } + } + } + } + }, + "/crm/bulk/v8/read/{job_id}/result": { + "get": { + "operationId": "Download Result", + "parameters": [ + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/x-download": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Not_Found" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.bulk.all", + "ZohoCRM.modules.all" + ] + } + ], + "components": { + "schemas": { + "Criteria": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "value": { + "type": "object" + }, + "group_operator": { + "type": "string", + "enum": [ + "or", + "and" + ] + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + }, + "field": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/Minified_Field" + }, + "comparator": { + "type": "string", + "enum": [ + "in", + "greater_equal", + "starts_with", + "equal", + "contains", + "ends_with", + "not_contains", + "not_equal", + "not_in", + "greater_than", + "less_than", + "not_between", + "less_equal", + "between" + ] + } + }, + "required": [ + "type" + ] + }, + "Query": { + "type": "object", + "properties": { + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "cvid": { + "type": "string", + "nullable": true + }, + "fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "page": { + "type": "integer", + "format": "int32", + "pattern": "[1-9]|[1-4][1-9]|50", + "nullable": true + }, + "criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "file_type": { + "type": "string", + "enum": [ + "ics" + ] + }, + "page_token": { + "type": "string" + } + }, + "required": [ + "module", + "cvid", + "fields", + "page", + "criteria", + "file_type" + ] + }, + "CallBack": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "post" + ] + } + }, + "required": [ + "url", + "method" + ] + }, + "Result": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "download_url": { + "type": "string" + }, + "per_page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + }, + "next_page_token": { + "type": "string" + } + }, + "required": [ + "page", + "count", + "download_url", + "per_page", + "more_records", + "next_page_token" + ] + }, + "Job_Detail": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "operation": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "COMPLETED", + "ADDED", + "IN PROGRESS", + "FAILURE" + ] + }, + "query": { + "$ref": "#/components/schemas/Query" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "result": { + "$ref": "#/components/schemas/Result" + }, + "file_type": { + "type": "string", + "enum": [ + "csv" + ] + } + }, + "required": [ + "id", + "operation", + "state", + "query", + "created_by", + "created_time", + "result", + "file_type" + ] + }, + "Request_Wrapper": { + "type": "object", + "properties": { + "callback": { + "$ref": "#/components/schemas/CallBack" + }, + "query": { + "$ref": "#/components/schemas/Query" + }, + "file_type": { + "type": "string", + "enum": [ + "csv", + "ics" + ] + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Job_Detail" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "ADDED_SUCCESSFULLY" + ] + }, + "message": { + "type": "string", + "enum": [ + "Added successfully." + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "operation": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "COMPLETED", + "ADDED", + "IN PROGRESS", + "FAILURE" + ] + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "created_time": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "operation", + "state", + "created_by", + "created_time" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Field_Criteria_Not_Supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "FIELD_IN_CRITERIA_NOT_SUPPORTED", + "FIELD_COMPARATOR_IN_CRITERIA_NOT_SUPPORTED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Ambiguous_Criteria": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "AMBIGUOUS_CRITERIA", + "AMBIGUOUS_GROUP_IN_CRITERIA" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Callback": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_CALLBACK_METHOD", + "INVALID_CALLBACK_URL" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Value_Type_Not_Supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "VALUE_TYPE_NOT_SUPPORTED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Group_Operator_Not_Supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "GROUP_OPERATOR_NOT_SUPPORTED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Page_Range_Exceeded": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "PAGE_RANGE_EXCEEDED" + ] + }, + "details": { + "type": "object", + "properties": { + "max_limit": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "max_limit" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Module_Not_Supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MODULE_NOT_SUPPORTED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Criteria": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_CRITERIA" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Cvid_Not_Supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "CVID_NOT_SUPPORTED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Resource_Not_Found": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "RESOURCE_NOT_FOUND" + ] + }, + "details": { + "type": "object", + "properties": { + "resource": { + "type": "string" + } + }, + "required": [ + "resource" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Bulk_Read_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUEST_BODY_IS_EMPTY", + "MODULE_NOT_AVAILABLE", + "TOO_MANY_REQUESTS", + "COMPARATOR_AND_ENCRYPTED_VALUE_IN_CRITERIA_NOT_COMPATIBLE", + "PAGE_NOT_SUPPORTED", + "NOT_SUPPORTED_FEATURE", + "FIELD_NOT_SUPPORTED", + "QUERY_NOT_SUPPORTED", + "VALUE_LIMIT_EXCEEDED_IN_CRITERIA", + "JOB_NOT_SUPPORTED", + "CRITERIA_LIMIT_EXCEEDED", + "INVALID_CRITERIA", + "REQUEST_BODY_NOT_READABLE", + "FIELD_AND_COMPARATOR_IN_CRITERIA_NOT_COMPATIBLE", + "COMPARATOR_AND_VALUE_IN_CRITERIA_NOT_COMPATIBLE", + "INVALID_URL_PATTERN", + "NO_PERMISSION", + "FIELD_AND_VALUE_IN_CRITERIA_NOT_COMPATIBLE", + "RESOURCE_NOT_FOUND", + "FIELD_IN_CRITERIA_NOT_AVAILABLE", + "VALUE_IN_CRITERIA_NOT_SUPPORTED", + "MEDIA_TYPE_NOT_SUPPORTED", + "INVALID_BULK_OPERATION", + "CALLBACK_FAILURE", + "INVALID_SERVICE_NAME", + "JOIN_LIMIT_EXCEEDED", + "CRITERIA_NOT_SUPPORTED", + "INVALID_REQUEST", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "FIELD_NOT_AVAILABLE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "type": "object", + "properties": { + "resource": { + "type": "string" + }, + "message": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "info_message": { + "type": "string" + }, + "parent_api_name": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "module": { + "type": "string" + } + }, + "required": [ + "api_name", + "module" + ] + }, + { + "type": "object", + "properties": { + "comparator": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "supported": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "comparator", + "api_name", + "supported" + ] + }, + { + "type": "object" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Supported_Fields": { + "type": "object", + "properties": { + "comparator": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "supported": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "comparator", + "api_name", + "supported" + ] + }, + "Module_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "module": { + "type": "string" + } + }, + "required": [ + "api_name", + "module" + ] + }, + "Empty": { + "type": "object" + }, + "Request_Body_Not_Supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUEST_BODY_NOT_SUPPORTED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_write.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_write.json new file mode 100644 index 0000000..78d632e --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/bulk_write.json @@ -0,0 +1,711 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "bulk_write", + "description": "Bulk Write", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/upload": { + "post": { + "servers": [ + { + "url": "https://content.zohoapis.com" + } + ], + "operationId": "Upload File", + "parameters": [ + { + "$ref": "#/components/parameters/feature" + }, + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/bulk/v8/write": { + "post": { + "operationId": "Create Bulk Write Job", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Request_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/CoExistence_Not_Allowed" + }, + { + "$ref": "#/components/schemas/Invalid_Callback_Method" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/bulk/v8/write/{job_id}": { + "get": { + "operationId": "Get Bulk Write Job Details", + "parameters": [ + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Bulk_Write_Response" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Not_Found" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/{download_url}": { + "get": { + "operationId": "Download Bulk Write Result", + "parameters": [ + { + "$ref": "#/components/parameters/download_url" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.bulk.ALL", + "ZohoCRM.bulk.ALL" + ] + } + ], + "components": { + "schemas": { + "CallBack": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "method": { + "type": "string", + "enum": [ + "post" + ] + } + } + }, + "default_value": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "module": { + "type": "string" + }, + "value": { + "type": "object" + } + } + }, + "Resource": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "COMPLETED", + "ADDED", + "FAILED", + "IN PROGRESS", + "SKIPPED" + ] + }, + "type": { + "type": "string", + "enum": [ + "data" + ], + "nullable": true + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "code": { + "type": "string" + }, + "file_id": { + "type": "string" + }, + "file_names": { + "type": "array", + "items": { + "type": "string" + } + }, + "ignore_empty": { + "type": "boolean", + "nullable": true + }, + "find_by": { + "type": "string", + "nullable": true + }, + "field_mappings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "index": { + "type": "integer", + "format": "int32" + }, + "format": { + "type": "string" + }, + "find_by": { + "type": "string" + }, + "default_value": { + "$ref": "#/components/schemas/default_value" + }, + "module": { + "type": "string" + }, + "parent_column_index": { + "type": "integer", + "format": "int32" + } + } + } + }, + "file": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "COMPLETED", + "ADDED", + "FAILED", + "IN PROGRESS", + "SKIPPED" + ] + }, + "name": { + "type": "string" + }, + "added_count": { + "type": "integer", + "format": "int32" + }, + "skipped_count": { + "type": "integer", + "format": "int32" + }, + "updated_count": { + "type": "integer", + "format": "int32" + }, + "total_count": { + "type": "integer", + "format": "int32" + } + } + } + } + }, + "Request_Wrapper": { + "type": "object", + "properties": { + "character_encoding": { + "type": "string", + "nullable": true + }, + "operation": { + "type": "string", + "enum": [ + "upsert", + "insert", + "update" + ] + }, + "callback": { + "$ref": "#/components/schemas/CallBack" + }, + "resource": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Resource" + } + }, + "ignore_empty": { + "type": "boolean" + } + } + }, + "Result": { + "type": "object", + "properties": { + "download_url": { + "type": "string" + } + }, + "required": [ + "download_url" + ] + }, + "Bulk_Write_Response": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "character_encoding": { + "type": "string" + }, + "resource": { + "items": { + "$ref": "#/components/schemas/Resource" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "result": { + "$ref": "#/components/schemas/Result" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "operation": { + "type": "string" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "callback": { + "$ref": "#/components/schemas/CallBack" + } + } + }, + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS", + "FILE_UPLOAD_SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "success", + "file uploaded." + ] + }, + "details": { + "type": "object", + "properties": { + "file_id": { + "type": "integer", + "format": "int64" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + }, + "required": [ + "id", + "created_by" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Callback_Method": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_CALLBACK_METHOD" + ] + }, + "details": { + "$ref": "#/components/schemas/Supported_Details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Supported_Details": { + "type": "object", + "properties": { + "supported_callback_methods": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "supported_callback_methods" + ] + }, + "Resource_Not_Found": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "RESOURCE_NOT_FOUND" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "CoExistence_Not_Allowed": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "COEXISTENCE_NOT_ALLOWED" + ] + }, + "details": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/BodyErrorDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MODULE_NOT_AVAILABLE", + "DUPLICATE_DATA", + "INVALID_URL_PATTERN", + "RESOURCE_NOT_FOUND", + "FILE_TOO_LARGE", + "COLUMN_INDEX_NOT_FOUND", + "INVALID_FIELD", + "MANDATORY_NOT_FOUND", + "HEADER_LIMIT_EXCEEDED", + "MISSING_REQUIRED_KEY", + "INVALID_FILE_FORMAT", + "MANDATORY_FIELDS_NOT_MAPPED", + "INVALID_FORMAT", + "BLOCKED_RECORD", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "CANNOT_PROCESS", + "INVALID_TOKEN", + "LIMIT_EXCEEDED", + "INVALID_FIELD_NAME", + "FILE_NOT_SUPPORTED", + "INVALID_FILE_ID", + "NOT_APPROVED" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid file format. only zip format is supported", + "All mandatory fields are not mapped for the layout", + "improper file id", + "Requested module 'asdf' is not available.", + "Please check if the URL trying to access is a correct one", + "required key index for field Company is not found in request body.", + "File not supported for bulk write", + "required key operation is not found in request body.", + "The http request method type is not a valid one", + "File size too large to process", + "The requested resource doesn't exist.", + "invalid mapping. invalid api_name ast_Name.", + "invalid oauth token" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + }, + "ERROR_MESSAGE": { + "type": "string", + "enum": [ + "Bad Request" + ] + }, + "ERROR_CODE": { + "type": "integer", + "format": "int32" + }, + "x-error": { + "type": "string", + "enum": [ + "check if headers [feature, X-CRM-ORG] are present and valid" + ] + }, + "info": { + "type": "string", + "enum": [ + "Forbidden" + ] + }, + "x-info": { + "type": "string", + "enum": [ + "Link not valid" + ] + }, + "http_status": { + "type": "string" + } + } + } + }, + "parameters": { + "job_id": { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "download_url": { + "name": "download_url", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "feature": { + "name": "feature", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + "X-CRM-ORG": { + "name": "X-CRM-ORG", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/business_hours.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/business_hours.json new file mode 100644 index 0000000..a28e874 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/business_hours.json @@ -0,0 +1,637 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "business_hours", + "description": "Business Hours", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/business_hours": { + "post": { + "operationId": "Create Business Hours", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "business_hours": { + "oneOf": [ + { + "$ref": "#/components/schemas/Business_Hours_Created" + } + ] + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "business_hours": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Max_Data_API_Exception" + } + ] + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Business Hours", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "business_hours": { + "oneOf": [ + { + "$ref": "#/components/schemas/Business_Hours_Created" + } + ] + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "business_hours": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Max_Data_API_Exception" + } + ] + } + }, + "required": [ + "business_hours" + ] + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Business Hours", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.files.CREATE" + ] + } + ], + "components": { + "schemas": { + "Business_Hours": { + "type": "object", + "properties": { + "week_starts_on": { + "type": "string", + "enum": [ + "Monday", + "Thursday", + "Friday", + "Sunday", + "Wednesday", + "Tuesday", + "Saturday" + ] + }, + "type": { + "type": "string", + "enum": [ + "24_by_7", + "24_by_5", + "custom" + ] + }, + "id": { + "type": "string", + "nullable": true + }, + "business_days": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Monday", + "Thursday", + "Friday", + "Sunday", + "Wednesday", + "Tuesday", + "Saturday" + ] + } + }, + "same_as_everyday": { + "type": "boolean", + "nullable": true + }, + "daily_timing": { + "type": "array", + "items": { + "type": "string" + } + }, + "custom_timing": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Break_hours_Custom_Timing" + } + } + }, + "required": [ + "week_starts_on", + "type", + "id", + "business_days", + "same_as_everyday", + "daily_timing", + "custom_timing" + ] + }, + "Break_hours_Custom_Timing": { + "type": "object", + "properties": { + "days": { + "type": "string", + "enum": [ + "Monday", + "Thursday", + "Friday", + "Sunday", + "Wednesday", + "Tuesday", + "Saturday" + ] + }, + "business_timing": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Business_Hours_Created": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "Business Hours saved successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Resource_Path_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "features": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "required": [ + "name", + "id" + ] + } + } + }, + "required": [ + "name", + "resources" + ] + } + }, + "required": [ + "resource_path_index", + "features" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type", + "regex" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Max_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "json_path": { + "type": "string", + "nullable": true + }, + "expected_data_type": { + "type": "string", + "nullable": true + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type", + "maximum_length" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "business_hours": { + "$ref": "#/components/schemas/Business_Hours" + } + }, + "required": [ + "business_hours" + ] + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "X-CRM-ORG": { + "name": "X-CRM-ORG", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences.json new file mode 100644 index 0000000..356403d --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences.json @@ -0,0 +1,307 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "cadences", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/automation/cadences": { + "get": { + "operationId": "Get Cadences", + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Cadences" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.roles.ALL" + ] + } + ], + "components": { + "schemas": { + "cadences": { + "type": "object", + "properties": { + "summary": { + "type": "object", + "properties": { + "task_follow_up_count": { + "type": "integer", + "format": "int32" + }, + "call_follow_up_count": { + "type": "integer", + "format": "int32" + }, + "email_follow_up_count": { + "type": "integer", + "format": "int32" + } + } + }, + "created_time": { + "type": "string" + }, + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "active": { + "type": "boolean" + }, + "execution_details": { + "type": "object", + "properties": { + "unenroll_properties": { + "type": "object", + "properties": { + "end_date": { + "type": "string" + }, + "type": { + "type": "string", + "nullable": true + } + } + }, + "end_date": { + "type": "string" + }, + "automatic_unenroll": { + "type": "boolean" + }, + "type": { + "type": "string", + "nullable": true + }, + "execute_every": { + "type": "object", + "properties": { + "unit": { + "type": "integer", + "format": "int32" + }, + "period": { + "type": "string" + } + } + } + } + }, + "published": { + "type": "boolean" + }, + "type": { + "type": "string" + }, + "created_by": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "modified_time": { + "type": "string" + }, + "name": { + "type": "string" + }, + "modified_by": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "id": { + "type": "string" + }, + "custom_view": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "status": { + "type": "string" + } + }, + "required": [ + "published", + "type" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + } + }, + "InvalidParamError": { + "type": "object", + "properties": { + "details": { + "type": "object", + "properties": { + "role_status": { + "type": "string" + }, + "param_name": { + "type": "string" + }, + "param": { + "type": "string" + } + }, + "required": [ + "role_status", + "param_name", + "param" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "details", + "code", + "message", + "status" + ] + } + }, + "responses": { + "Cadences": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "cadences": { + "items": { + "$ref": "#/components/schemas/cadences" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "cadences", + "info" + ] + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + } + ] + } + } + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences_execution.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences_execution.json new file mode 100644 index 0000000..f28b731 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cadences_execution.json @@ -0,0 +1,638 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "cadences_execution", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/actions/enrol_in_cadences": { + "post": { + "operationId": "Enroll Cadences", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/GetEnrolBody" + }, + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Success_Response" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/{module}/actions/unenrol_from_cadences": { + "post": { + "operationId": "Unenroll Cadences", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/GetEnrolBody" + }, + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Success_Response" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/automation/cadences/{id}/actions/analytics": { + "get": { + "operationId": "Cadences Analytics", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/followup_action_type" + }, + { + "$ref": "#/components/parameters/from" + }, + { + "$ref": "#/components/parameters/to" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "cadences": { + "items": { + "$ref": "#/components/schemas/Cadences_Analytics_Get" + }, + "type": "array" + } + }, + "required": [ + "cadences" + ] + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.roles.ALL" + ] + } + ], + "components": { + "schemas": { + "Body_Wrapper": { + "type": "object", + "properties": { + "cadences_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "cadences_ids" + ] + }, + "Cadences_Analytics_Get": { + "type": "object", + "properties": { + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "name": { + "type": "string" + }, + "follow_ups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "analytics": { + "type": "object" + }, + "parent_follow_up": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "action": { + "type": "object", + "properties": { + "details": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "template": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + }, + "type": { + "type": "string" + } + } + }, + "id": { + "type": "string" + } + }, + "required": [ + "analytics" + ] + } + }, + "id": { + "type": "string" + }, + "created_by": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + } + }, + "analytics-call": { + "type": "object", + "properties": { + "created_calls_count": { + "type": "integer", + "format": "int32" + }, + "cancelled_calls_count": { + "type": "integer", + "format": "int32" + }, + "failed_calls_count": { + "type": "integer", + "format": "int32" + }, + "completed_calls_count": { + "type": "integer", + "format": "int32" + }, + "scheduled_calls_count": { + "type": "integer", + "format": "int32" + }, + "calls_count": { + "type": "integer", + "format": "int32" + }, + "overdue_calls_count": { + "type": "integer", + "format": "int32" + }, + "missed_calls_count": { + "type": "integer", + "format": "int32" + } + } + }, + "analytics-task": { + "type": "object", + "properties": { + "open_tasks_count": { + "type": "integer", + "format": "int32" + }, + "failed_tasks_count": { + "type": "integer", + "format": "int32" + }, + "subject": { + "type": "string" + }, + "completed_tasks_count": { + "type": "integer", + "format": "int32" + }, + "created_tasks_count": { + "type": "integer", + "format": "int32" + }, + "tasks_count": { + "type": "integer", + "format": "int32" + } + } + }, + "analytics-alert": { + "type": "object", + "properties": { + "email_count": { + "type": "integer", + "format": "int32" + }, + "cliked_email_count": { + "type": "integer", + "format": "int32" + }, + "bounced_email_count": { + "type": "integer", + "format": "int32" + }, + "replied_email_count": { + "type": "integer", + "format": "int32" + }, + "email_spam_count": { + "type": "integer", + "format": "int32" + }, + "sent_email_count": { + "type": "integer", + "format": "int32" + }, + "unsent_email_count": { + "type": "integer", + "format": "int32" + }, + "opened_email_count": { + "type": "integer", + "format": "int32" + }, + "unsubscribed_email_count": { + "type": "integer", + "format": "int32" + } + } + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "type": "object", + "properties": { + "cadences": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + }, + "id": { + "type": "string" + } + } + } + } + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "InvalidValueWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "details": { + "type": "object", + "properties": { + "role_status": { + "type": "string" + }, + "param_name": { + "type": "string" + }, + "param": { + "type": "string" + } + }, + "required": [ + "role_status", + "param_name", + "param" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "details", + "code", + "message", + "status" + ] + } + }, + "responses": { + "Success_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + } + ] + } + } + } + } + }, + "parameters": { + "from": { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "to": { + "name": "to", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "followup_action_type": { + "name": "followup_action_type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "GetEnrolBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/call_preferences.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/call_preferences.json new file mode 100644 index 0000000..e844904 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/call_preferences.json @@ -0,0 +1,369 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "call_preferences", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/call_preferences": { + "get": { + "operationId": "Get Call Preference", + "responses": { + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidReqMethod" + } + ] + } + } + } + }, + "200": { + "$ref": "#/components/responses/200SuccessGetResponse" + } + } + }, + "put": { + "operationId": "Update Call Preference", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/200SuccessPutResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "CallPreferences": { + "type": "object", + "properties": { + "show_from_number": { + "type": "boolean" + }, + "show_to_number": { + "type": "boolean" + } + }, + "required": [ + "show_from_number", + "show_to_number" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "call_preferences": { + "$ref": "#/components/schemas/CallPreferences" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + }, + "details": { + "type": "object", + "nullable": true + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "MandatoryException": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidReqMethod": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_REQUEST_METHOD" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "NotAllowed": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + } + }, + "responses": { + "200SuccessGetResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "call_preferences": { + "$ref": "#/components/schemas/CallPreferences" + } + } + } + ] + } + } + } + }, + "200SuccessPutResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "call_preferences": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "call_preferences": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/NotAllowed" + } + ] + } + }, + "required": [ + "call_preferences" + ] + }, + { + "$ref": "#/components/schemas/InvalidReqMethod" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/MandatoryException" + } + ] + } + } + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cancel_meetings.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cancel_meetings.json new file mode 100644 index 0000000..85ca3a5 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/cancel_meetings.json @@ -0,0 +1,420 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "cancel_meetings", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Events/{event}/actions/cancel": { + "post": { + "operationId": "Cancel Meetings", + "parameters": [ + { + "$ref": "#/components/parameters/event" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "403": { + "$ref": "#/components/responses/PermissionErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.Modules.Events.ALL" + ] + } + ], + "components": { + "schemas": { + "notify": { + "type": "object", + "properties": { + "send_cancelling_mail": { + "type": "boolean" + } + } + }, + "wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/notify" + }, + "type": "array" + } + } + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + } + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + } + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "MandatoryErrorWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + } + }, + "EmptyError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidUrlWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + } + ] + }, + "type": "array" + } + } + }, + "PermissionDetails": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, + "PermissionError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/PermissionDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "PermissionWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PermissionError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "details": { + "$ref": "#/components/schemas/InvalidTypeDetails" + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + } + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/EmptyError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidUrlWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + } + ] + } + } + } + }, + "PermissionErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/PermissionWrapper" + } + ] + } + } + } + } + }, + "parameters": { + "event": { + "name": "event", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/change_owner.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/change_owner.json new file mode 100644 index 0000000..a75001e --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/change_owner.json @@ -0,0 +1,778 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "change_owner", + "description": "Change Owner", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{id}/actions/change_owner": { + "post": { + "operationId": "Single Update", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/InvalidStatusCodeResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "202": { + "$ref": "#/components/responses/MixedResponse" + }, + "403": { + "$ref": "#/components/responses/PermissionResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/{module}/actions/change_owner": { + "post": { + "operationId": "Mass Update", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/MassBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/InvalidStatusCodeResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "202": { + "$ref": "#/components/responses/MixedResponse" + }, + "403": { + "$ref": "#/components/responses/PermissionResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "owner": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "related_modules": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + }, + "wrapper": { + "type": "object", + "properties": { + "owner": { + "$ref": "#/components/schemas/owner" + }, + "notify": { + "type": "boolean" + }, + "related_modules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/related_modules" + } + } + } + }, + "MassWrapper": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "owner": { + "$ref": "#/components/schemas/owner" + }, + "notify": { + "type": "boolean" + }, + "related_modules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/related_modules" + } + } + } + }, + "success": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "owner is successfully updated" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + } + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the id given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Param_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the owner id given is invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Parse_DataType_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "UNABLE_TO_PARSE_DATA_TYPE" + ] + }, + "message": { + "type": "string", + "enum": [ + "either the request body or parameters is in wrong format" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "UrlWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + } + ] + }, + "type": "array" + } + } + }, + "RegexDetails": { + "type": "object", + "properties": { + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "ErrorDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetais" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "UnsupportedError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_SUPPORTED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails1" + } + } + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "AmbiguityError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "AMBIGUITY_DURING_PROCESSING" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorDetails" + } + } + } + } + } + }, + "PermissionError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "InvalidTypeDetais": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/RegexDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "ExpectedFieldDetails": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "type": "array" + } + } + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND", + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorDetails1" + }, + { + "$ref": "#/components/schemas/ExpectedFieldDetails" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/AmbiguityError" + }, + { + "$ref": "#/components/schemas/UnsupportedError" + }, + { + "$ref": "#/components/schemas/UrlWrapper" + } + ] + } + } + } + }, + "InvalidStatusCodeResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + } + } + } + }, + "PermissionResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/PermissionError" + } + ] + } + } + } + }, + "MixedResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + }, + "MassBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MassWrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/common.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/common.json new file mode 100644 index 0000000..0ed9e15 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/common.json @@ -0,0 +1,1165 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "common", + "description": "This is not an API. This file has some common components, which will be referenced by actual api specifications.", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/": { + "get": { + "operationId": "dummy", + "responses": { + "204": { + "description": "" + } + } + } + } + }, + "components": { + "schemas": { + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "page", + "count", + "more_records" + ] + }, + "UnsupportedVersionDetails": { + "type": "object", + "properties": { + "supported_version": { + "type": "number", + "format": "double", + "nullable": true + } + }, + "required": [ + "supported_version" + ] + }, + "UnsupportedVersionError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "API_NOT_SUPPORTED" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/UnsupportedVersionDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "SuccessDetails": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/SuccessDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "BodyErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "NotAllowedError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/BodyErrorDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/BodyErrorDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "RequiredDataMissingDetails": { + "type": "object", + "properties": { + "sub_json_path": { + "type": "string", + "nullable": true + }, + "value": { + "type": "object", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "sub_json_path", + "value", + "api_name", + "json_path" + ] + }, + "RequiredDataMissingError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_DATA_NOT_FOUND" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/RequiredDataMissingDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + }, + "InvalidType": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeDetails" + }, + { + "$ref": "#/components/schemas/InvalidType" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "SupportedValueDetails": { + "type": "object", + "properties": { + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "supported_values", + "api_name", + "json_path" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + }, + "param_name": { + "type": "string" + }, + "param": { + "type": "string" + } + }, + "required": [ + "supported_values", + "param_name", + "param" + ] + }, + "InvalidValueDetails": { + "type": "object", + "properties": { + "regex": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "InvalidValueError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/BodyErrorDetails" + }, + { + "$ref": "#/components/schemas/InvalidValueDetails" + }, + { + "$ref": "#/components/schemas/SupportedValueDetails" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidIDError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidRegexError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/InvalidValueDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "ExpectedFieldMissingDetails": { + "type": "object", + "properties": { + "expected_fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BodyErrorDetails" + } + } + }, + "required": [ + "expected_fields" + ] + }, + "ExpectedFieldMissingError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/ExpectedFieldMissingDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "AmbiguityDetails": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BodyErrorDetails" + } + } + }, + "required": [ + "ambiguity_due_to" + ] + }, + "AmbiguityError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "AMBIGUITY_DURING_PROCESSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/AmbiguityDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "DependentFieldDetails": { + "type": "object", + "properties": { + "dependee": { + "$ref": "#/components/schemas/BodyErrorDetails" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "dependee", + "api_name", + "json_path" + ] + }, + "DependentFieldError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/DependentFieldDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "DependentMismatchError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_MISMATCH" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/DependentFieldDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "DuplicateError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/BodyErrorDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "ReservedKeywordError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "RESERVED_KEYWORD_NOT_ALLOWED" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/BodyErrorDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MaxLengthDetails": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "maximum_length", + "api_name", + "json_path" + ] + }, + "MaxLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MaxLengthDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MinLengthDetails": { + "type": "object", + "properties": { + "minimum_length": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "minimum_length", + "api_name", + "json_path" + ] + }, + "MinLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MinLengthDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "ParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + }, + "param": { + "type": "string" + } + }, + "required": [ + "param_name", + "param" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/ParamDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "type": "object" + }, + { + "$ref": "#/components/schemas/ParamDetails" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "PermissionError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "permissions" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://accounts.zoho.com/oauth/v2.0/auth", + "tokenUrl": "https://accounts.zoho.com/oauth/v2.0/token", + "refreshUrl": "https://accounts.zoho.com/oauth/v2.0/token", + "scopes": { + "ZohoCRM.settings.map_dependency.ALL": "Configure and manage dependencies between CRM fields.", + "ZohoCRM.settings.modules.READ": "Retrieve metadata for a specific module or all modules.", + "ZohoCRM.settings.modules.ALL": "Manipulate the metadata of a specific module or all modules.", + "ZohoCRM.settings.custom_views.ALL": "To access and manipulate custom view metadata.", + "ZohoCRM.settings.currencies.CREATE": "Create and manage currencies within your Zoho CRM.", + "ZohoCRM.settings.fields.READ": "Retrieve fields metadata for different modules in the CRM org.", + "ZohoCRM.settings.fiscal_year.READ": "Retrieve and update fiscal year data in your org.", + "ZohoCRM.settings.ALL": "Retrieve specific or all CRM metadata.", + "ZohoCRM.settings.intelligence.ALL": "Initialize and retrieve organization-level and people(personal)-level data enrichment.", + "ZohoCRM.settings.fields.ALL": "Access and manipulate field metadata for different modules in the CRM org.", + "ZohoCRM.modules.ALL": "Perform actions on Zoho CRM modules.", + "ZohoCRM.modules.READ": "Retrieve metadata of a specific module or all modules.", + "ZohoCRM.settings.roles.ALL": "Manipulate and manage roles in your Zoho CRM.", + "ZohoCRM.settings.variables.READ": "Manipulate Zoho CRM variables.", + "ZohoCRM.settings.profiles.READ": " Retrieve profiles in your Zoho CRM.", + "ZohoCRM.mass_convert.SalesOrders.CREATE": "Convert multiple records in the Salesorders module to a specified module.", + "ZohoCRM.modules.attachments.ALL": "Create and manage attachments.", + "ZohoCRM.settings.related_lists.READ": "Retrieve the metadata of the related lists for a specific module.", + "ZohoCRM.settings.layouts.READ": "Retrieve metadata of a layout for a specific module.", + "ZohoCRM.settings.roles.READ": "Retrieve roles in your Zoho CRM.", + "ZohoCRM.settings.profiles.ALL": "Access and manage profiles in your Zoho CRM.", + "ZohoCRM.modules.notes.ALL": "Create and manage Notes.", + "ZohoCRM.share.{module_API_name}.DELETE": "Delete shared records in a module with other users. Please note that you need to replace the {module_API_name} placeholder with the module you want.", + "ZohoCRM.settings.territories.ALL": "Access and manipulate territories metadata", + "ZohoCRM.bulk.ALL": "Perform bulk actions with the multiple records in a module in your Zoho CRM.", + "ZohoCRM.settings.currencies.ALL": "Create and manage currencies within your Zoho CRM.", + "ZohoCRM.share.{module_API_name}.ALL": "Create and share records with other users in the org. Please note that you need to replace the {module_API_name} placeholder with the module you want.", + "ZohoCRM.share.{module_API_name}.READ": "Retrieve the shared records in a module with other users. Please note that you need to replace the {module_API_name} placeholder with the module you want.", + "ZohoCRM.modules.leads.ALL": "Create and manage records in the Leads module.", + "ZohoCRM.users.ALL": " Create and manage users and their access in your Zoho CRM org.", + "ZohoCRM.mass_convert.Quotes.READ": " Retrieve the Converted multiple records in the Quotes module to a specified module and retrieve the status.", + "ZohoCRM.settings.variable_groups.ALL": "Retrieve all variable groups metadata.", + "ZohoCRM.settings.variable_groups.READ": "Retrieve variable group metadata.", + "ZohoCRM.settings.currencies.READ": " Retrieve currencies within your Zoho CRM.", + "settings.fiscal_year.UPDATE": "Update fiscal year data in your org.", + "ZohoCRM.settings.variables.ALL": "Manipulate Zoho CRM variables.", + "ZohoCRM.settings.tags.ALL": "Access and manipulate tags.", + "ZohoCRM.org.ALL": "Manage and manipulate your org information.", + "ZohoCRM.modules.deals.ALL": "Create and manage records in the Deals module.", + "ZohoCRM.settings.recycle_bin.DELETE": "Permanently delete records from the Recycle Bin in your Zoho CRM.", + "ZohoCRM.settings.emails.READ": "Retrieve email settings in your org.", + "ZohoCRM.settings.currencies.UPDATE": " Update currencies within your Zoho CRM.", + "ZohoCRM.settings.layouts.ALL": "Access and manipulate the metadata of a layout for a specific module.", + "ZohoCRM.settings.audit_logs.CREATE": "Create an export audit log job.", + "ZohoCRM.settings.recycle_bin.READ": "Retrieve records from the Recycle Bin in your Zoho CRM.", + "ZohoCRM.files.CREATE": "Upload files in your Zoho CRM.", + "ZohoCRM.settings.related_lists.ALL": "Retrieve all metadata of the related lists for a specific module.", + "ZohoCRM.modules.contacts.ALL": "Create and manage records in the Contacts module.", + "ZohoCRM.settings.wizards.ALL": "Retrieve wizards' information within a module.", + "ZohoCRM.modules.attachments.READ": "Retrieve attachments in your org.", + "ZohoCRM.settings.unsubscribe.ALL": "Access and manage unsubscribe links, and their associations.", + "ZohoCRM.mass_convert.SalesOrders.READ": "Retrieve converted multiple records in the Salesorders module to a specified module.", + "ZohoCRM.modules.emails.READ": "Retrieve emails in Zoho CRM.", + "ZohoCRM.share.{module_API_name}.UPDATE": "Update the shared records in a module with other users. Please note that you need to replace the {module_API_name} placeholder with the module you want.", + "ZohoCRM.mass_convert.Quotes.CREATE": "Convert multiple records in the Quotes module to a specified module and retrieve the status.", + "ZohoCRM.settings.assignment_rules.ALL": "Full access to retrieve details of assignment rules in your org.", + "ZohoCRM.modules.emails.{module_API_name}.ALL": "Create, associate, and retrieve emails for specific module in Zoho CRM.", + "ZohoCRM.modules.emails.ALL": "Create, associate, and retrieve emails in Zoho CRM.", + "ZohoCRM.modules.appointments.ALL": " Full access to create and manage records in the Appointments module.", + "ZohoCRM.modules.{module_API_name}.ALL": "Perform all actions on Zoho CRM modules.", + "ZohoCRM.settings.currencies.{operation_type}": "Create and manage currencies within your Zoho CRM. Possible Operation types are CREATE, UPDATE, and READ ", + "ZohoCRM.bulk.backup.ALL": "Perform bulk data backup operation in your Zoho CRM.", + "ZohoCRM.Modules.Events.ALL": "Full access to create and manage records in the Events module.", + "ZohoCRM.modules.{module_API_name}.READ": "Retrieve actions on Zoho CRM modules.", + "ZohoCRM.templates.email.READ": "Retrieve email templates in your organization.", + "ZohoCRM.settings.global_picklist.ALL": "Create and manage global picklists across all the modules.", + "ZohoCRM.templates.inventory.READ": "Retrieve the inventory templates in your organization.", + "ZohoCRM.mass_convert.{module_API_name}.CREATE": "Create a mass convert job. Please note that you need to replace the {module_API_name} placeholder with the module you want. Refer to the API help document to know the supported modules.", + "ZohoCRM.mass_convert.{module_API_name}.READ": "Retrieve mass convert job status. Please note that you need to replace the {module_API_name} placeholder with the module you want. Refer to the API help document to know the supported modules.", + "ZohoCRM.notifications.ALL": "Create and manage notifications in Zoho CRM.", + "ZohoCRM.settings.pipeline.ALL": "To access and manipulate pipelines.", + "ZohoCRM.settings.clientportal.ALL": "Create and manage client portals for your organization.", + "ZohoCRM.settings.record_locking_configurations.ALL": "Manipulate locking configuration for different modules.", + "ZohoCRM.settings.business_hours.ALL": "Manipulate business hours data for your CRM org.", + "ZohoCRM.settings.user_groups.ALL": "Access and manipulate user group metadata.", + "ZohoCRM.settings.users_unavailability.ALL": "Manage and track users unavailability periods.", + "ZohoCRM.settings.ZohoCRM.settings.currencies.ALL": "Create and manage currencies within your Zoho CRM.", + "ZohoCRM.settings.fiscal_year.UPDATE": "Update fiscal year data in your org.", + "ZohoCRM.share.{module_API_name}.CREATE": "Create and share records in a module with other users in the organization.", + "ZohoCRM.zia.enrichment.ALL": "Enhance and enrich your CRM records with additional data and insights using Zia." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/contact_roles.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/contact_roles.json new file mode 100644 index 0000000..69bcb68 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/contact_roles.json @@ -0,0 +1,836 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "contact_roles", + "description": "Contact Roles", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Contacts/roles": { + "get": { + "operationId": "Get Roles", + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ContactRoles" + }, + "500": { + "$ref": "#/components/responses/MetaInternalErrorResponse" + } + } + }, + "post": { + "operationId": "Create Roles", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update Roles", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Contact Roles", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/Contacts/roles/{id}": { + "get": { + "operationId": "Get Role", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ContactRoles" + }, + "500": { + "$ref": "#/components/responses/MetaInternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update Contact Role", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Contact Role", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Contact_Role": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "maxLength": 50 + }, + "sequence_number": { + "type": "object", + "nullable": true + } + }, + "required": [ + "id", + "name", + "sequence_number" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "$ref": "#/components/schemas/Contact_Role" + }, + "type": "array" + } + }, + "required": [ + "contact_roles" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "$ref": "#/components/schemas/Contact_Role" + }, + "type": "array" + } + }, + "required": [ + "contact_roles" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "contact role deleted", + "contact role updated", + "contact role added" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "contact_roles" + ] + }, + "MandatoryErrorWrapper": { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidErrorWrapper": { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidTypeErrorWrapper": { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + } + }, + "MaxLengthErrorWrapper": { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MaxLengthError" + } + ] + }, + "type": "array" + } + } + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Max_Length_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "maximum_length" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Field_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Duplicate_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Required_Param_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string", + "enum": [ + "One of the expected parameter is missing" + ] + }, + "details": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Parse_Datatype_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "UNABLE_TO_PARSE_DATA_TYPE" + ] + }, + "message": { + "type": "string", + "enum": [ + "either the request body or parameters is in wrong format" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "expected_data_type" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "responses": { + "ContactRoles": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "contact_roles": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Field_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Required_Param_API_Exception" + }, + { + "$ref": "#/components/schemas/Parse_Datatype_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Duplicate_Data_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "contact_roles" + ] + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/MandatoryErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidErrorWrapper" + }, + { + "$ref": "#/components/schemas/MaxLengthErrorWrapper" + } + ] + } + } + } + }, + "MetaInternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/conversion_option.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/conversion_option.json new file mode 100644 index 0000000..1d3a5c8 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/conversion_option.json @@ -0,0 +1,217 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "conversion_option", + "description": "Lead Conversion Options", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Leads/{lead_id}/__conversion_options": { + "get": { + "operationId": "Lead Conversion Options", + "parameters": [ + { + "$ref": "#/components/parameters/lead_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "__conversion_options": { + "$ref": "#/components/schemas/Conversion_Options" + } + }, + "required": [ + "__conversion_options" + ] + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.all" + ] + } + ] + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Preference_Field_Match": { + "type": "object", + "properties": { + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "matched_lead_value": { + "type": "string" + } + }, + "required": [ + "field", + "matched_lead_value" + ] + }, + "Conversion_Options": { + "type": "object", + "properties": { + "module_preference": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/modules" + }, + "Contacts": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "type": "array" + }, + "Deals": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "type": "array" + }, + "Accounts": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "type": "array" + }, + "preference_field_matched_value": { + "type": "object", + "properties": { + "Contacts": { + "items": { + "$ref": "#/components/schemas/Preference_Field_Match" + }, + "type": "array" + }, + "Accounts": { + "items": { + "$ref": "#/components/schemas/Preference_Field_Match" + }, + "type": "array" + }, + "Deals": { + "items": { + "$ref": "#/components/schemas/Preference_Field_Match" + }, + "type": "array" + } + }, + "required": [ + "Contacts", + "Accounts", + "Deals" + ] + }, + "modules_with_multiple_layouts": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/modules" + }, + "type": "array" + } + }, + "required": [ + "module_preference", + "Contacts", + "Deals", + "Accounts", + "preference_field_matched_value", + "modules_with_multiple_layouts" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + } + }, + "parameters": { + "lead_id": { + "name": "lead_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/convert_lead.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/convert_lead.json new file mode 100644 index 0000000..cd93075 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/convert_lead.json @@ -0,0 +1,649 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "convert_lead", + "description": "Convert Record", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Leads/{lead_id}/actions/convert": { + "post": { + "operationId": "Convert Lead", + "parameters": [ + { + "$ref": "#/components/parameters/lead_id" + } + ], + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Mapping_Mismatch_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Next_Step_Maximum_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + { + "$ref": "#/components/schemas/Invalid_URL_ID_Exception" + }, + { + "$ref": "#/components/schemas/ID_Already_Converted_API_Exception" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Value_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Mapping_Mismatch_Exception" + }, + { + "$ref": "#/components/schemas/Next_Step_Maximum_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Value_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_URL_ID_Exception" + }, + { + "$ref": "#/components/schemas/ID_Already_Converted_API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.all" + ] + } + ] + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Successful_Convert": { + "type": "object", + "properties": { + "Contacts": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "Deals": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "Accounts": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + } + }, + "required": [ + "Contacts", + "Deals", + "Accounts" + ] + }, + "Carry_Over_Tags": { + "type": "object", + "properties": { + "Contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "Accounts": { + "type": "array", + "items": { + "type": "string" + } + }, + "Deals": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "move_attachments_to": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Lead_Converter": { + "type": "object", + "properties": { + "overwrite": { + "type": "boolean" + }, + "notify_lead_owner": { + "type": "boolean" + }, + "notify_new_entity_owner": { + "type": "boolean" + }, + "move_attachments_to": { + "$ref": "#/components/schemas/move_attachments_to" + }, + "Accounts": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "Contacts": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "assign_to": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Deals": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "add_to_existing_record": { + "type": "boolean", + "enum": [ + true + ] + }, + "carry_over_tags": { + "$ref": "#/components/schemas/Carry_Over_Tags" + } + }, + "required": [ + "Accounts", + "Contacts", + "assign_to", + "add_to_existing_record" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "The record has been converted successfully" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/Successful_Convert" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Invalid_Value_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_URL_ID_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Data_Type_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "ID_Already_Converted_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "ID_ALREADY_CONVERTED" + ] + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Next_Step_Maximum_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "maximum_length", + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mapping_Mismatch_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MAPPING_MISMATCH" + ] + }, + "message": { + "type": "string", + "enum": [ + "Pipeline doesn`t contain the Stage" + ] + }, + "details": { + "type": "object", + "properties": { + "mapped_field": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "mapped_field", + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "lead_id": { + "name": "lead_id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/coql.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/coql.json new file mode 100644 index 0000000..e744079 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/coql.json @@ -0,0 +1,403 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "coql", + "description": "To get records response based on queries using COQL APIs", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/coql": { + "post": { + "operationId": "Get Records", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Syntax_Exception" + }, + { + "$ref": "#/components/schemas/Query_Exception" + }, + { + "$ref": "#/components/schemas/Limit_Exceeded_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Query_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Alias_Exception" + }, + { + "$ref": "#/components/schemas/Duplicate_Data_Exception" + }, + { + "$ref": "#/components/schemas/Duplicate_Alias_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.all" + ] + } + ], + "components": { + "schemas": { + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "type": "array" + }, + "info": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Info" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "select_query": { + "type": "string" + } + }, + "required": [ + "select_query" + ] + }, + "Syntax_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SYNTAX_ERROR" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Clause_Details" + }, + { + "$ref": "#/components/schemas/Parse_Error_Details" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Limit_Exceeded_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Query_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_QUERY" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Alias_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_ALIAS" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Duplicate_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Duplicate_Alias_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_ALIAS" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Clause_Details": { + "type": "object", + "properties": { + "clause": { + "type": "string" + } + }, + "required": [ + "clause" + ] + }, + "Parse_Error_Details": { + "type": "object", + "properties": { + "line": { + "type": "integer", + "format": "int32" + }, + "column": { + "type": "integer", + "format": "int32" + }, + "near": { + "type": "string" + } + }, + "required": [ + "line", + "column", + "near" + ] + }, + "Query_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "SYNTAX_ERROR", + "INVALID_QUERY" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid query formed", + "column given seems to be invalid", + "value given seems to be invalid for the column", + "data type not supported" + ] + }, + "details": { + "type": "object", + "properties": { + "near": { + "type": "string" + }, + "column": { + "type": "integer", + "format": "int32" + }, + "line": { + "type": "integer", + "format": "int32" + }, + "clause": { + "type": "string" + }, + "by": { + "type": "string" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "column_name": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "module": { + "type": "string" + }, + "data_type": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "operator": { + "type": "string" + } + } + } + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/currencies.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/currencies.json new file mode 100644 index 0000000..7413048 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/currencies.json @@ -0,0 +1,1014 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "currencies", + "description": "Currencies", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/org/currencies": { + "get": { + "operationId": "Get Currencies", + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Currencies" + }, + "500": { + "$ref": "#/components/responses/MetaInternalErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.ZohoCRM.settings.currencies.all", + "ZohoCRM.settings.currencies.read" + ] + } + ] + }, + "post": { + "operationId": "Add Currencies", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/ActionInternalErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.ZohoCRM.settings.currencies.all", + "ZohoCRM.settings.currencies.create" + ] + } + ] + }, + "put": { + "operationId": "Update Currencies", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/ActionInternalErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.currencies.all", + "ZohoCRM.settings.currencies.update" + ] + } + ] + } + }, + "/crm/v8/org/currencies/{id}": { + "get": { + "operationId": "Get Currency", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Currencies" + }, + "500": { + "$ref": "#/components/responses/MetaInternalErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.currencies.all", + "ZohoCRM.settings.currencies.read" + ] + } + ] + }, + "put": { + "operationId": "Update Currency", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/ActionInternalErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.ZohoCRM.settings.currencies.all", + "ZohoCRM.settings.currencies.update" + ] + } + ] + } + }, + "/crm/v8/org/currencies/actions/enable": { + "post": { + "operationId": "Enable Base Currency", + "requestBody": { + "$ref": "#/components/requestBodies/BaseCurrencyBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/BSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/BErrorResponse" + }, + "500": { + "$ref": "#/components/responses/ActionInternalErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.currencies.all", + "ZohoCRM.settings.currencies.create" + ] + } + ] + }, + "put": { + "operationId": "Update Base Currency", + "requestBody": { + "$ref": "#/components/requestBodies/BaseCurrencyBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/BSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/BErrorResponse" + }, + "500": { + "$ref": "#/components/responses/ActionInternalErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.currencies.all", + "ZohoCRM.settings.currencies.update" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Format": { + "type": "object", + "properties": { + "decimal_separator": { + "type": "string", + "enum": [ + "Comma", + "Period" + ] + }, + "thousand_separator": { + "type": "string", + "enum": [ + "Space", + "Comma", + "Period" + ] + }, + "decimal_places": { + "type": "string", + "enum": [ + "0", + "2", + "3" + ] + } + }, + "required": [ + "decimal_separator", + "thousand_separator", + "decimal_places" + ] + }, + "Base_Currency": { + "type": "object", + "properties": { + "iso_code": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "is_active": { + "type": "boolean", + "nullable": true + }, + "exchange_rate": { + "type": "string", + "pattern": "[1-9][0-9]{1,8}[.][0-9]{9}" + }, + "format": { + "$ref": "#/components/schemas/Format" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "prefix_symbol": { + "type": "boolean", + "nullable": true + }, + "is_base": { + "type": "boolean", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "name": { + "type": "string" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "iso_code", + "symbol", + "created_time", + "is_active", + "exchange_rate", + "format", + "created_by", + "prefix_symbol", + "is_base", + "modified_time", + "name", + "modified_by", + "id" + ] + }, + "Currency": { + "type": "object", + "properties": { + "iso_code": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "is_active": { + "type": "boolean", + "nullable": true + }, + "exchange_rate": { + "type": "string", + "pattern": "[1-9][0-9]{1,8}[.][0-9]{9}" + }, + "format": { + "$ref": "#/components/schemas/Format" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "prefix_symbol": { + "type": "boolean", + "nullable": true + }, + "is_base": { + "type": "boolean" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "name": { + "type": "string" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "id": { + "type": "string" + } + }, + "required": [ + "iso_code", + "symbol", + "created_time", + "is_active", + "exchange_rate", + "format", + "created_by", + "prefix_symbol", + "is_base", + "modified_time", + "name", + "modified_by", + "id" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "currencies": { + "items": { + "$ref": "#/components/schemas/Currency" + }, + "type": "array" + } + }, + "required": [ + "currencies" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "currencies": { + "items": { + "$ref": "#/components/schemas/Currency" + }, + "type": "array" + } + }, + "required": [ + "currencies" + ] + }, + "base_currency_wrapper": { + "type": "object", + "properties": { + "base_currency": { + "$ref": "#/components/schemas/Base_Currency" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "The currency updated successfully.", + "The multi-currency feature is enabled and given currency is created as the base currency.", + "The currency created successfully." + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "base_currency_success_wrapper": { + "type": "object", + "properties": { + "base_currency": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "currencies": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Currency_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA", + "OAUTH_SCOPE_MISMATCH", + "INVALID_URL_PATTERN", + "NOT_ALLOWED", + "ALREADY_ENABLED", + "FEATURE_NOT_ENABLED", + "MANDATORY_NOT_FOUND", + "CURRENCIES_NOT_ENABLED", + "FEATURE_NOT_SUPPORTED", + "ACTIVE_STATE_LIMIT_EXCEEDED", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "LIMIT_EXCEEDED", + "No Content" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found", + "Please check if the URL trying to access is a correct one.", + "Currency symbol is invalid.", + "Currency name is invalid.", + "Currency symbol is invalid.", + "Multi currency is not enabled", + "The http request method type is not a valid one", + "The module name given seems to be invalid", + "The multi-currency feature is not available except the Enterprise and higher editions.", + "invalid oauth token", + "The multi-currency is already enabled", + "ISO code is invalid.", + "Currency id is invalid.", + "unable to process your request. please verify whether you have entered proper method name", + "No Content", + " parameter and parameter values." + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "related_status": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "resource_path_index", + "related_status" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "related_status": { + "type": "string" + } + } + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "DuplicateWrapper": { + "type": "object", + "properties": { + "currencies": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/DuplicateError" + } + ] + }, + "type": "array" + } + } + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "currencies": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "currencies": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidValueWrapper": { + "type": "object", + "properties": { + "currencies": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + } + }, + "RegexDetails": { + "type": "object", + "properties": { + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/RegexDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "BInvalidWrapper": { + "type": "object", + "properties": { + "base_currency": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + }, + "AlreadyEnabled": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "ALREADY_ENABLED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + } + }, + "AlreadyEnabledWrapper": { + "type": "object", + "properties": { + "base_currency": { + "oneOf": [ + { + "$ref": "#/components/schemas/AlreadyEnabled" + } + ] + } + } + }, + "BMandatoryWrapper": { + "type": "object", + "properties": { + "base_currency": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + } + } + }, + "BInvalidTypeWrapper": { + "type": "object", + "properties": { + "base_currency": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + }, + "BInvalidValueWrapper": { + "type": "object", + "properties": { + "base_currency": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + } + } + } + }, + "responses": { + "Currencies": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "BSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/base_currency_success_wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "#/components/schemas/DuplicateWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueWrapper" + } + ] + } + } + } + }, + "BErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/BInvalidWrapper" + }, + { + "$ref": "#/components/schemas/BMandatoryWrapper" + }, + { + "$ref": "#/components/schemas/AlreadyEnabledWrapper" + } + ] + } + } + } + }, + "MetaInternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "ActionInternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "action": { + "name": "action", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "reset_mcurrency" + ] + } + }, + "iscsignature": { + "name": "iscsignature", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "BaseCurrencyBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/base_currency_wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/custom_views.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/custom_views.json new file mode 100644 index 0000000..f300d1f --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/custom_views.json @@ -0,0 +1,1457 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "custom_views", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/custom_views": { + "get": { + "operationId": "Get Custom Views", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/CustomViews" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "post": { + "operationId": "Create Views", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete By Ids", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/custom_views/{id}": { + "get": { + "operationId": "Get Custom View", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/CustomViews" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/custom_views/{id}/actions/pin_unpin_fields": { + "put": { + "operationId": "PinUnpinFields", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PinBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/custom_views/actions/change_sort": { + "put": { + "operationId": "Change Sort Order of Custom Views", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/custom_views/{id}/actions/change_sort": { + "put": { + "operationId": "Change Sort Order of Custom View", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.custom_views.All" + ] + } + ], + "components": { + "schemas": { + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "value": { + "type": "object", + "nullable": true + }, + "group_operator": { + "type": "string", + "nullable": true + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "comparator", + "field", + "value", + "group_operator", + "group" + ] + }, + "owner": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "fields": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "_pin": { + "type": "boolean" + } + }, + "required": [ + "id", + "api_name", + "_pin" + ] + }, + "sort_by": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name" + ] + }, + "shared_to": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "territories", + "roles", + "groups", + "users" + ] + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "subordinates": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "type", + "name", + "id", + "subordinates" + ] + }, + "custom_views": { + "type": "object", + "properties": { + "display_value": { + "type": "string" + }, + "system_name": { + "type": "string", + "nullable": true + }, + "category": { + "type": "string" + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "last_accessed_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "name": { + "type": "string" + }, + "created_by": { + "$ref": "#/components/schemas/owner" + }, + "modified_by": { + "$ref": "#/components/schemas/owner" + }, + "module": { + "$ref": "#/components/schemas/owner" + }, + "criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "default": { + "type": "boolean" + }, + "system_defined": { + "type": "boolean" + }, + "locked": { + "type": "boolean", + "default": false, + "nullable": true + }, + "favorite": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "offline": { + "type": "boolean" + }, + "access_type": { + "type": "string", + "enum": [ + "shared", + "public", + "only_to_me" + ] + }, + "shared_to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shared_to" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fields" + } + }, + "sort_by": { + "$ref": "#/components/schemas/sort_by" + }, + "sort_order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "nullable": true + }, + "id": { + "type": "string" + } + }, + "required": [ + "display_value", + "system_name", + "category", + "created_time", + "modified_time", + "last_accessed_time", + "name", + "created_by", + "modified_by", + "module", + "criteria", + "default", + "system_defined", + "locked", + "favorite", + "offline", + "access_type", + "shared_to", + "fields", + "sort_by", + "sort_order", + "id" + ] + }, + "translation": { + "type": "object", + "properties": { + "public_views": { + "type": "string", + "nullable": true + }, + "other_users_views": { + "type": "string", + "nullable": true + }, + "shared_with_me": { + "type": "string", + "nullable": true + }, + "created_by_me": { + "type": "string", + "nullable": true + } + }, + "required": [ + "public_views", + "other_users_views", + "shared_with_me", + "created_by_me" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + }, + "default": { + "type": "string", + "nullable": true + }, + "translation": { + "$ref": "#/components/schemas/translation" + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records", + "default", + "translation" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "$ref": "#/components/schemas/custom_views" + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "$ref": "#/components/schemas/custom_views" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "custom_views", + "info" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "PinFields": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "_pin": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "_pin", + "id" + ] + }, + "PinUnpinFields": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PinFields" + } + } + }, + "required": [ + "fields" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "ErrorDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "ExpectedFieldDetails": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "type": "array" + } + }, + "required": [ + "expected_fields" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND", + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorDetails1" + }, + { + "$ref": "#/components/schemas/ExpectedFieldDetails" + }, + { + "$ref": "#/components/schemas/InvalidTypeDetais" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "DuplicateError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "DuplicateWrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DuplicateError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "RegexDetails": { + "type": "object", + "properties": { + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "regex", + "api_name", + "json_path" + ] + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorDetails" + }, + { + "$ref": "#/components/schemas/RegexDetails" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidWrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "InvalidTypeDetais": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "regex", + "api_name", + "json_path" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetais" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "MaxLengthDetails": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "maximum_length", + "api_name", + "json_path" + ] + }, + "MaxLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MaxLengthDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MaxLengthWrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MaxLengthError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + { + "$ref": "#/components/schemas/details" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "ParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/ParamDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidIdError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidIdWrapper": { + "type": "object", + "properties": { + "custom_views": { + "items": { + "$ref": "#/components/schemas/InvalidIdError" + }, + "type": "array" + } + }, + "required": [ + "custom_views" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + }, + "responses": { + "CustomViews": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "#/components/schemas/InvalidWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/MaxLengthWrapper" + }, + { + "$ref": "#/components/schemas/DuplicateWrapper" + }, + { + "$ref": "#/components/schemas/InvalidIdWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + }, + "PinBody": { + "content": { + "application/json": {} + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_attachments.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_attachments.json new file mode 100644 index 0000000..c02434f --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_attachments.json @@ -0,0 +1,187 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "download_attachments", + "description": "Download attachments", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{record_id}/Emails/actions/download_attachments": { + "get": { + "operationId": "Get Download Attachments Details", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/user_id" + }, + { + "$ref": "#/components/parameters/message_id" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/name" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "multipart/form-data": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.emails.READ", + "ZohoCRM.modules.leads.all", + "ZohoCRM.modules.contacts.all", + "ZohoCRM.modules.deals.all" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN" + ] + }, + "message": { + "type": "string", + "enum": [ + "The module name given seems to be invalid", + "invalid oauth token", + "invalid file type", + "Please check if the URL trying to access is a correct one", + "the request does not contain any file", + "The http request method type is not a valid one" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "message_id": { + "name": "message_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "user_id": { + "name": "user_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "name": { + "name": "name", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_inline_images.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_inline_images.json new file mode 100644 index 0000000..41f9148 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/download_inline_images.json @@ -0,0 +1,176 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "download_inline_images", + "description": "Download Inline Images", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{record_id}/Emails/actions/download_inline_images": { + "get": { + "operationId": "Get Download Inline Images", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/user_id" + }, + { + "$ref": "#/components/parameters/message_id" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "multipart/form-data": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.emails.READ", + "ZohoCRM.modules.leads.all", + "ZohoCRM.modules.contacts.all", + "ZohoCRM.modules.deals.all" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN" + ] + }, + "message": { + "type": "string", + "enum": [ + "The module name given seems to be invalid", + "invalid oauth token", + "invalid file type", + "Please check if the URL trying to access is a correct one", + "the request does not contain any file", + "The http request method type is not a valid one" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "message_id": { + "name": "message_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "user_id": { + "name": "user_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/duplicate_check_preference.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/duplicate_check_preference.json new file mode 100644 index 0000000..49a9c02 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/duplicate_check_preference.json @@ -0,0 +1,712 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "duplicate_check_preference", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/duplicate_check_preference": { + "get": { + "operationId": "Get Duplicate Check Preference", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/DuplicateCheckPreference" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Duplicate Check Preference", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Duplicate Check Preference", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Duplicate Check Preference", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.ALL" + ] + } + ], + "components": { + "schemas": { + "mapped_module": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name", + "name" + ] + }, + "current_field": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name", + "name" + ] + }, + "mapped_field": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name", + "name" + ] + }, + "type_configuration": { + "type": "object", + "properties": { + "field_mappings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "current_field": { + "$ref": "#/components/schemas/current_field" + }, + "mapped_field": { + "$ref": "#/components/schemas/mapped_field" + } + }, + "required": [ + "current_field", + "mapped_field" + ] + } + }, + "mapped_module": { + "$ref": "#/components/schemas/mapped_module" + } + }, + "required": [ + "field_mappings", + "mapped_module" + ] + }, + "Duplicate_Check_Preference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "converted_records", + "mapped_module_records" + ] + }, + "type_configurations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/type_configuration" + } + } + }, + "required": [ + "type", + "type_configurations" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "$ref": "#/components/schemas/Duplicate_Check_Preference" + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "body_wrapper": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "$ref": "#/components/schemas/Duplicate_Check_Preference" + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "InvalidValueWrapper": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "expected_fields": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "ExpectedFieldMissing_Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/expected_fields" + }, + "type": "array" + } + } + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "DependentFieldMissing_Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "dependee": { + "$ref": "#/components/schemas/expected_fields" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "ExpectedFieldMissing": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "oneOf": [ + { + "$ref": "#/components/schemas/ExpectedFieldMissing_Error" + } + ] + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "DependentFieldMissing": { + "type": "object", + "properties": { + "duplicate_check_preference": { + "oneOf": [ + { + "$ref": "#/components/schemas/DependentFieldMissing_Error" + } + ] + } + }, + "required": [ + "duplicate_check_preference" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + }, + "param": { + "type": "string" + } + }, + "required": [ + "param_name", + "param" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "details", + "code", + "message", + "status" + ] + }, + "INVALID_URL_PATTERN": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN" + ] + }, + "message": { + "type": "string", + "enum": [ + "Please check if the URL trying to access is a correct one." + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "REQUIRED_PARAM_MISSING": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string", + "enum": [ + "One of the expected parameter is missing.", + "the module name given seems to be invalid." + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "NO_PERMISSION": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "message": { + "type": "string", + "enum": [ + "the user doesn't have permission for that module." + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "permissions" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + } + }, + "responses": { + "DuplicateCheckPreference": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/ExpectedFieldMissing" + }, + { + "$ref": "#/components/schemas/DependentFieldMissing" + }, + { + "$ref": "#/components/schemas/InvalidValueWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/INVALID_URL_PATTERN" + }, + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING" + }, + { + "$ref": "#/components/schemas/NO_PERMISSION" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/body_wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_compose.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_compose.json new file mode 100644 index 0000000..f7b7d2e --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_compose.json @@ -0,0 +1,654 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "email_compose", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/email/v8/settings/compose": { + "get": { + "operationId": "Get Email composer default settings", + "parameters": [ + { + "$ref": "#/components/parameters/type" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/FeatureNotEnabledError" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Email composer default settings", + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "email_compose": { + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/TypeDetails" + } + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + } + ] + }, + "type": "array" + } + }, + "required": [ + "email_compose" + ] + } + ] + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "email_compose": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FeatureNotEnabledError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "email_compose" + ] + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + {} + ], + "components": { + "schemas": { + "default_from_address": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "org_email", + "primary" + ] + }, + "user_name": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}$" + } + }, + "required": [ + "email" + ] + }, + "default_replyto_address": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "org_email", + "primary" + ] + }, + "user_name": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}$" + } + }, + "required": [ + "email" + ] + }, + "font": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int32" + }, + "family": { + "type": "string" + } + }, + "required": [ + "size", + "family" + ] + }, + "TypeDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "default", + "emailin", + "mass_mail" + ] + } + } + }, + "email_compose": { + "type": "object", + "properties": { + "default_from_address": { + "$ref": "#/components/schemas/default_from_address" + }, + "default_replyto_address": { + "$ref": "#/components/schemas/default_replyto_address" + }, + "font": { + "$ref": "#/components/schemas/font" + }, + "type": { + "type": "string", + "enum": [ + "default", + "emailin", + "mass_mail" + ] + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "email_compose": { + "items": { + "$ref": "#/components/schemas/email_compose" + }, + "type": "array" + } + }, + "required": [ + "email_compose" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_ERROR" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "status" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "default", + "emailin", + "mass_mail" + ] + } + } + }, + "required": [ + "param_name", + "supported_values" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + } + }, + "required": [ + "code", + "status", + "details" + ] + }, + "FeatureNotEnabledError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "FEATURE_NOT_ENABLED" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/BodyErrorDetails" + }, + "message": { + "type": "string", + "nullable": true + } + }, + "required": [ + "code", + "status", + "details", + "message" + ] + }, + "InvalidDataError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "status" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "details": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/SupportedValueDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + } + }, + "required": [ + "details", + "status", + "code", + "message" + ] + }, + "Details1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Details2": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "regex": { + "type": "string" + } + } + }, + "Details3": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Supported_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Details1" + }, + { + "$ref": "#/components/schemas/Details2" + }, + { + "$ref": "#/components/schemas/Details3" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details" + ] + }, + "Expected_Type_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details" + ] + }, + "InvalidParamWrapper": { + "type": "object", + "properties": { + "email_compose": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidIDError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/Supported_Exception" + }, + { + "$ref": "#/components/schemas/InvalidDataError" + }, + { + "$ref": "#/components/schemas/Expected_Type_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "email_compose" + ] + } + }, + "responses": { + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "email_compose": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + }, + { + "$ref": "#/components/schemas/InvalidParamWrapper" + } + ] + } + } + } + } + }, + "parameters": { + "type": { + "name": "type", + "in": "query", + "description": "updates respective preferences", + "required": false, + "schema": { + "type": "string", + "enum": [ + "default", + "emailin", + "mass_mail" + ] + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_drafts.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_drafts.json new file mode 100644 index 0000000..7d7aa5f --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_drafts.json @@ -0,0 +1,866 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "email_drafts", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{record}/__email_drafts": { + "get": { + "operationId": "Get Email Drafts", + "parameters": [ + { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "record", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/EmailDrafts" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Email Drafts", + "parameters": [ + { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "record", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "403": { + "$ref": "#/components/responses/PermissionResponse" + } + } + }, + "put": { + "operationId": "Update Email Drafts", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/{module}/{record}/__email_drafts/{draft}": { + "get": { + "operationId": "Get Email Draft", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record" + }, + { + "$ref": "#/components/parameters/draft" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/EmailDrafts" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Email Draft", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record" + }, + { + "$ref": "#/components/parameters/draft" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Email Draft", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record" + }, + { + "$ref": "#/components/parameters/draft" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.Modules.ALL" + ] + } + ], + "components": { + "schemas": { + "to": { + "type": "object", + "properties": { + "user_name": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]zoho[.]com", + "nullable": true + } + }, + "required": [ + "user_name", + "email" + ] + }, + "template": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + }, + "attachments": { + "type": "object", + "properties": { + "service_name": { + "type": "string" + }, + "file_size": { + "type": "string", + "pattern": "[0-9]" + }, + "id": { + "type": "string" + }, + "file_name": { + "type": "string" + } + }, + "required": [ + "service_name", + "file_size", + "id", + "file_name" + ] + }, + "schedule_details": { + "type": "object", + "properties": { + "time": { + "type": "string", + "format": "date-time" + }, + "timezone": { + "type": "object", + "nullable": true + }, + "source": { + "type": "string", + "default": "upTime", + "nullable": true + } + }, + "required": [ + "time", + "timezone", + "source" + ] + }, + "inventory_details": { + "type": "object", + "properties": { + "inventory_template": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "record": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "paper_type": { + "type": "string" + }, + "view_type": { + "type": "string" + } + }, + "required": [ + "inventory_template", + "record", + "paper_type", + "view_type" + ] + }, + "email_drafts": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "from": { + "type": "string" + }, + "to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/to" + } + }, + "reply_to": { + "type": "string", + "pattern": "[a-z]{7}[@]zoho[.]com", + "nullable": true + }, + "cc": { + "type": "array", + "items": { + "$ref": "#/components/schemas/to" + } + }, + "bcc": { + "type": "array", + "items": { + "$ref": "#/components/schemas/to" + } + }, + "template": { + "$ref": "#/components/schemas/template" + }, + "inventory_details": { + "$ref": "#/components/schemas/inventory_details" + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/attachments" + } + }, + "schedule_details": { + "$ref": "#/components/schemas/schedule_details" + }, + "rich_text": { + "type": "boolean" + }, + "email_opt_out": { + "type": "boolean" + }, + "subject": { + "type": "string", + "nullable": true + }, + "content": { + "type": "string", + "nullable": true + }, + "summary": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "modified_time", + "created_time", + "from", + "to", + "reply_to", + "cc", + "bcc", + "template", + "inventory_details", + "attachments", + "schedule_details", + "rich_text", + "email_opt_out", + "subject", + "content", + "summary" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "__email_drafts": { + "items": { + "$ref": "#/components/schemas/email_drafts" + }, + "type": "array" + } + }, + "required": [ + "__email_drafts" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "__email_drafts": { + "items": { + "$ref": "#/components/schemas/email_drafts" + }, + "type": "array" + } + }, + "required": [ + "__email_drafts" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "__email_drafts": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "__email_drafts" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "__email_drafts": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "__email_drafts" + ] + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "__email_drafts": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "__email_drafts" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "PermissionError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + } + }, + "responses": { + "EmailDrafts": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + } + ] + } + } + } + }, + "PermissionResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/PermissionError" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record": { + "name": "record", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "draft": { + "name": "draft", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_related_records.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_related_records.json new file mode 100644 index 0000000..97b2e12 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_related_records.json @@ -0,0 +1,637 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "email_related_records", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_name}/{record_id}/Emails": { + "get": { + "operationId": "Get Emails Related Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/index" + }, + { + "$ref": "#/components/parameters/owner_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Emails" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/{module_name}/{record_id}/Emails/{message_id}": { + "get": { + "operationId": "Get Emails Related Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/owner_id" + }, + { + "$ref": "#/components/parameters/message_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Emails" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.{module_API_name}.READ", + "ZohoCRM.modules.emails.READ" + ] + } + ], + "components": { + "schemas": { + "UserDetails": { + "type": "object", + "properties": { + "user_name": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "nullable": true + } + }, + "required": [ + "user_name", + "email" + ] + }, + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "linked_record": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "module": { + "$ref": "#/components/schemas/module" + } + }, + "required": [ + "id", + "name", + "module" + ] + }, + "status": { + "type": "object", + "properties": { + "first_open": { + "type": "string", + "format": "date-time" + }, + "count": { + "type": "string" + }, + "type": { + "type": "string", + "nullable": true + }, + "last_open": { + "type": "string", + "format": "date-time" + }, + "bounced_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "bounced_reason": { + "type": "string", + "nullable": true + }, + "category": { + "type": "string" + }, + "sub_category": { + "type": "string" + } + }, + "required": [ + "type", + "bounced_time", + "bounced_reason" + ] + }, + "email": { + "type": "object", + "properties": { + "attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/attachments" + } + }, + "thread_id": { + "type": "string" + }, + "cc": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDetails" + } + }, + "summary": { + "type": "string", + "nullable": true + }, + "owner": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "read": { + "type": "boolean", + "nullable": true + }, + "content": { + "type": "string" + }, + "sent": { + "type": "boolean", + "nullable": true + }, + "subject": { + "type": "string", + "nullable": true + }, + "activity_info": { + "type": "object", + "nullable": true + }, + "intent": { + "type": "string", + "enum": [ + "request", + "query", + "purchase", + "complaints", + "spam", + "others" + ], + "nullable": true + }, + "sentiment_info": { + "type": "string", + "enum": [ + "negative", + "neutral", + "positive" + ], + "nullable": true + }, + "message_id": { + "type": "string", + "nullable": true + }, + "source": { + "type": "string", + "nullable": true + }, + "linked_record": { + "$ref": "#/components/schemas/linked_record" + }, + "sent_time": { + "type": "string" + }, + "emotion": { + "type": "string", + "nullable": true + }, + "from": { + "$ref": "#/components/schemas/UserDetails" + }, + "to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserDetails" + } + }, + "time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "status": { + "type": "array", + "items": { + "$ref": "#/components/schemas/status" + } + }, + "has_attachment": { + "type": "boolean", + "nullable": true + }, + "has_thread_attachment": { + "type": "boolean", + "nullable": true + }, + "editable": { + "type": "boolean" + }, + "mail_format": { + "type": "string" + }, + "reply_to": { + "$ref": "#/components/schemas/UserDetails" + } + }, + "required": [ + "cc", + "summary", + "owner", + "read", + "sent", + "subject", + "activity_info", + "intent", + "sentiment_info", + "message_id", + "source", + "linked_record", + "emotion", + "from", + "to", + "time", + "status", + "has_attachment", + "has_thread_attachment" + ] + }, + "attachments": { + "type": "object", + "properties": { + "size": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "info": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "next_index": { + "type": "string", + "nullable": true + }, + "prev_index": { + "type": "string", + "nullable": true + }, + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "count", + "next_index", + "prev_index", + "per_page", + "more_records" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "Emails": { + "items": { + "$ref": "#/components/schemas/email" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "Emails", + "info" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + }, + "responses": { + "Emails": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/UnsupportedVersionError" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "module_name": { + "name": "module_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all_contacts_draft_crm_emails", + "all_contacts_scheduled_crm_emails", + "all_contacts_sent_crm_emails", + "sent_from_crm", + "scheduled_in_crm", + "drafts", + "user_emails" + ] + } + }, + "owner_id": { + "name": "owner_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "message_id": { + "name": "message_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "index": { + "name": "index", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "filter": { + "name": "filter", + "in": "query", + "required": false, + "schema": {} + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_sharing_details.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_sharing_details.json new file mode 100644 index 0000000..1bf88f2 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_sharing_details.json @@ -0,0 +1,165 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "email_sharing_details", + "description": "Email Sharing Details", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{record_id}/__emails_sharing_details": { + "get": { + "operationId": "Get Email Sharing Details", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.emails.ALL" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Email_Sharings": { + "type": "object", + "properties": { + "share_from_users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + }, + "available_types": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "__emails_sharing_details": { + "items": { + "$ref": "#/components/schemas/Email_Sharings" + }, + "type": "array" + } + } + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN" + ] + }, + "message": { + "type": "string", + "enum": [ + "The module name given seems to be invalid", + "invalid oauth token", + "invalid file type", + "Please check if the URL trying to access is a correct one", + "the request does not contain any file", + "The http request method type is not a valid one" + ] + }, + "details": { + "type": "object" + } + } + } + }, + "parameters": { + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_templates.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_templates.json new file mode 100644 index 0000000..0ecfa5a --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/email_templates.json @@ -0,0 +1,400 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "email_templates", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/email_templates": { + "get": { + "operationId": "Get Email Templates", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/category" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Templates" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/email_templates/{template}": { + "get": { + "operationId": "Get Email Template", + "parameters": [ + { + "$ref": "#/components/parameters/template" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Templates" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.templates.email.READ" + ] + } + ], + "components": { + "schemas": { + "last_version_statistics": { + "type": "object", + "properties": { + "tracked": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "delivered": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "opened": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "bounced": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "sent": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "clicked": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "tracked", + "delivered", + "opened", + "bounced", + "sent", + "clicked" + ] + }, + "Email_Template": { + "type": "object", + "properties": { + "attachments": { + "items": { + "$ref": "#/components/schemas/Attachment" + }, + "type": "array" + }, + "subject": { + "type": "string", + "nullable": true + }, + "associated": { + "type": "boolean", + "nullable": true + }, + "consent_linked": { + "type": "boolean", + "nullable": true + }, + "description": { + "type": "string" + }, + "last_version_statistics": { + "$ref": "#/components/schemas/last_version_statistics" + }, + "category": { + "type": "string" + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "last_usage_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "folder": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/inventory_templates.json#/components/schemas/folder" + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/inventory_templates.json#/components/schemas/ModuleMap" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/inventory_templates.json#/components/schemas/User" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/inventory_templates.json#/components/schemas/User" + }, + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "editor_mode": { + "type": "string", + "nullable": true + }, + "favorite": { + "type": "boolean", + "nullable": true + }, + "content": { + "type": "string", + "nullable": true + }, + "active": { + "type": "boolean", + "nullable": true + }, + "mail_content": { + "type": "string", + "nullable": true + } + }, + "required": [ + "attachments", + "subject", + "associated", + "consent_linked", + "last_version_statistics", + "created_time", + "modified_time", + "last_usage_time", + "folder", + "module", + "created_by", + "modified_by", + "name", + "id", + "editor_mode", + "favorite", + "content", + "active", + "mail_content" + ] + }, + "Attachment": { + "type": "object", + "properties": { + "size": { + "type": "integer", + "format": "int64" + }, + "file_name": { + "type": "string" + }, + "file_id": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "wrapper": { + "type": "object", + "properties": { + "email_templates": { + "items": { + "$ref": "#/components/schemas/Email_Template" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "email_templates", + "info" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + } + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + } + } + } + }, + "responses": { + "Templates": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "template": { + "name": "template", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "category": { + "name": "category", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/entity_scores.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/entity_scores.json new file mode 100644 index 0000000..da980db --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/entity_scores.json @@ -0,0 +1,537 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "entity_scores", + "description": "Entity Scores", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Entity_Scores__s/{record_id}": { + "get": { + "operationId": "Get Entity Score", + "parameters": [ + { + "$ref": "#/components/parameters/cvid" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/fields" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Required_Param_Missing_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Request_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.read", + "ZohoCRM.settings.modules.all", + "ZohoCRM.settings.all" + ] + } + ] + } + }, + "/crm/v8/Entity_Scores__s": { + "get": { + "operationId": "Get Entity Scores", + "parameters": [ + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/page_token" + }, + { + "$ref": "#/components/parameters/cvid" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Required_Param_Missing_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Request_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.read", + "ZohoCRM.settings.modules.all", + "ZohoCRM.settings.all" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Entity_Scores": { + "type": "object", + "properties": { + "Entity": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + } + }, + "required": [ + "name", + "id", + "module" + ] + }, + "Positive_Score": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Touch_Point_Score": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Score": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Negative_Score": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Touch_Point_Negative_Score": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "Scoring_Rule": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "$field_states": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "$zia_visions": { + "type": "boolean" + }, + "Touch_Point_Positive_Score": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "Entity", + "Positive_Score", + "Touch_Point_Score", + "Score", + "Negative_Score", + "Touch_Point_Negative_Score", + "Scoring_Rule", + "id", + "Touch_Point_Positive_Score" + ] + }, + "Info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "next_page_token": { + "type": "string", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "sort_by": { + "type": "string", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "previous_page_token": { + "type": "string", + "nullable": true + }, + "page_token_expiry": { + "type": "string", + "nullable": true + }, + "sort_order": { + "type": "string", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "next_page_token", + "count", + "sort_by", + "page", + "previous_page_token", + "page_token_expiry", + "sort_order", + "more_records" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Entity_Scores" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "data", + "info" + ] + }, + "Required_Param_Missing_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Module_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Request_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_REQUEST" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "fields": { + "name": "fields", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "page_token": { + "name": "page_token", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "If-Modified-Since": { + "name": "If-Modified-Since", + "in": "header", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "cvid": { + "name": "cvid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/features.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/features.json new file mode 100644 index 0000000..31c319c --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/features.json @@ -0,0 +1,367 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "features", + "description": "Features", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/__features": { + "get": { + "operationId": "Get Feature Details", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/api_names" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Invalid_Module_Exception" + } + } + } + } + } + } + }, + "/crm/v8/__features/{feature_api_name}": { + "get": { + "operationId": "Get Feature Detail", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/feature_api_name" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/__features/data_enrichment": { + "get": { + "operationId": "Get Data Enrichment", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/__features/user_licenses": { + "get": { + "operationId": "Get User Licences Count", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.files.CREATE" + ] + } + ], + "components": { + "schemas": { + "Feature": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "parent_feature": { + "$ref": "#/components/schemas/Feature" + }, + "module_supported": { + "type": "boolean" + }, + "details": { + "$ref": "#/components/schemas/detail" + }, + "feature_label": { + "type": "string" + }, + "components": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "module_supported": { + "type": "boolean" + }, + "details": { + "$ref": "#/components/schemas/detail" + }, + "feature_label": { + "type": "string" + } + }, + "required": [ + "api_name", + "module_supported", + "details", + "feature_label" + ] + } + } + }, + "required": [ + "api_name", + "parent_feature", + "module_supported", + "details", + "feature_label", + "components" + ] + }, + "detail": { + "type": "object", + "properties": { + "available_count": { + "$ref": "#/components/schemas/limit" + }, + "limits": { + "$ref": "#/components/schemas/limit" + }, + "used_count": { + "$ref": "#/components/schemas/limit" + } + }, + "required": [ + "available_count", + "limits", + "used_count" + ] + }, + "limit": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int32" + }, + "edition_limit": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "total", + "edition_limit" + ] + }, + "Invalid_Module_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string", + "enum": [ + "the module name given seems to be invalid" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "__features": { + "items": { + "$ref": "#/components/schemas/Feature" + }, + "type": "array" + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + } + }, + "required": [ + "__features", + "info" + ] + } + }, + "parameters": { + "module": { + "name": "module", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "api_names": { + "name": "api_names", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "feature_api_name": { + "name": "feature_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_attachments.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_attachments.json new file mode 100644 index 0000000..8226b85 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_attachments.json @@ -0,0 +1,171 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "field_attachments", + "description": "field_attachments", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/{record_id}/actions/download_fields_attachment": { + "get": { + "operationId": "Get Field Attachments", + "parameters": [ + { + "$ref": "#/components/parameters/fields_attachment_id" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/x-download": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/x-download": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL.READ" + ] + } + ], + "components": { + "schemas": { + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + } + }, + "Invalid_Module": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + } + } + } + }, + "Invalid_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + } + } + } + }, + "parameters": { + "fields_attachment_id": { + "name": "fields_attachment_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_map_dependency.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_map_dependency.json new file mode 100644 index 0000000..df5a7b9 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/field_map_dependency.json @@ -0,0 +1,902 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "field_map_dependency", + "description": "field_map_dependency", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/layouts/{layout_id}/map_dependency": { + "post": { + "operationId": "Create Map Dependency", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Not_Supported" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url_Pattern" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Map Dependencies", + "parameters": [ + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Not_Supported" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url_Pattern" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/layouts/{layout_id}/map_dependency/{dependency_id}": { + "put": { + "operationId": "Update Map Dependency", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/dependency_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Not_Supported" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url_Pattern" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Map Dependency", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/dependency_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Not_Supported" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url_Pattern" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Map Dependency", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/dependency_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Not_Supported" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url_Pattern" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.map_dependency.ALL" + ] + } + ], + "components": { + "schemas": { + "Parent": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "Child": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "PickList_Mapping": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "actual_value": { + "type": "string" + }, + "display_value": { + "type": "string" + }, + "maps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Picklist_Map" + } + } + } + }, + "Picklist_Map": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "actual_value": { + "type": "string" + }, + "display_value": { + "type": "string" + }, + "_delete": { + "type": "boolean" + } + } + }, + "Sub_Module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "Map_Dependency": { + "type": "object", + "properties": { + "parent": { + "$ref": "#/components/schemas/Parent" + }, + "child": { + "$ref": "#/components/schemas/Child" + }, + "pick_list_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PickList_Mapping" + } + }, + "internal": { + "type": "boolean" + }, + "active": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "source": { + "type": "integer", + "format": "int32" + }, + "category": { + "type": "integer", + "format": "int32" + }, + "sub_module": { + "$ref": "#/components/schemas/Sub_Module" + } + } + }, + "info": { + "type": "object", + "properties": { + "page": { + "type": "integer", + "format": "int32" + }, + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "map_dependency": { + "items": { + "$ref": "#/components/schemas/Map_Dependency" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "map_dependency": { + "items": { + "$ref": "#/components/schemas/Map_Dependency" + }, + "type": "array" + } + } + }, + "Expected_DataType": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Error_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Resource_Path_Index": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "Param_Name": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + } + }, + "Api_Name": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + } + }, + "Mandatory_Not_Found": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + } + } + }, + "Required_Param_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Param_Name" + }, + { + "$ref": "#/components/schemas/Api_Name" + } + ] + } + } + }, + "Invalid_Module": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + }, + "Invalid_Url_Pattern": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + }, + "Not_Supported": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NOT_SUPPORTED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Param_Name" + } + } + }, + "Invalid_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Detail" + }, + { + "$ref": "#/components/schemas/Resource_Path_Index" + }, + { + "$ref": "#/components/schemas/Expected_DataType" + } + ] + } + } + }, + "Error_Response_Wrapper": { + "type": "object", + "properties": { + "map_dependency": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + }, + "Success_Response_Wrapper": { + "type": "object", + "properties": { + "map_dependency": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + }, + "parameters": { + "layout_id": { + "name": "layout_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "dependency_id": { + "name": "dependency_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "X-ZCSRF-TOKEN": { + "name": "X-ZCSRF-TOKEN", + "in": "header", + "required": false, + "schema": { + "type": "string", + "enum": [ + "sdcds" + ] + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fields.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fields.json new file mode 100644 index 0000000..1cf33e4 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fields.json @@ -0,0 +1,2161 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "fields", + "description": "Fields", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/fields": { + "get": { + "operationId": "Get Fields", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/data_type" + }, + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/feature_name" + }, + { + "$ref": "#/components/parameters/component" + }, + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + }, + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Fields" + }, + "400": { + "$ref": "#/components/responses/RRootResponse" + } + } + }, + "post": { + "operationId": "Create Field", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "patch": { + "operationId": "Update Fields", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/fields/{field}": { + "get": { + "operationId": "Get Field", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/field" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + }, + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Fields" + }, + "400": { + "$ref": "#/components/responses/RRootResponse" + } + } + }, + "patch": { + "operationId": "Update Field", + "parameters": [ + { + "$ref": "#/components/parameters/field" + }, + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Field", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/field" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/RootResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.fields.read", + "ZohoCRM.settings.fields.all", + "ZohoCRM.settings.all" + ] + } + ], + "components": { + "schemas": { + "Minified_Field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "email_parser": { + "type": "object", + "properties": { + "fields_update_supported": { + "type": "boolean", + "nullable": true + }, + "record_operations_supported": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "fields_update_supported", + "record_operations_supported" + ] + }, + "profile": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "permission_type": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id", + "permission_type" + ] + }, + "view_type": { + "type": "object", + "properties": { + "view": { + "type": "boolean", + "nullable": true + }, + "edit": { + "type": "boolean", + "nullable": true + }, + "quick_create": { + "type": "boolean", + "nullable": true + }, + "create": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "view", + "edit", + "quick_create", + "create" + ] + }, + "pick_list_values": { + "type": "object", + "properties": { + "colour_code": { + "type": "string", + "nullable": true + }, + "actual_value": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unused", + "used" + ] + }, + "id": { + "type": "string" + }, + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "display_value": { + "type": "string" + }, + "reference_value": { + "type": "string" + }, + "deal_category": { + "type": "string" + }, + "probability": { + "type": "integer", + "format": "int32" + }, + "forecast_category": { + "$ref": "#/components/schemas/Forecast_Category" + }, + "expected_data_type": { + "type": "string" + }, + "sys_ref_name": { + "type": "string" + }, + "forecast_type": { + "type": "string" + }, + "maps": { + "items": { + "$ref": "#/components/schemas/Maps" + }, + "type": "array" + }, + "_delete": { + "type": "boolean" + }, + "show_value": { + "type": "boolean" + } + }, + "required": [ + "colour_code", + "actual_value", + "type", + "id", + "sequence_number", + "display_value" + ] + }, + "Maps": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "pick_list_values": { + "items": { + "$ref": "#/components/schemas/pick_list_values" + }, + "type": "array" + } + } + }, + "Forecast_Category": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "multiselectlookup": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "linking_module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "connected_module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "lookup_apiname": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "connectedfield_apiname": { + "type": "string", + "nullable": true + }, + "connectedlookup_apiname": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "record_access": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "display_label", + "linking_module", + "connected_module", + "lookup_apiname", + "api_name", + "connectedfield_apiname", + "connectedlookup_apiname", + "id", + "record_access" + ] + }, + "auto_number": { + "type": "object", + "properties": { + "starting_number_length": { + "type": "integer", + "format": "int32" + }, + "prefix": { + "type": "string", + "nullable": true + }, + "suffix": { + "type": "string", + "nullable": true + }, + "start_number": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "starting_number_length", + "prefix", + "suffix", + "start_number" + ] + }, + "subform": { + "type": "object", + "properties": { + "module": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "module", + "id" + ] + }, + "currency": { + "type": "object", + "properties": { + "rounding_option": { + "type": "string", + "enum": [ + "normal", + "round_up", + "round_off", + "round_down" + ] + }, + "precision": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "rounding_option", + "precision" + ] + }, + "query_details": { + "type": "object", + "properties": { + "query_id": { + "type": "string", + "nullable": true + }, + "criteria": { + "$ref": "#/components/schemas/Criteria" + } + } + }, + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "$ref": "#/components/schemas/Minified_Field" + }, + "value": { + "type": "object", + "nullable": true + }, + "group_operator": { + "type": "string", + "nullable": true + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "comparator", + "field", + "value", + "group_operator", + "group" + ] + }, + "show_fields": { + "type": "object", + "properties": { + "show_data": { + "type": "boolean", + "nullable": true + }, + "field": { + "$ref": "#/components/schemas/Minified_Field" + } + }, + "required": [ + "show_data", + "field" + ] + }, + "lookup": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "api_name": { + "type": "string", + "nullable": true + }, + "query_details": { + "$ref": "#/components/schemas/query_details" + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "id": { + "type": "string", + "nullable": true + }, + "revalidate_filter_during_edit": { + "type": "boolean" + }, + "show_fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/show_fields" + } + } + }, + "required": [ + "query_details", + "module", + "revalidate_filter_during_edit", + "show_fields" + ] + }, + "hipaa_compliance": { + "type": "object", + "properties": { + "restricted_in_export": { + "type": "boolean", + "nullable": true + }, + "restricted": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "restricted_in_export", + "restricted" + ] + }, + "unique": { + "type": "object", + "properties": { + "casesensitive": { + "type": "string", + "nullable": true + } + } + }, + "external": { + "type": "object", + "properties": { + "show": { + "type": "boolean", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "allow_multiple_config": { + "type": "boolean" + } + }, + "required": [ + "show", + "type" + ] + }, + "private": { + "type": "object", + "properties": { + "restricted": { + "type": "boolean", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "export": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "restricted", + "type", + "export" + ] + }, + "crypt": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "column": { + "type": "string" + }, + "table": { + "type": "string" + }, + "encFldIds": { + "type": "array", + "items": { + "type": "string" + } + }, + "notify": { + "type": "string" + } + }, + "required": [ + "mode", + "status" + ] + }, + "tooltip": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "name", + "value" + ] + }, + "history_tracking": { + "type": "object", + "properties": { + "module": { + "$ref": "#/components/schemas/HistoryTrackingModule" + }, + "duration_configured_field": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + } + }, + "required": [ + "module", + "duration_configured_field" + ] + }, + "multi_module_lookup": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "modules": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + } + } + }, + "required": [ + "display_label", + "api_name", + "modules" + ] + }, + "formula": { + "type": "object", + "properties": { + "return_type": { + "type": "string", + "nullable": true + }, + "expression": { + "type": "string" + } + }, + "required": [ + "return_type", + "expression" + ] + }, + "sharing_properties": { + "type": "object", + "properties": { + "scheduler_status": { + "type": "string", + "nullable": true + }, + "share_preference_enabled": { + "type": "boolean", + "nullable": true + }, + "share_permission": { + "type": "string", + "enum": [ + "read-write", + "read-only", + "full-access" + ], + "nullable": true + } + }, + "required": [ + "scheduler_status", + "share_preference_enabled", + "share_permission" + ] + }, + "refer_from_field": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "api_name" + ] + }, + "association_details": { + "type": "object", + "properties": { + "related_field": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "lookup_field": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + } + }, + "required": [ + "related_field", + "lookup_field" + ] + }, + "file_upolad_option": { + "type": "object", + "properties": { + "actual_value": { + "type": "string", + "nullable": true + }, + "display_value": { + "type": "string", + "nullable": true + } + }, + "required": [ + "actual_value", + "display_value" + ] + }, + "empty": { + "type": "object", + "properties": { + "dummy": { + "type": "object", + "nullable": true + } + }, + "required": [ + "dummy" + ] + }, + "Operation_type": { + "type": "object", + "properties": { + "web_update": { + "type": "boolean", + "nullable": true + }, + "api_create": { + "type": "boolean", + "nullable": true + }, + "web_create": { + "type": "boolean", + "nullable": true + }, + "api_update": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "web_update", + "api_create", + "web_create", + "api_update" + ] + }, + "Rollup_Summary": { + "type": "object", + "properties": { + "return_type": { + "type": "string", + "nullable": true + }, + "expression": { + "$ref": "#/components/schemas/Expression" + }, + "based_on_module": { + "$ref": "#/components/schemas/Minified_Field" + }, + "related_list": { + "$ref": "#/components/schemas/Minified_Field" + }, + "rollup_based_on": { + "type": "string", + "nullable": true + } + }, + "required": [ + "return_type", + "expression", + "based_on_module", + "related_list", + "rollup_based_on" + ] + }, + "Expression": { + "type": "object", + "properties": { + "function_parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name" + ] + } + }, + "criteria": { + "$ref": "#/components/schemas/Rollup_Criteria" + }, + "function": { + "type": "string", + "nullable": true + } + }, + "required": [ + "function_parameters", + "criteria", + "function" + ] + }, + "HistoryTrackingModule": { + "type": "object", + "properties": { + "layout": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/layouts.json#/components/schemas/layouts" + }, + "display_label": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "module": { + "$ref": "#/components/schemas/HistoryTrackingModule" + }, + "id": { + "type": "string" + }, + "module_name": { + "type": "string" + } + } + }, + "Rollup_Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "$ref": "#/components/schemas/Minified_Field" + }, + "value": { + "type": "object", + "nullable": true + } + }, + "required": [ + "comparator", + "field", + "value" + ] + }, + "operation_type": { + "type": "object", + "properties": { + "web_update": { + "type": "boolean" + }, + "api_create": { + "type": "boolean" + }, + "web_create": { + "type": "boolean" + }, + "api_update": { + "type": "boolean" + } + }, + "required": [ + "web_update", + "api_create", + "web_create", + "api_update" + ] + }, + "Convert_Mapping": { + "type": "object", + "properties": { + "Contacts": { + "type": "string", + "nullable": true + }, + "Deals": { + "type": "string", + "nullable": true + }, + "Accounts": { + "type": "string", + "nullable": true + } + } + }, + "layout_association": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "name", + "id" + ] + }, + "fields": { + "type": "object", + "properties": { + "associated_module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "data_type": { + "type": "string" + }, + "operation_type": { + "$ref": "#/components/schemas/operation_type" + }, + "system_mandatory": { + "type": "boolean" + }, + "webhook": { + "type": "boolean" + }, + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "default_value": { + "type": "string" + }, + "blueprint_supported": { + "type": "boolean" + }, + "virtual_field": { + "type": "boolean" + }, + "field_read_only": { + "type": "boolean" + }, + "customizable_properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read_only": { + "type": "boolean" + }, + "custom_field": { + "type": "boolean" + }, + "businesscard_supported": { + "type": "boolean" + }, + "filterable": { + "type": "boolean" + }, + "visible": { + "type": "boolean" + }, + "available_in_user_layout": { + "type": "boolean" + }, + "display_field": { + "type": "boolean" + }, + "pick_list_values_sorted_lexically": { + "type": "boolean" + }, + "sortable": { + "type": "boolean" + }, + "layout_associations": { + "items": { + "$ref": "#/components/schemas/layout_association" + }, + "type": "array" + }, + "separator": { + "type": "boolean" + }, + "searchable": { + "type": "boolean" + }, + "enable_colour_code": { + "type": "boolean", + "default": true + }, + "mass_update": { + "type": "boolean" + }, + "json_type": { + "type": "string" + }, + "created_source": { + "type": "string" + }, + "type": { + "type": "string" + }, + "display_label": { + "type": "string" + }, + "column_name": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "display_type": { + "type": "integer", + "format": "int32" + }, + "ui_type": { + "type": "integer", + "format": "int32" + }, + "colour_code_enabled_by_system": { + "type": "boolean", + "nullable": true + }, + "length": { + "type": "integer", + "format": "int32" + }, + "decimal_place": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "quick_sequence_number": { + "type": "string" + }, + "email_parser": { + "$ref": "#/components/schemas/email_parser" + }, + "rollup_summary": { + "type": "object", + "nullable": true + }, + "refer_from_field": { + "$ref": "#/components/schemas/refer_from_field" + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "show_type": { + "type": "integer", + "format": "int32" + }, + "category": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string" + }, + "multi_module_lookup": { + "type": "object", + "nullable": true + }, + "sharing_properties": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/sharing_properties" + }, + "currency": { + "type": "object", + "nullable": true + }, + "file_upolad_optionlist": { + "type": "array", + "items": { + "$ref": "#/components/schemas/file_upolad_option" + } + }, + "lookup": { + "type": "object", + "nullable": true + }, + "profiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/profile" + } + }, + "view_type": { + "$ref": "#/components/schemas/view_type" + }, + "unique": { + "type": "object", + "nullable": true + }, + "sub_module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "subform": { + "type": "object", + "nullable": true + }, + "external": { + "$ref": "#/components/schemas/external" + }, + "formula": { + "type": "object", + "nullable": true + }, + "private": { + "$ref": "#/components/schemas/private" + }, + "convert_mapping": { + "$ref": "#/components/schemas/Convert_Mapping" + }, + "multiselectlookup": { + "type": "object", + "nullable": true + }, + "multiuserlookup": { + "$ref": "#/components/schemas/multiselectlookup" + }, + "autonumber": { + "$ref": "#/components/schemas/auto_number" + }, + "auto_number": { + "type": "object", + "nullable": true + }, + "pick_list_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pick_list_values" + } + }, + "crypt": { + "$ref": "#/components/schemas/crypt" + }, + "tooltip": { + "$ref": "#/components/schemas/tooltip" + }, + "history_tracking": { + "$ref": "#/components/schemas/history_tracking" + }, + "association_details": { + "$ref": "#/components/schemas/association_details" + }, + "allowed_modules": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + } + }, + "additional_column": { + "type": "string", + "nullable": true + }, + "field_label": { + "type": "string" + }, + "common.picklist": { + "type": "object", + "nullable": true + }, + "hipaa_compliance_enabled": { + "type": "boolean", + "nullable": true + }, + "hipaa_compliance": { + "$ref": "#/components/schemas/hipaa_compliance" + }, + "_update_existing_records": { + "type": "boolean" + }, + "number_separator": { + "type": "boolean" + }, + "textarea": { + "$ref": "#/components/schemas/textarea" + }, + "static_field": { + "type": "boolean" + } + }, + "required": [ + "associated_module", + "data_type", + "operation_type", + "system_mandatory", + "webhook", + "blueprint_supported", + "virtual_field", + "field_read_only", + "customizable_properties", + "read_only", + "custom_field", + "businesscard_supported", + "filterable", + "visible", + "available_in_user_layout", + "display_field", + "pick_list_values_sorted_lexically", + "sortable", + "layout_associations", + "separator", + "searchable", + "enable_colour_code", + "mass_update", + "json_type", + "created_source", + "type", + "display_label", + "column_name", + "api_name", + "display_type", + "ui_type", + "colour_code_enabled_by_system", + "length", + "decimal_place", + "quick_sequence_number", + "email_parser", + "rollup_summary", + "refer_from_field", + "created_time", + "modified_time", + "show_type", + "category", + "id", + "multi_module_lookup", + "sharing_properties", + "currency", + "file_upolad_optionlist", + "lookup", + "profiles", + "view_type", + "unique", + "sub_module", + "subform", + "external", + "formula", + "convert_mapping", + "multiselectlookup", + "multiuserlookup", + "autonumber", + "auto_number", + "pick_list_values", + "crypt", + "tooltip", + "history_tracking", + "association_details", + "allowed_modules", + "additional_column", + "field_label", + "common.picklist", + "hipaa_compliance_enabled", + "hipaa_compliance", + "_update_existing_records", + "number_separator", + "textarea", + "static_field" + ] + }, + "textarea": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + } + }, + "wrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "$ref": "#/components/schemas/fields" + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "$ref": "#/components/schemas/fields" + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidParamDetails" + }, + { + "$ref": "#/components/schemas/empty" + } + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MandatoryParamDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidTypeErrorWrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + }, + "DependeeDetails": { + "type": "object", + "properties": { + "dependee": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "dependee", + "api_name", + "json_path" + ] + }, + "DependeeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DependeeDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MandatoryErrorWrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/DependeeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + }, + "InvalidValueError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidValueErrorWrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + }, + "LimitError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int32" + }, + "limit_due_to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MandatoryDetails" + } + } + }, + "required": [ + "limit", + "limit_due_to" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "LimitErrorWrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/LimitError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + }, + "MaxLengthWrapper": { + "type": "object", + "properties": { + "fields": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MaxLengthError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "fields" + ] + } + }, + "responses": { + "Fields": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "RootResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/InvalidValueError" + } + ] + } + } + } + }, + "RRootResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/InvalidValueError" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeErrorWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueErrorWrapper" + }, + { + "$ref": "#/components/schemas/LimitErrorWrapper" + }, + { + "$ref": "#/components/schemas/MaxLengthWrapper" + } + ] + } + } + } + } + }, + "parameters": { + "layout_id": { + "name": "layout_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "component": { + "name": "component", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "data_type": { + "name": "data_type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "unused", + "used" + ] + } + }, + "feature_name": { + "name": "feature_name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "X-ZCSRF-TOKEN": { + "name": "X-ZCSRF-TOKEN", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + "X-ZOHO-SERVICE": { + "name": "X-ZOHO-SERVICE", + "in": "header", + "required": false, + "schema": { + "type": "string", + "enum": [ + "crmmobile" + ] + } + }, + "field": { + "name": "field", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/files.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/files.json new file mode 100644 index 0000000..8c8630c --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/files.json @@ -0,0 +1,375 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "files", + "description": "Uploads a File", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/files": { + "post": { + "operationId": "Upload Files", + "parameters": [ + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + }, + { + "$ref": "#/components/parameters/type" + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + }, + { + "$ref": "#/components/schemas/Failure_In_Attachment" + }, + { + "$ref": "#/components/schemas/Virus_Detected" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Size_Exceeds" + } + ] + } + } + } + }, + "403": { + "description": "" + } + } + }, + "get": { + "operationId": "Get File", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/x-download": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + }, + { + "$ref": "#/components/schemas/Failure_In_Attachment" + }, + { + "$ref": "#/components/schemas/Virus_Detected" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Size_Exceeds" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.files.CREATE" + ] + } + ], + "components": { + "schemas": { + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + }, + "required": [ + "file" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "file" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Invalid_Module_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Failure_In_Attachment": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "failure_in_attachment_handling" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Virus_Detected": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "VIRUS_DETECTED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Invalid_Data": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Size_Exceeds": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "FILE_SIZE_MORE_THAN_ALLOWED_SIZE" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "parameters": { + "X-ZOHO-SERVICE": { + "name": "X-ZOHO-SERVICE", + "in": "header", + "required": false, + "schema": { + "type": "string", + "enum": [ + "crmmobile" + ] + } + }, + "id": { + "name": "id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/find_and_merge.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/find_and_merge.json new file mode 100644 index 0000000..7f1ffcc --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/find_and_merge.json @@ -0,0 +1,670 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "find_and_merge", + "description": "Find And Merge", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{masterrecordid}/actions/merge": { + "get": { + "operationId": "Get Record Merge", + "parameters": [ + { + "$ref": "#/components/parameters/job_id" + }, + { + "$ref": "#/components/parameters/masterrecordid" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Merge_Response" + } + } + }, + "post": { + "operationId": "Merge Records", + "parameters": [ + { + "$ref": "#/components/parameters/masterrecordid" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "merge": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found_Exception" + }, + { + "$ref": "#/components/schemas/Not_Allowed_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Duplicate_Data_Exception" + }, + { + "$ref": "#/components/schemas/Dependent_Field_Missing_Exception" + }, + { + "$ref": "#/components/schemas/Limit_Exceeded_Exception" + }, + { + "$ref": "#/components/schemas/Filter_Criteria_Not_Satisfied" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found_Exception" + }, + { + "$ref": "#/components/schemas/Not_Allowed_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Duplicate_Data_Exception" + }, + { + "$ref": "#/components/schemas/Dependent_Field_Missing_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.{module_API_name}.ALL" + ] + } + ], + "components": { + "schemas": { + "merge": { + "type": "object", + "properties": { + "job_id": { + "type": "string" + }, + "status": { + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/Merge_Data" + }, + "type": "array" + }, + "master_record_fields": { + "items": { + "$ref": "#/components/schemas/Master_Record_Fields" + }, + "type": "array" + } + }, + "required": [ + "data", + "master_record_fields" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "merge": { + "items": { + "$ref": "#/components/schemas/merge" + }, + "type": "array" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "merge": { + "items": { + "$ref": "#/components/schemas/merge" + }, + "type": "array" + } + }, + "required": [ + "merge" + ] + }, + "Master_Record_Fields": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "_data": { + "items": { + "$ref": "#/components/schemas/Image_Data" + }, + "type": "array" + } + }, + "required": [ + "api_name", + "_data" + ] + }, + "Merge_Data": { + "type": "object", + "properties": { + "_fields": { + "items": { + "$ref": "#/components/schemas/Data_Fields" + }, + "type": "array" + }, + "id": { + "type": "string" + } + } + }, + "Data_Fields": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "_data": { + "items": { + "$ref": "#/components/schemas/Image_Data" + }, + "type": "array" + } + } + }, + "Image_Data": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "merge": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS", + "SCHEDULED" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "job_id": { + "type": "string" + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + } + }, + "Mandatory_Not_Found_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "details": { + "$ref": "#/components/schemas/Mandatory_Details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Filter_Criteria_Not_Satisfied": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "FILTER_CRITERIA_NOT_SATISFIED" + ] + }, + "details": { + "$ref": "#/components/schemas/Mandatory_Details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Not_Allowed_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_Index" + }, + { + "$ref": "#/components/schemas/Mandatory_Details" + }, + { + "$ref": "#/components/schemas/Index_Api_Name" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Index_Api_Name": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "Invalid_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_Index" + }, + { + "$ref": "#/components/schemas/Maximum_Length_Details" + }, + { + "$ref": "#/components/schemas/Minimum_Length_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_Details" + }, + { + "$ref": "#/components/schemas/Mandatory_Details" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Duplicate_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/Mandatory_Details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Dependent_Field_Missing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Dependent_Details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Invalid_Module_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "details": { + "$ref": "#/components/schemas/Resource_Path_Index" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Limit_Exceeded_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "details": { + "$ref": "#/components/schemas/Maximum_Length_Details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Dependent_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "dependee": { + "$ref": "#/components/schemas/Mandatory_Details" + } + } + }, + "Expected_Data_Type_Details": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Maximum_Length_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + } + }, + "Minimum_Length_Exception": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "minimum_length": { + "type": "string" + } + } + }, + "Mandatory_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Resource_Path_Index": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + } + }, + "responses": { + "Merge_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "job_id": { + "name": "job_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "masterrecordid": { + "name": "masterrecordid", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fiscal_year.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fiscal_year.json new file mode 100644 index 0000000..ce702b7 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/fiscal_year.json @@ -0,0 +1,362 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "fiscal_year", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/fiscal_year": { + "get": { + "operationId": "Get Fiscal Year", + "responses": { + "200": { + "$ref": "#/components/responses/Get_Response" + }, + "400": { + "$ref": "#/components/responses/RRootMandatoryResponse" + } + } + }, + "put": { + "operationId": "Update Fiscal Year", + "requestBody": { + "$ref": "#/components/requestBodies/RequestBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/RootMandatoryResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "settings.fiscal_year.UPDATE", + "settings.fiscal_year.READ" + ] + } + ], + "components": { + "schemas": { + "year": { + "type": "object", + "properties": { + "start_month": { + "type": "string", + "enum": [ + "June", + "October", + "December", + "May", + "September", + "March", + "July", + "January", + "February", + "April", + "August", + "November" + ] + }, + "display_based_on": { + "type": "string", + "enum": [ + "start_month", + "end_month" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "start_month", + "display_based_on" + ] + }, + "FiscalYear": { + "type": "object", + "properties": { + "fiscal_year": { + "$ref": "#/components/schemas/year" + } + }, + "required": [ + "fiscal_year" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "fiscal_year": { + "$ref": "#/components/schemas/year" + } + } + }, + "Success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "The fiscal year configuration has been updated successfully" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "fiscal_year": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success" + } + ] + } + }, + "required": [ + "fiscal_year" + ] + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "allowed_values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "api_name", + "json_path", + "allowed_values" + ] + }, + "InvalidData": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "Please give a valid value", + "Please give a valid month" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidDataWrapper": { + "type": "object", + "properties": { + "fiscal_year": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidData" + } + ] + } + }, + "required": [ + "fiscal_year" + ] + } + }, + "responses": { + "Get_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "RootMandatoryResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + } + } + } + }, + "RRootMandatoryResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + } + } + } + }, + "InvalidDataResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidDataWrapper" + } + ] + } + } + } + } + }, + "requestBodies": { + "RequestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FiscalYear" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/from_addresses.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/from_addresses.json new file mode 100644 index 0000000..1688adf --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/from_addresses.json @@ -0,0 +1,154 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "from_addresses", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/emails/actions/from_addresses": { + "get": { + "operationId": "Get From Addresses", + "parameters": [ + { + "$ref": "#/components/parameters/user_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/AddressResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.emails.READ" + ] + } + ], + "components": { + "schemas": { + "address": { + "type": "object", + "properties": { + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]zoho[.]com" + }, + "type": { + "type": "string" + }, + "id": { + "type": "string" + }, + "user_name": { + "type": "string" + }, + "default": { + "type": "boolean" + } + }, + "required": [ + "email", + "type", + "id", + "user_name", + "default" + ] + }, + "AddressWrapper": { + "type": "object", + "properties": { + "from_addresses": { + "items": { + "$ref": "#/components/schemas/address" + }, + "type": "array" + } + }, + "required": [ + "from_addresses" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "responses": { + "AddressResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/AddressWrapper" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + }, + "parameters": { + "user_id": { + "name": "user_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/global_picklists.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/global_picklists.json new file mode 100644 index 0000000..55d1b92 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/global_picklists.json @@ -0,0 +1,1093 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "global_picklists", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/global_picklists": { + "get": { + "operationId": "Get Global Picklists", + "parameters": [ + { + "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/include_inner_details" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/GlobalPicklists" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Global Picklist", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "patch": { + "operationId": "Update Global Picklists", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Global Picklists", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/global_picklists/{id}": { + "get": { + "operationId": "Get Global Picklist", + "parameters": [ + { + "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/include_inner_details" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/GlobalPicklists" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "patch": { + "operationId": "Update Global Picklist", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Global Picklist", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/global_picklists/{id}/actions/replace_picklist_values": { + "post": { + "operationId": "replace picklist values", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/ReplaceBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/ReplaceSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ReplaceErrorResponse" + } + } + } + }, + "/crm/v8/settings/global_picklists/{id}/actions/replaced_values": { + "get": { + "operationId": "Get Replace Values", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ReplacedValues" + }, + "400": { + "$ref": "#/components/responses/ReplacedValuesError" + } + } + } + }, + "/crm/v8/settings/global_picklists/{id}/actions/associations": { + "get": { + "operationId": "Get Associations", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/include_inner_details" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Associations" + }, + "400": { + "$ref": "#/components/responses/AssociationsError" + } + } + } + }, + "/crm/v8/settings/global_picklists/{id}/actions/pick_list_values_associations": { + "get": { + "operationId": "Get Pick list value Associations", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/picklist_value_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/PVAssociations" + }, + "400": { + "$ref": "#/components/responses/PVAssociationsError" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.global_picklist.ALL" + ] + } + ], + "components": { + "schemas": { + "pick_list_values": { + "type": "object", + "properties": { + "actual_value": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unused", + "used" + ] + }, + "id": { + "type": "string", + "nullable": true + }, + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "display_value": { + "type": "string" + } + }, + "required": [ + "actual_value", + "type", + "id", + "sequence_number", + "display_value" + ] + }, + "picklist": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "actual_label": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "presence": { + "type": "boolean" + }, + "pick_list_values_sorted_lexically": { + "type": "boolean", + "nullable": true + }, + "pick_list_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/pick_list_values" + } + } + }, + "required": [ + "display_label", + "created_time", + "modified_time", + "id", + "api_name", + "actual_label", + "description", + "modified_by", + "created_by", + "presence", + "pick_list_values_sorted_lexically", + "pick_list_values" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "global_picklists": { + "items": { + "$ref": "#/components/schemas/picklist" + }, + "type": "array" + } + }, + "required": [ + "global_picklists" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "global_picklists": { + "items": { + "$ref": "#/components/schemas/picklist" + }, + "type": "array" + } + }, + "required": [ + "global_picklists" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "global_picklists": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "global_picklists" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "global_picklists": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "global_picklists" + ] + }, + "InvalidValueWrapper": { + "type": "object", + "properties": { + "global_picklists": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "global_picklists" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "global_picklists": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "global_picklists" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "replace_picklist_value": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "display_value": { + "type": "string" + } + }, + "required": [ + "display_value" + ] + } + }, + "responses": { + "GlobalPicklists": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "ReplaceSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "replace_picklist_values": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SCHEDULED" + ] + }, + "details": { + "type": "object", + "properties": { + "job_id": { + "type": "string" + } + }, + "required": [ + "job_id" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + } + }, + "required": [ + "replace_picklist_values" + ] + } + ] + } + } + } + }, + "ReplaceErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "replace_picklist_values": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "replace_picklist_values" + ] + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "ReplacedValues": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "replaced_values": { + "type": "array", + "items": { + "type": "object", + "properties": { + "display_value": { + "type": "string" + }, + "actual_value": { + "type": "string" + } + }, + "required": [ + "display_value", + "actual_value" + ] + } + } + }, + "required": [ + "replaced_values" + ] + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "ReplacedValuesError": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + } + }, + "Associations": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "associations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "module": { + "type": "object", + "properties": { + "plural_label": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "plural_label", + "api_name", + "id" + ] + }, + "layouts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "required": [ + "name", + "id", + "status" + ] + } + } + }, + "required": [ + "field", + "module", + "layouts" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + } + }, + "required": [ + "associations", + "info" + ] + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "AssociationsError": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + } + }, + "PVAssociations": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "pick_list_values_associations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "details": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "type": "array" + } + } + }, + "required": [ + "id", + "name", + "details" + ] + } + } + }, + "required": [ + "type", + "resources" + ] + } + }, + "required": [ + "pick_list_values_associations" + ] + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "PVAssociationsError": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "picklist_value_id": { + "name": "picklist_value_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include_inner_details": { + "name": "include_inner_details", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "ReplaceBody": { + "content": { + "application/json": {} + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/holidays.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/holidays.json new file mode 100644 index 0000000..6c5052b --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/holidays.json @@ -0,0 +1,1068 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "holidays", + "description": "holidays", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/holidays": { + "get": { + "operationId": "Get Holidays", + "parameters": [ + { + "$ref": "#/components/parameters/year" + }, + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/shift_id" + }, + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Pattern_Not_Matched" + } + ] + } + } + } + } + } + }, + "post": { + "operationId": "Create Holidays", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Create_BusinessHoliday" + }, + { + "$ref": "#/components/schemas/Create_ShiftHoliday" + } + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "holidays": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/DUPLICATE_DATA" + }, + { + "$ref": "#/components/schemas/DEPENDENT_FIELD_MISSING" + } + ] + }, + "type": "array" + } + }, + "required": [ + "holidays" + ] + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Holidays", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Update_Holidays" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "holidays": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/DUPLICATE_DATA" + }, + { + "$ref": "#/components/schemas/DEPENDENT_FIELD_MISSING" + } + ] + }, + "type": "array" + } + }, + "required": [ + "holidays" + ] + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/holidays/{holiday_id}": { + "put": { + "operationId": "Update Holiday", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + }, + { + "$ref": "#/components/parameters/holiday_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Update_Holidays" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "holidays": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/DUPLICATE_DATA" + }, + { + "$ref": "#/components/schemas/DEPENDENT_FIELD_MISSING" + } + ] + }, + "type": "array" + } + }, + "required": [ + "holidays" + ] + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Holiday", + "parameters": [ + { + "$ref": "#/components/parameters/holiday_id" + }, + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + } + } + }, + "delete": { + "operationId": "Delete Holiday", + "parameters": [ + { + "$ref": "#/components/parameters/holiday_id" + }, + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "holidays": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Holiday_Id" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.recycle_bin.UPDATE", + "ZohoCRM.settings.recycle_bin.DELETE", + "ZohoCRM.settings.recycle_bin.READ" + ] + } + ], + "components": { + "schemas": { + "Holiday": { + "type": "object", + "properties": { + "year": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + }, + "type": { + "type": "string" + }, + "id": { + "type": "string" + }, + "shift_hour": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + } + }, + "required": [ + "year", + "name", + "date", + "type", + "id", + "shift_hour" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "holidays": { + "items": { + "$ref": "#/components/schemas/Holiday" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "holidays", + "info" + ] + }, + "Info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + } + }, + "Create_BusinessHoliday": { + "type": "object", + "properties": { + "holidays": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 80 + }, + "date": { + "type": "string", + "format": "date" + }, + "type": { + "type": "string" + } + } + }, + "required": [ + "name", + "date", + "type" + ] + } + }, + "required": [ + "holidays" + ] + }, + "Create_ShiftHoliday": { + "type": "object", + "properties": { + "holidays": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 80 + }, + "date": { + "type": "string", + "format": "date" + }, + "type": { + "type": "string", + "enum": [ + "shift_holiday" + ] + }, + "shift_hour": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + } + } + }, + "required": [ + "name", + "date", + "type", + "shift_hour" + ] + } + }, + "required": [ + "holidays" + ] + }, + "Update_Holidays": { + "type": "object", + "properties": { + "holidays": { + "items": { + "$ref": "#/components/schemas/Holiday" + }, + "type": "array" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "Holidays updated successfully", + "Holidays created successfully", + "Holidays deleted successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "holidays": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "holidays" + ] + }, + "Invalid_Holiday_Id": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "Invalid ID" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "resource_path_index" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Pattern_Not_Matched": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "PATTERN_NOT_MATCHED" + ] + }, + "message": { + "type": "string", + "enum": [ + "Please check whether the input values are correct" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "MANDATORY_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "$ref": "#/components/schemas/DETAIL_1" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "DETAIL_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "DETAIL_2": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "DETAIL_3": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + }, + "DETAIL_4": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type", + "regex" + ] + }, + "DETAIL_5": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "regex": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "regex" + ] + }, + "DETAIL_6": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "INVALID_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/DETAIL_1" + }, + { + "$ref": "#/components/schemas/DETAIL_2" + }, + { + "$ref": "#/components/schemas/DETAIL_3" + }, + { + "$ref": "#/components/schemas/DETAIL_4" + }, + { + "$ref": "#/components/schemas/DETAIL_5" + }, + { + "$ref": "#/components/schemas/DETAIL_6" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "DUPLICATE_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "duplicate data" + ] + }, + "details": { + "$ref": "#/components/schemas/DETAIL_1" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "DEPENDENT_FIELD_MISSING": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "message": { + "type": "string", + "enum": [ + "Shift id is required for shift holidays" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "dependee": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "api_name", + "json_path", + "dependee" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "year": { + "name": "year", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "type": { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "business_holiday", + "shift_holiday" + ] + } + }, + "shift_id": { + "name": "shift_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "holiday_id": { + "name": "holiday_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "X-CRM-ORG": { + "name": "X-CRM-ORG", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_convert.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_convert.json new file mode 100644 index 0000000..787056f --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_convert.json @@ -0,0 +1,654 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "inventory_convert", + "description": "Inventory Convert Record", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/{id}/actions/convert": { + "post": { + "operationId": "Convert Inventory", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found_Exception" + }, + { + "$ref": "#/components/schemas/ID_Already_Converted_API_Exception" + }, + { + "$ref": "#/components/schemas/No_Permission_Exception" + }, + { + "$ref": "#/components/schemas/Not_Allowed_Exception" + }, + { + "$ref": "#/components/schemas/Ambiguidy_Processing_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Fields_Missing_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/ID_Already_Converted_API_Exception" + }, + { + "$ref": "#/components/schemas/No_Permission_Exception" + }, + { + "$ref": "#/components/schemas/Not_Approved_Exception" + }, + { + "$ref": "#/components/schemas/Not_Reviewed_Exception" + } + ] + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/No_Permission_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/No_Permission_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL", + "ZohoCRM.files.CREATE", + "ZohoFiles.files.CREATE" + ] + } + ], + "components": { + "schemas": { + "Inventory_Converter": { + "type": "object", + "properties": { + "convert_to": { + "type": "array", + "items": { + "type": "object", + "properties": { + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "carry_over_tags": { + "type": "boolean" + } + } + }, + "required": [ + "module" + ] + } + }, + "required": [ + "convert_to" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "The record has been converted successfully" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "type": "object", + "properties": { + "Sales_Orders": { + "$ref": "#/components/schemas/Id_Name_Details" + }, + "Invoices": { + "$ref": "#/components/schemas/Id_Name_Details" + } + } + } + } + }, + "Invalid_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + { + "$ref": "#/components/schemas/Resource_Path_Index_Detail" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_Details" + }, + { + "$ref": "#/components/schemas/Maximum_Length_Details" + }, + { + "$ref": "#/components/schemas/Supproted_Values_Details" + } + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Mandatory_Not_Found_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "details": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "ID_Already_Converted_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "ID_ALREADY_CONVERTED" + ] + }, + "details": { + "$ref": "#/components/schemas/Resource_Path_Index_Detail" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "No_Permission_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + { + "$ref": "#/components/schemas/Resource_Path_Index_Detail" + }, + { + "$ref": "#/components/schemas/Permission_Details" + } + ] + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Ambiguidy_Processing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "AMBIGUITY_DURING_PROCESSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Ambiguidy_Details" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Expected_Fields_Missing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Expected_Fields_Details" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Not_Allowed_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "details": { + "$ref": "#/components/schemas/Not_Allowed_Details" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Not_Approved_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_APPROVED" + ] + }, + "details": { + "$ref": "#/components/schemas/Resource_Path_Index_Detail" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Not_Reviewed_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_REVIEWED" + ] + }, + "details": { + "$ref": "#/components/schemas/Resource_Path_Index_Detail" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Resource_Path_Index_Detail": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "Apiname_Jsonpath_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Id_Name_Details": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Expected_Data_Type_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Supproted_Values_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Maximum_Length_Details": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Permission_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "json_path": { + "type": "string" + } + } + }, + "Ambiguidy_Details": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + }, + "Expected_Fields_Details": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + }, + "Not_Allowed_Details": { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + }, + "parameters": { + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "Quotes", + "Sales_Orders" + ] + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "74872568723489" + ] + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_mass_convert.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_mass_convert.json new file mode 100644 index 0000000..d8ebe7c --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_mass_convert.json @@ -0,0 +1,1164 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "inventory_mass_convert", + "description": "Inventory Convert Record", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/actions/mass_convert": { + "post": { + "operationId": "Mass Inventory Convert", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "202": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.mass_convert.Quotes.CREATE", + " ZohoCRM.mass_convert.SalesOrders.CREATE" + ] + } + ] + }, + "get": { + "operationId": "Get Scheduled Jobs Details", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Status" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.mass_convert.Quotes.READ", + "ZohoCRM.mass_convert.SalesOrders.READ" + ] + } + ] + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL", + "ZohoCRM.files.CREATE", + "ZohoFiles.files.CREATE" + ] + } + ], + "components": { + "schemas": { + "Body_Wrapper": { + "type": "object", + "properties": { + "convert_to": { + "type": "array", + "items": { + "type": "object", + "properties": { + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "carry_over_tags": { + "type": "boolean" + } + } + }, + "required": [ + "module", + "carry_over_tags" + ] + }, + "assign_to": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "related_modules": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + } + } + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "convert_to", + "ids" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SCHEDULED" + ] + }, + "message": { + "type": "string", + "enum": [ + "Mass Convert scheduled successfully" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "type": "object", + "properties": { + "job_id": { + "type": "string" + } + } + } + } + }, + "Required_Param_Missing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Invalid_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + }, + { + "type": "object" + } + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Mandatory_Not_Found_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Limit_Exceeded_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "details": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int32", + "enum": [ + 50 + ] + }, + "limit_due_to": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "ID_Already_Converted_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "ID_ALREADY_CONVERTED" + ] + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "No_Permission_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "details": { + "oneOf": [ + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + { + "type": "object" + }, + { + "type": "object" + } + ] + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Ambiguidy_Processing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "AMBIGUITY_DURING_PROCESSING" + ] + }, + "details": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Expected_Fields_Missing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + }, + "message": { + "type": "string", + "enum": [ + "Specify atleast one field" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Not_Approved_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_APPROVED" + ] + }, + "details": { + "$ref": "#/components/schemas/Resource_Path_Index_Detail" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Not_Reviewed_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_REVIEWED" + ] + }, + "details": { + "$ref": "#/components/schemas/Resource_Path_Index_Detail" + }, + "message": { + "type": "string", + "enum": [ + "id already converted" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Resource_Path_Index_Detail": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "Param_Name_Detail": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + "Apiname_Jsonpath_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Expected_Data_Type_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Limits_Details": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int32", + "enum": [ + 50 + ] + }, + "limit_due_to": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + }, + "Supproted_Values_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Maximum_Length_Details": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Permission_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "json_path": { + "type": "string" + } + } + }, + "Ambiguidy_Details": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + }, + "Expected_Fields_Details": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/Apiname_Jsonpath_Details" + }, + "type": "array" + } + } + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/ID_Already_Converted_API_Exception" + }, + { + "$ref": "#/components/schemas/No_Permission_Exception" + }, + { + "$ref": "#/components/schemas/Not_Approved_Exception" + }, + { + "$ref": "#/components/schemas/Not_Reviewed_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found_Exception" + }, + { + "$ref": "#/components/schemas/Limit_Exceeded_Exception" + }, + { + "$ref": "#/components/schemas/Ambiguidy_Processing_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Fields_Missing_Exception" + } + ] + } + } + } + }, + "Status": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "total_count": { + "type": "integer", + "format": "int32" + }, + "converted_count": { + "type": "integer", + "format": "int32" + }, + "not_converted_count": { + "type": "integer", + "format": "int32" + }, + "failed_count": { + "type": "integer", + "format": "int32" + }, + "status": { + "type": "string" + } + } + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Required_Param_Missing_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + } + ] + } + } + } + } + }, + "parameters": { + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "job_id": { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_templates.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_templates.json new file mode 100644 index 0000000..fe11040 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/inventory_templates.json @@ -0,0 +1,385 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "inventory_templates", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/inventory_templates": { + "get": { + "operationId": "Get Inventory Templates", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/category" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Templates" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/inventory_templates/{template}": { + "get": { + "operationId": "Get Inventory Template", + "parameters": [ + { + "$ref": "#/components/parameters/template" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Templates" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.templates.inventory.READ" + ] + } + ], + "components": { + "schemas": { + "folder": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "ModuleMap": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "User": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "Inventory_Templates": { + "type": "object", + "properties": { + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "last_usage_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "folder": { + "$ref": "#/components/schemas/folder" + }, + "module": { + "$ref": "#/components/schemas/ModuleMap" + }, + "created_by": { + "$ref": "#/components/schemas/User" + }, + "modified_by": { + "$ref": "#/components/schemas/User" + }, + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "editor_mode": { + "type": "string", + "nullable": true + }, + "category": { + "type": "string", + "nullable": true + }, + "favorite": { + "type": "boolean", + "nullable": true + }, + "content": { + "type": "string", + "nullable": true + }, + "active": { + "type": "boolean", + "nullable": true + }, + "mail_content": { + "type": "string", + "nullable": true + } + }, + "required": [ + "created_time", + "modified_time", + "last_usage_time", + "folder", + "module", + "created_by", + "modified_by", + "name", + "id", + "editor_mode", + "category", + "favorite", + "content", + "active", + "mail_content" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "page", + "count", + "more_records" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "inventory_templates": { + "items": { + "$ref": "#/components/schemas/Inventory_Templates" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "inventory_templates", + "info" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + } + }, + "responses": { + "Templates": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "category": { + "name": "category", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "template": { + "name": "template", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/layouts.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/layouts.json new file mode 100644 index 0000000..cf2bd36 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/layouts.json @@ -0,0 +1,1432 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "layouts", + "description": "Layouts", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/layouts": { + "get": { + "operationId": "Get Layouts", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Layouts" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "patch": { + "operationId": "Update Custom Layouts", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/layouts/{id}": { + "get": { + "operationId": "Get Layout", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Layouts" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "patch": { + "operationId": "Update Custom Layout", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Custom Layout", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/transfer_to" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/layouts/{id}/actions/activate": { + "post": { + "operationId": "Activate Custom Layout", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Deactivate Custom Layout", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/transfer_to" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.layouts.all", + "ZohoCRM.settings.layouts.read" + ] + } + ], + "components": { + "schemas": { + "Minified_Layout": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "properties": { + "type": "object", + "properties": { + "reorder_rows": { + "type": "boolean", + "nullable": true + }, + "maximum_rows": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "tooltip": { + "$ref": "#/components/schemas/tooltip" + } + }, + "required": [ + "reorder_rows", + "maximum_rows", + "tooltip" + ] + }, + "tooltip": { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": [ + "Info Icon" + ] + }, + "value": { + "type": "string" + } + } + }, + "actions_allowed": { + "type": "object", + "properties": { + "edit": { + "type": "boolean", + "nullable": true + }, + "rename": { + "type": "boolean", + "nullable": true + }, + "clone": { + "type": "boolean", + "nullable": true + }, + "downgrade": { + "type": "boolean", + "nullable": true + }, + "delete": { + "type": "boolean", + "nullable": true + }, + "deactivate": { + "type": "boolean", + "nullable": true + }, + "set_layout_permissions": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "edit", + "rename", + "clone", + "downgrade", + "delete", + "deactivate", + "set_layout_permissions" + ] + }, + "subform": { + "type": "object", + "properties": { + "module": { + "type": "string" + }, + "id": { + "type": "string" + }, + "layout": { + "$ref": "#/components/schemas/Minified_Layout" + } + }, + "required": [ + "layout" + ] + }, + "fields": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "nullable": true + }, + "validation_rule": { + "type": "object", + "nullable": true + }, + "default_value": { + "type": "object", + "nullable": true + }, + "sequence_number": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "section_id": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "blueprint_supported": { + "type": "boolean", + "nullable": true + }, + "json_type": { + "type": "string", + "nullable": true + }, + "length": { + "type": "integer", + "format": "int32" + }, + "decimal_place": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "multi_module_lookup": { + "type": "object", + "nullable": true + }, + "sharing_properties": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/sharing_properties" + }, + "currency": { + "type": "object", + "nullable": true + }, + "file_upolad_optionlist": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/file_upolad_option" + } + }, + "lookup": { + "type": "object", + "nullable": true + }, + "subform": { + "type": "object", + "nullable": true + }, + "formula": { + "type": "object", + "nullable": true + }, + "multiselectlookup": { + "type": "object", + "nullable": true + }, + "multiuserlookup": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/multiselectlookup" + }, + "pick_list_values": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/pick_list_values" + } + }, + "allowed_modules": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + } + }, + "hipaa_compliance_enabled": { + "type": "boolean", + "nullable": true + }, + "hipaa_compliance": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/hipaa_compliance" + }, + "static_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/static_values" + } + }, + "static_field": { + "type": "boolean", + "nullable": true + }, + "layout_associations": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/layout_association" + }, + "type": "array" + }, + "_delete": { + "$ref": "#/components/schemas/delete1" + }, + "associated_module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "data_type": { + "type": "string" + }, + "operation_type": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/operation_type" + }, + "system_mandatory": { + "type": "boolean" + }, + "webhook": { + "type": "boolean" + }, + "virtual_field": { + "type": "boolean" + }, + "field_read_only": { + "type": "boolean" + }, + "customizable_properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read_only": { + "type": "boolean" + }, + "custom_field": { + "type": "boolean" + }, + "businesscard_supported": { + "type": "boolean" + }, + "filterable": { + "type": "boolean" + }, + "visible": { + "type": "boolean" + }, + "available_in_user_layout": { + "type": "boolean" + }, + "display_field": { + "type": "boolean" + }, + "pick_list_values_sorted_lexically": { + "type": "boolean" + }, + "sortable": { + "type": "boolean" + }, + "separator": { + "type": "boolean" + }, + "searchable": { + "type": "boolean" + }, + "enable_colour_code": { + "type": "boolean", + "default": true + }, + "mass_update": { + "type": "boolean" + }, + "created_source": { + "type": "string" + }, + "type": { + "type": "string" + }, + "display_label": { + "type": "string" + }, + "column_name": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "display_type": { + "type": "integer", + "format": "int32" + }, + "ui_type": { + "type": "integer", + "format": "int32" + }, + "colour_code_enabled_by_system": { + "type": "boolean", + "nullable": true + }, + "quick_sequence_number": { + "type": "string" + }, + "email_parser": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/email_parser" + }, + "rollup_summary": { + "type": "object", + "nullable": true + }, + "refer_from_field": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/refer_from_field" + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "show_type": { + "type": "integer", + "format": "int32" + }, + "category": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string" + }, + "profiles": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/profile" + } + }, + "view_type": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/view_type" + }, + "unique": { + "type": "object", + "nullable": true + }, + "sub_module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "external": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/external" + }, + "private": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/private" + }, + "convert_mapping": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/Convert_Mapping" + }, + "autonumber": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/auto_number" + }, + "auto_number": { + "type": "object", + "nullable": true + }, + "crypt": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/crypt" + }, + "tooltip": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/tooltip" + }, + "history_tracking": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/history_tracking" + }, + "association_details": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/association_details" + }, + "additional_column": { + "type": "string", + "nullable": true + }, + "field_label": { + "type": "string" + }, + "common.picklist": { + "type": "object", + "nullable": true + }, + "_update_existing_records": { + "type": "boolean" + }, + "number_separator": { + "type": "boolean" + }, + "textarea": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/textarea" + } + }, + "required": [ + "required", + "validation_rule", + "default_value", + "sequence_number", + "section_id", + "blueprint_supported", + "json_type", + "length", + "decimal_place", + "multi_module_lookup", + "sharing_properties", + "currency", + "file_upolad_optionlist", + "lookup", + "subform", + "formula", + "multiselectlookup", + "multiuserlookup", + "pick_list_values", + "allowed_modules", + "hipaa_compliance_enabled", + "hipaa_compliance", + "static_values", + "static_field", + "layout_associations", + "_delete", + "associated_module", + "data_type", + "operation_type", + "system_mandatory", + "webhook", + "virtual_field", + "field_read_only", + "customizable_properties", + "read_only", + "custom_field", + "businesscard_supported", + "filterable", + "visible", + "available_in_user_layout", + "display_field", + "pick_list_values_sorted_lexically", + "sortable", + "separator", + "searchable", + "enable_colour_code", + "mass_update", + "created_source", + "type", + "display_label", + "column_name", + "api_name", + "display_type", + "ui_type", + "colour_code_enabled_by_system", + "quick_sequence_number", + "email_parser", + "rollup_summary", + "refer_from_field", + "created_time", + "modified_time", + "show_type", + "category", + "id", + "profiles", + "view_type", + "unique", + "sub_module", + "external", + "convert_mapping", + "autonumber", + "auto_number", + "crypt", + "tooltip", + "history_tracking", + "association_details", + "additional_column", + "field_label", + "common.picklist", + "_update_existing_records", + "number_separator", + "textarea" + ] + }, + "static_values": { + "type": "object", + "properties": { + "sequence_number": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "value": { + "type": "string", + "nullable": true + } + }, + "required": [ + "sequence_number", + "id", + "value" + ] + }, + "sections": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "sequence_number": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "isSubformSection": { + "type": "boolean", + "nullable": true + }, + "tab_traversal": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "column_count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "generated_type": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "fields": { + "items": { + "$ref": "#/components/schemas/fields" + }, + "type": "array" + }, + "properties": { + "$ref": "#/components/schemas/properties" + }, + "_delete": { + "$ref": "#/components/schemas/delete1" + } + }, + "required": [ + "display_label", + "sequence_number", + "isSubformSection", + "tab_traversal", + "api_name", + "column_count", + "name", + "generated_type", + "id", + "type", + "fields", + "properties", + "_delete" + ] + }, + "delete1": { + "type": "object", + "properties": { + "permanent": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "permanent" + ] + }, + "default_view": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id", + "type" + ] + }, + "default_assignment_view": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "profiles": { + "type": "object", + "properties": { + "default": { + "type": "boolean", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "_default_view": { + "$ref": "#/components/schemas/default_view" + }, + "_default_assignment_view": { + "$ref": "#/components/schemas/default_assignment_view" + } + }, + "required": [ + "default", + "name", + "id", + "_default_view" + ] + }, + "Deal_Layout_Mapping": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "field_label": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "required": { + "type": "boolean", + "nullable": true + } + } + }, + "required": [ + "api_name", + "field_label", + "id", + "required" + ] + }, + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "fields", + "name", + "id" + ] + }, + "convert_mapping": { + "type": "object", + "properties": { + "Contacts": { + "$ref": "#/components/schemas/Minified_Layout" + }, + "Deals": { + "$ref": "#/components/schemas/Deal_Layout_Mapping" + }, + "Accounts": { + "$ref": "#/components/schemas/Minified_Layout" + }, + "Invoices": { + "$ref": "#/components/schemas/Minified_Layout" + }, + "SalesOrders": { + "$ref": "#/components/schemas/Minified_Layout" + } + }, + "required": [ + "Contacts", + "Deals", + "Accounts", + "Invoices", + "SalesOrders" + ] + }, + "layouts": { + "type": "object", + "properties": { + "display_type": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "has_more_profiles": { + "type": "boolean", + "nullable": true + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "visible": { + "type": "boolean", + "nullable": true + }, + "source": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "display_label": { + "type": "string", + "nullable": true + }, + "mode": { + "type": "string", + "nullable": true + }, + "subform_properties": { + "type": "object", + "properties": { + "pinned_column": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "pinned_column" + ] + }, + "status": { + "type": "string", + "nullable": true + }, + "show_business_card": { + "type": "boolean", + "nullable": true + }, + "generated_type": { + "type": "string", + "nullable": true + }, + "created_for": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "convert_mapping": { + "$ref": "#/components/schemas/convert_mapping" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "profiles": { + "items": { + "$ref": "#/components/schemas/profiles" + }, + "type": "array" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "sections": { + "items": { + "$ref": "#/components/schemas/sections" + }, + "type": "array" + }, + "actions_allowed": { + "$ref": "#/components/schemas/actions_allowed" + } + }, + "required": [ + "has_more_profiles", + "created_time", + "modified_time", + "visible", + "source", + "id", + "name", + "display_label", + "mode", + "subform_properties", + "status", + "show_business_card", + "generated_type", + "created_for", + "convert_mapping", + "modified_by", + "profiles", + "created_by", + "sections", + "actions_allowed" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "layouts": { + "items": { + "$ref": "#/components/schemas/layouts" + }, + "type": "array" + } + }, + "required": [ + "layouts" + ] + }, + "ParamDetails": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/ParamDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "InvalidModule" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "layouts": { + "items": { + "$ref": "#/components/schemas/layouts" + }, + "type": "array" + } + }, + "required": [ + "layouts" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "layouts": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "layouts" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "layout updated", + "layout deleted" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "NO_PERMISSION", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "REQUIRED_PARAM_MISSING", + "NOT_ALLOWED" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid oauth token", + "record not in process", + "Please check if the URL trying to access is a correct one", + "invalid transition", + "invalid data", + "The http request method type is not a valid one", + "api_name cannot be changed" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "message": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "info_message": { + "type": "string" + }, + "parent_api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "api_name", + "message", + "expected_data_type", + "info_message", + "parent_api_name", + "json_path", + "supported_values" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "responses": { + "Layouts": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "layouts": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "layouts" + ] + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "transfer_to": { + "name": "transfer_to", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "X-ZCSRF-TOKEN": { + "name": "X-ZCSRF-TOKEN", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mail_merge.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mail_merge.json new file mode 100644 index 0000000..564769e --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mail_merge.json @@ -0,0 +1,604 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "mail_merge", + "description": "mail_merge", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{id}/actions/send_mail_merge": { + "post": { + "operationId": "Send Mail Merge", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mail_Merge_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "send_mail_merge": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module}/{id}/actions/download_mail_merge": { + "post": { + "operationId": "Download Mail Merge", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Download_Mail_Merge_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "file": { + "type": "object" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module}/{id}/actions/sign_mail_merge": { + "post": { + "operationId": "Sign Mail Merge", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Sign_Mail_Merge_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Sign_Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "sign_mail_merge": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Mail_Merge_Template": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "Mail_Merge": { + "type": "object", + "properties": { + "mail_merge_template": { + "$ref": "#/components/schemas/Mail_Merge_Template" + }, + "from_address": { + "$ref": "#/components/schemas/Address" + }, + "to_address": { + "items": { + "$ref": "#/components/schemas/Address" + }, + "type": "array" + }, + "cc_email": { + "items": { + "$ref": "#/components/schemas/Address" + }, + "type": "array" + }, + "bcc_email": { + "items": { + "$ref": "#/components/schemas/Address" + }, + "type": "array" + }, + "subject": { + "type": "string" + }, + "message": { + "type": "string" + }, + "type": { + "type": "string" + }, + "attachment_name": { + "type": "string" + } + } + }, + "Mail_Merge_Wrapper": { + "type": "object", + "properties": { + "send_mail_merge": { + "items": { + "$ref": "#/components/schemas/Mail_Merge" + }, + "type": "array" + } + } + }, + "Download_Mail_Merge": { + "type": "object", + "properties": { + "mail_merge_template": { + "$ref": "#/components/schemas/Mail_Merge_Template" + }, + "output_format": { + "type": "string", + "enum": [ + "pdf", + "html", + "docx" + ] + }, + "file_name": { + "type": "string", + "maxLength": 255 + }, + "password": { + "type": "string" + } + } + }, + "Download_Mail_Merge_Wrapper": { + "type": "object", + "properties": { + "download_mail_merge": { + "items": { + "$ref": "#/components/schemas/Download_Mail_Merge" + }, + "type": "array" + } + } + }, + "Signers": { + "type": "object", + "properties": { + "recipient_name": { + "type": "string" + }, + "action_type": { + "type": "string", + "enum": [ + "approve", + "sign" + ] + }, + "recipient": { + "$ref": "#/components/schemas/Address" + } + } + }, + "Sign_Mail_Merge": { + "type": "object", + "properties": { + "mail_merge_template": { + "$ref": "#/components/schemas/Mail_Merge_Template" + }, + "sign_in_order": { + "type": "boolean" + }, + "file_name": { + "type": "string", + "maxLength": 255 + }, + "signers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Signers" + } + } + } + }, + "Sign_Mail_Merge_Wrapper": { + "type": "object", + "properties": { + "sign_mail_merge": { + "items": { + "$ref": "#/components/schemas/Sign_Mail_Merge" + }, + "type": "array" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "report_link": { + "type": "string" + } + } + } + } + }, + "Success_Wrapper": { + "type": "object", + "properties": { + "send_mail_merge": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Sign_Success_Wrapper": { + "type": "object", + "properties": { + "sign_mail_merge": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Expected_Regex": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + } + } + }, + "Supported_Values": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Error_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Invalid_Id": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "Mandatory_Not_Found": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + } + } + }, + "Invalid_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Error_Detail" + }, + { + "$ref": "#/components/schemas/Invalid_Id" + }, + { + "$ref": "#/components/schemas/Supported_Values" + }, + { + "$ref": "#/components/schemas/Expected_Regex" + } + ] + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_change_owner.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_change_owner.json new file mode 100644 index 0000000..e56946b --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_change_owner.json @@ -0,0 +1,498 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "mass_change_owner", + "description": "Mass Change Owner", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/actions/mass_change_owner": { + "post": { + "operationId": "Change Owner", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Cvid_API_Exception" + }, + { + "$ref": "#/components/schemas/Improper_Cvid_API_Exception" + }, + { + "$ref": "#/components/schemas/Improper_Cvid_API_Exception1" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Check Status", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/JobStatus" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "owner is successfully updated" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "job_id": { + "type": "string" + } + }, + "required": [ + "id", + "job_id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Cvid_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the cvid given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "cvid" + ] + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Improper_Cvid_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the cvid given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "cvid" + ] + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "expected_data_type" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Improper_Cvid_API_Exception1": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the cvid given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "cvid" + ] + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "cvid", + "Owner", + "id" + ] + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "expected_data_type" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "status": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "enum": [ + "COMPLETED", + "FAILED", + "RUNNING", + "SCHEDULED" + ] + }, + "Failed_Count": { + "type": "integer", + "format": "int32" + }, + "Not_Updated_Count": { + "type": "integer", + "format": "int32" + }, + "Updated_Count": { + "type": "integer", + "format": "int32" + }, + "Total_Count": { + "type": "integer", + "format": "int32" + } + } + }, + "wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/status" + }, + "type": "array" + } + } + }, + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "value": { + "type": "object", + "nullable": true + }, + "group_operator": { + "type": "string", + "nullable": true + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "comparator", + "field", + "value", + "group_operator", + "group" + ] + } + }, + "responses": { + "JobStatus": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Cvid_API_Exception" + }, + { + "$ref": "#/components/schemas/Improper_Cvid_API_Exception" + }, + { + "$ref": "#/components/schemas/Improper_Cvid_API_Exception1" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "job_id": { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_convert.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_convert.json new file mode 100644 index 0000000..9c36c6f --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_convert.json @@ -0,0 +1,508 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "mass_convert", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Leads/actions/mass_convert": { + "post": { + "operationId": "Mass Convert", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.mass_convert.{module_API_name}.CREATE" + ] + } + ] + }, + "get": { + "operationId": "Get Job Status", + "parameters": [ + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Status" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.mass_convert.{module_API_name}.READ" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "move_attachments_to": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + }, + "assign_to": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "related_module": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + }, + "portal_user_type": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "Deals": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "move_attachments_to": { + "$ref": "#/components/schemas/move_attachments_to" + }, + "assign_to": { + "$ref": "#/components/schemas/assign_to" + }, + "carry_over_tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/move_attachments_to" + } + }, + "related_modules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/related_module" + } + }, + "portal_user_type": { + "$ref": "#/components/schemas/portal_user_type" + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "apply_assignment_threshold": { + "type": "boolean" + } + } + }, + "details": { + "type": "object", + "properties": { + "job_id": { + "type": "string" + } + } + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SCHEDULED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + } + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "ErrorDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails1" + } + } + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "expected_fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorDetails" + } + } + } + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND", + "EXPECTED_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorDetails1" + }, + { + "$ref": "#/components/schemas/MandatoryDetails" + } + ] + } + } + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "details": { + "$ref": "#/components/schemas/InvalidTypeDetails" + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + "InvalidParamError": { + "type": "object", + "properties": { + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + } + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "details": { + "$ref": "#/components/schemas/MandatoryParamDetails" + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "status": { + "type": "object", + "properties": { + "Status": { + "type": "string" + }, + "Failed_Count": { + "type": "integer", + "format": "int32" + }, + "Not_Converted_Count": { + "type": "integer", + "format": "int32" + }, + "Total_Count": { + "type": "integer", + "format": "int32" + }, + "Converted_Count": { + "type": "integer", + "format": "int32" + } + } + }, + "wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/status" + }, + "type": "array" + } + } + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/UnsupportedVersionError" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + } + ] + } + } + } + }, + "Status": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + } + }, + "parameters": { + "job_id": { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_delete_tags.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_delete_tags.json new file mode 100644 index 0000000..d05e67e --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/mass_delete_tags.json @@ -0,0 +1,668 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "mass_delete_tags", + "description": "Mass Delete Tags - Admin tools", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/tags/actions/mass_delete": { + "post": { + "operationId": "Mass Delete Tags", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Not_Allowed" + }, + { + "$ref": "#/components/schemas/Maximum_Length" + }, + { + "$ref": "#/components/schemas/Invalid_Type" + }, + { + "$ref": "#/components/schemas/Expected_Field_Missing" + }, + { + "$ref": "#/components/schemas/Ambiguity_Error" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Status", + "parameters": [ + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Status_Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Job_Id" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.tags.all" + ] + } + ], + "components": { + "schemas": { + "Body_Wrapper": { + "type": "object", + "properties": { + "mass_delete": { + "type": "array", + "items": { + "type": "object", + "properties": { + "module": { + "$ref": "#/components/schemas/module" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/tag" + }, + "type": "array" + } + } + }, + "required": [ + "module", + "tags" + ] + } + }, + "required": [ + "mass_delete" + ] + }, + "module": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name" + ] + }, + "tag": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "COMPLETED", + "FAILED", + "QUEUED", + "RUNNING", + "SCHEDULED" + ] + }, + "details": { + "type": "object", + "properties": { + "job_id": { + "type": "object" + } + }, + "required": [ + "job_id" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Error_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Mandatory_Not_Found": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + }, + "message": { + "type": "string" + } + }, + "required": [ + "status", + "code", + "details", + "message" + ] + }, + "Not_Allowed": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + }, + "message": { + "type": "string" + } + }, + "required": [ + "status", + "code", + "details", + "message" + ] + }, + "Maximum_Length": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "status", + "details", + "message" + ] + }, + "Invalid_Type": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Detail" + }, + { + "$ref": "#/components/schemas/expected_data_type_error" + } + ] + }, + "message": { + "type": "string" + } + }, + "required": [ + "status", + "code", + "details", + "message" + ] + }, + "expected_data_type_error": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "Expected_Detail": { + "type": "object", + "properties": { + "expected_fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "expected_fields" + ] + }, + "Expected_Field_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Expected_Detail" + }, + "message": { + "type": "string" + } + }, + "required": [ + "status", + "code", + "details", + "message" + ] + }, + "Ambiguity_Detail": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "ambiguity_due_to" + ] + }, + "Ambiguity_Error": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "AMBIGUITY_DURING_PROCESSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Ambiguity_Detail" + }, + "message": { + "type": "string" + } + }, + "required": [ + "status", + "code", + "details", + "message" + ] + }, + "Mass_Delete_Details": { + "type": "object", + "properties": { + "job_id": { + "type": "string" + }, + "total_count": { + "type": "integer", + "format": "int32" + }, + "failed_count": { + "type": "integer", + "format": "int32" + }, + "deleted_count": { + "type": "integer", + "format": "int32" + }, + "status": { + "type": "string", + "enum": [ + "COMPLETED", + "FAILED", + "RUNNING", + "SCHEDULED" + ] + } + }, + "required": [ + "job_id", + "total_count", + "failed_count", + "deleted_count", + "status" + ] + }, + "Status_Response_Wrapper": { + "type": "object", + "properties": { + "mass_delete": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mass_Delete_Details" + } + ] + }, + "type": "array" + } + }, + "required": [ + "mass_delete" + ] + }, + "Invalid_Job_Id": { + "type": "object", + "properties": { + "mass_delete": { + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "type": "object", + "properties": { + "job_id": { + "type": "object" + } + }, + "required": [ + "job_id" + ] + }, + "message": { + "type": "string" + } + } + }, + "required": [ + "status", + "code", + "details", + "message" + ] + } + ] + }, + "type": "array" + } + } + }, + "Param_Name_Structure": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "Required_Param_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Param_Name_Structure" + }, + "message": { + "type": "string" + } + }, + "required": [ + "status", + "code", + "details", + "message" + ] + } + }, + "parameters": { + "job_id": { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/modules.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/modules.json new file mode 100644 index 0000000..d2413d4 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/modules.json @@ -0,0 +1,1443 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "modules", + "description": "Modules", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/modules": { + "get": { + "operationId": "Get Modules", + "parameters": [ + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + }, + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Modules" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Custom Modules", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Custom Modules", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/modules/{api_name}": { + "get": { + "operationId": "Get Module By API Name", + "parameters": [ + { + "$ref": "#/components/parameters/api_name" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Modules" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Module By API Name", + "parameters": [ + { + "$ref": "#/components/parameters/api_name" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/modules/{id}": { + "get": { + "operationId": "Get Module", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Modules" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Module", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.all", + "ZohoCRM.settings.all" + ] + } + ], + "components": { + "schemas": { + "Minified_Module": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "module_name": { + "type": "string" + }, + "module": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "sharing_properties": { + "type": "object", + "properties": { + "scheduler_status": { + "type": "string" + }, + "share_preference_enabled": { + "type": "boolean" + }, + "share_permission": { + "type": "string", + "enum": [ + "read-write", + "read-only", + "full-access" + ] + } + } + }, + "Territory": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "subordinates": { + "type": "boolean" + } + } + }, + "fields": { + "type": "object", + "properties": { + "blueprint_supported": { + "type": "boolean", + "nullable": true + }, + "json_type": { + "type": "string", + "nullable": true + }, + "length": { + "type": "integer", + "format": "int32" + }, + "decimal_place": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "multi_module_lookup": { + "type": "object", + "nullable": true + }, + "sharing_properties": { + "$ref": "#/components/schemas/sharing_properties" + }, + "currency": { + "type": "object", + "nullable": true + }, + "file_upolad_optionlist": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/file_upolad_option" + } + }, + "lookup": { + "type": "object", + "nullable": true + }, + "subform": { + "type": "object", + "nullable": true + }, + "formula": { + "type": "object", + "nullable": true + }, + "multiselectlookup": { + "type": "object", + "nullable": true + }, + "multiuserlookup": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/multiselectlookup" + }, + "pick_list_values": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/pick_list_values" + } + }, + "allowed_modules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Minified_Module" + } + }, + "hipaa_compliance_enabled": { + "type": "boolean", + "nullable": true + }, + "hipaa_compliance": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/hipaa_compliance" + }, + "associated_module": { + "$ref": "#/components/schemas/Minified_Module" + }, + "data_type": { + "type": "string" + }, + "operation_type": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/operation_type" + }, + "system_mandatory": { + "type": "boolean" + }, + "webhook": { + "type": "boolean" + }, + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "default_value": { + "type": "string" + }, + "virtual_field": { + "type": "boolean" + }, + "field_read_only": { + "type": "boolean" + }, + "customizable_properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read_only": { + "type": "boolean" + }, + "custom_field": { + "type": "boolean" + }, + "businesscard_supported": { + "type": "boolean" + }, + "filterable": { + "type": "boolean" + }, + "visible": { + "type": "boolean" + }, + "available_in_user_layout": { + "type": "boolean" + }, + "display_field": { + "type": "boolean" + }, + "pick_list_values_sorted_lexically": { + "type": "boolean" + }, + "sortable": { + "type": "boolean" + }, + "layout_associations": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/layout_association" + }, + "type": "array" + }, + "separator": { + "type": "boolean" + }, + "searchable": { + "type": "boolean" + }, + "enable_colour_code": { + "type": "boolean", + "default": true + }, + "mass_update": { + "type": "boolean" + }, + "created_source": { + "type": "string" + }, + "type": { + "type": "string" + }, + "display_label": { + "type": "string" + }, + "column_name": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "display_type": { + "type": "integer", + "format": "int32" + }, + "ui_type": { + "type": "integer", + "format": "int32" + }, + "colour_code_enabled_by_system": { + "type": "boolean", + "nullable": true + }, + "quick_sequence_number": { + "type": "string" + }, + "email_parser": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/email_parser" + }, + "rollup_summary": { + "type": "object", + "nullable": true + }, + "refer_from_field": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/refer_from_field" + }, + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "show_type": { + "type": "integer", + "format": "int32" + }, + "category": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string" + }, + "profiles": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/profile" + } + }, + "view_type": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/view_type" + }, + "unique": { + "type": "object", + "nullable": true + }, + "sub_module": { + "$ref": "#/components/schemas/Minified_Module" + }, + "external": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/external" + }, + "private": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/private" + }, + "convert_mapping": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/Convert_Mapping" + }, + "autonumber": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/auto_number" + }, + "auto_number": { + "type": "object", + "nullable": true + }, + "crypt": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/crypt" + }, + "tooltip": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/tooltip" + }, + "history_tracking": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/history_tracking" + }, + "association_details": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/association_details" + }, + "additional_column": { + "type": "string", + "nullable": true + }, + "field_label": { + "type": "string" + }, + "common.picklist": { + "type": "object", + "nullable": true + }, + "_update_existing_records": { + "type": "boolean" + }, + "number_separator": { + "type": "boolean" + }, + "textarea": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/textarea" + }, + "static_field": { + "type": "boolean" + } + }, + "required": [ + "blueprint_supported", + "json_type", + "length", + "decimal_place", + "multi_module_lookup", + "sharing_properties", + "currency", + "file_upolad_optionlist", + "lookup", + "subform", + "formula", + "multiselectlookup", + "multiuserlookup", + "pick_list_values", + "allowed_modules", + "hipaa_compliance_enabled", + "hipaa_compliance", + "associated_module", + "data_type", + "operation_type", + "system_mandatory", + "webhook", + "virtual_field", + "field_read_only", + "customizable_properties", + "read_only", + "custom_field", + "businesscard_supported", + "filterable", + "visible", + "available_in_user_layout", + "display_field", + "pick_list_values_sorted_lexically", + "sortable", + "layout_associations", + "separator", + "searchable", + "enable_colour_code", + "mass_update", + "created_source", + "type", + "display_label", + "column_name", + "api_name", + "display_type", + "ui_type", + "colour_code_enabled_by_system", + "quick_sequence_number", + "email_parser", + "rollup_summary", + "refer_from_field", + "created_time", + "modified_time", + "show_type", + "category", + "id", + "profiles", + "view_type", + "unique", + "sub_module", + "external", + "convert_mapping", + "autonumber", + "auto_number", + "crypt", + "tooltip", + "history_tracking", + "association_details", + "additional_column", + "field_label", + "common.picklist", + "_update_existing_records", + "number_separator", + "textarea", + "static_field" + ] + }, + "lookup": { + "type": "object", + "properties": { + "query_details": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/query_details" + }, + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "display_label": { + "type": "string" + }, + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "revalidate_filter_during_edit": { + "type": "boolean" + }, + "show_fields": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/show_fields" + } + } + }, + "required": [ + "query_details", + "module", + "revalidate_filter_during_edit", + "show_fields" + ] + }, + "modules": { + "type": "object", + "properties": { + "has_more_profiles": { + "type": "boolean" + }, + "sub_menu_available": { + "type": "boolean" + }, + "common.search_supported": { + "type": "boolean" + }, + "deletable": { + "type": "boolean" + }, + "description": { + "type": "string", + "nullable": true, + "maxLength": 255 + }, + "creatable": { + "type": "boolean" + }, + "recycle_bin_on_delete": { + "type": "boolean" + }, + "inventory_template_supported": { + "type": "boolean" + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "plural_label": { + "type": "string", + "nullable": true + }, + "presence_sub_menu": { + "type": "boolean" + }, + "triggers_supported": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "chart_view": { + "type": "boolean" + }, + "isBlueprintSupported": { + "type": "boolean" + }, + "visibility": { + "type": "integer", + "format": "int32" + }, + "visible": { + "type": "boolean" + }, + "convertable": { + "type": "boolean" + }, + "editable": { + "type": "boolean" + }, + "emailTemplate_support": { + "type": "boolean" + }, + "email_parser_supported": { + "type": "boolean" + }, + "filter_supported": { + "type": "boolean" + }, + "show_as_tab": { + "type": "boolean" + }, + "web_link": { + "type": "string", + "nullable": true + }, + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "singular_label": { + "type": "string", + "nullable": true + }, + "viewable": { + "type": "boolean" + }, + "api_supported": { + "type": "boolean" + }, + "api_name": { + "type": "string", + "nullable": true + }, + "quick_create": { + "type": "boolean" + }, + "generated_type": { + "type": "string", + "enum": [ + "default", + "web", + "linking", + "custom" + ] + }, + "feeds_required": { + "type": "boolean" + }, + "scoring_supported": { + "type": "boolean" + }, + "webform_supported": { + "type": "boolean" + }, + "territory": { + "$ref": "#/components/schemas/Territory" + }, + "arguments": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "module_name": { + "type": "string" + }, + "chart_view_supported": { + "type": "boolean" + }, + "profile_count": { + "type": "integer", + "format": "int32" + }, + "business_card_field_limit": { + "type": "integer", + "format": "int32" + }, + "track_current_data": { + "type": "boolean" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "profiles": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/profiles.json#/components/schemas/Minified_Profile" + } + }, + "parent_module": { + "type": "object", + "nullable": true + }, + "activity_badge": { + "type": "string", + "enum": [ + "Enabled", + "Disabled" + ], + "nullable": true + }, + "$field_states": { + "type": "array", + "items": { + "type": "string" + } + }, + "business_card_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "$properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "$on_demand_properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "search_layout_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "kanban_view_supported": { + "type": "boolean", + "nullable": true + }, + "lookup_field_properties": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sequence_number": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "sequence_number", + "api_name", + "id" + ] + } + } + }, + "required": [ + "fields" + ] + }, + "kanban_view": { + "type": "boolean", + "nullable": true + }, + "related_lists": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/related_lists.json#/components/schemas/related_list" + } + }, + "filter_status": { + "type": "boolean", + "nullable": true + }, + "related_list_properties": { + "type": "object", + "properties": { + "sort_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/Minified_Field" + }, + "fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "sort_order": { + "type": "string", + "nullable": true + } + }, + "required": [ + "sort_by", + "fields", + "sort_order" + ] + }, + "display_field": { + "type": "object", + "nullable": true + }, + "layouts": { + "type": "array", + "items": { + "type": "object" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fields" + } + }, + "custom_view": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/custom_views.json#/components/schemas/custom_views" + }, + "zia_view": { + "type": "boolean", + "nullable": true + }, + "default_mapping_fields": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/Minified_Field" + } + }, + "status": { + "type": "string" + }, + "static_subform_properties": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + } + } + }, + "required": [ + "fields" + ] + }, + "layout_associations": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/layout_association" + }, + "type": "array" + } + }, + "required": [ + "common.search_supported", + "deletable", + "description", + "creatable", + "recycle_bin_on_delete", + "inventory_template_supported", + "modified_time", + "plural_label", + "presence_sub_menu", + "triggers_supported", + "id", + "chart_view", + "isBlueprintSupported", + "visibility", + "visible", + "convertable", + "editable", + "emailTemplate_support", + "email_parser_supported", + "filter_supported", + "show_as_tab", + "web_link", + "sequence_number", + "singular_label", + "viewable", + "api_supported", + "api_name", + "quick_create", + "generated_type", + "feeds_required", + "scoring_supported", + "webform_supported", + "arguments", + "module_name", + "chart_view_supported", + "profile_count", + "business_card_field_limit", + "track_current_data", + "modified_by", + "profiles", + "parent_module", + "activity_badge", + "$field_states", + "business_card_fields", + "per_page", + "$properties", + "$on_demand_properties", + "search_layout_fields", + "kanban_view_supported", + "lookup_field_properties", + "kanban_view", + "related_lists", + "filter_status", + "related_list_properties", + "display_field", + "layouts", + "fields", + "custom_view", + "zia_view", + "default_mapping_fields", + "layout_associations" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "modules": { + "items": { + "$ref": "#/components/schemas/modules" + }, + "type": "array" + } + }, + "required": [ + "modules" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "modules": { + "items": { + "$ref": "#/components/schemas/modules" + }, + "type": "array" + } + } + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "modules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + } + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "message": { + "type": "string", + "enum": [ + "module created" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + } + }, + "NotSupported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_SUPPORTED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "Error_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Maximum_Length": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + } + }, + "Mandatory_Not_Found": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + } + } + }, + "Invalid_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Maximum_Length" + }, + { + "$ref": "#/components/schemas/Error_Detail" + } + ] + } + } + }, + "Invalid_Module": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Not_Supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_SUPPORTED" + ] + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Error_Wrapper": { + "type": "object", + "properties": { + "modules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + } + } + } + }, + "responses": { + "Modules": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/NotSupported" + }, + { + "$ref": "#/components/schemas/Error_Wrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Not_Supported" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + } + ] + } + } + } + } + }, + "parameters": { + "api_name": { + "name": "api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "X-ZCSRF-TOKEN": { + "name": "X-ZCSRF-TOKEN", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + "status": { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "visible", + "scheduled_for_deletion", + "user_hidden", + "system_hidden" + ] + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "If-Modified-Since": { + "name": "If-Modified-Since", + "in": "header", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notes.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notes.json new file mode 100644 index 0000000..3005b9e --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notes.json @@ -0,0 +1,1075 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "notes", + "description": "Notes", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Notes": { + "get": { + "operationId": "Get Notes", + "parameters": [ + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + } + }, + "post": { + "operationId": "Create Notes", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Notes", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Note_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Note_API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Notes", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "202": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/Notes/{id}": { + "get": { + "operationId": "Get Note", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Note", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Note_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Note_API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Note", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.all", + "ZohoCRM.modules.notes.all" + ] + } + ], + "components": { + "schemas": { + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "message": { + "type": "string", + "enum": [ + "record updated", + "record deleted", + "record added" + ] + }, + "details": { + "type": "object", + "properties": { + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + }, + "required": [ + "Modified_Time", + "Modified_By", + "Created_Time", + "id", + "Created_By" + ] + } + }, + "required": [ + "code", + "status", + "message", + "details" + ] + }, + "Parent_Id": { + "type": "object", + "properties": { + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Note": { + "type": "object", + "properties": { + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "$attachments": { + "type": "array", + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/attachments.json#/components/schemas/Attachment" + } + }, + "Owner": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Parent_Id": { + "$ref": "#/components/schemas/Parent_Id" + }, + "$editable": { + "type": "boolean" + }, + "$is_shared_to_client": { + "type": "boolean", + "nullable": true + }, + "$sharing_permission": { + "type": "string" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "$size": { + "type": "string" + }, + "$state": { + "type": "string" + }, + "$voice_note": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Note_Title": { + "type": "string" + }, + "Note_Content": { + "type": "string" + } + }, + "required": [ + "Modified_Time", + "$attachments", + "Owner", + "Created_Time", + "Parent_Id", + "$editable", + "$is_shared_to_client", + "Modified_By", + "$size", + "$state", + "$voice_note", + "id", + "Created_By", + "Note_Title", + "Note_Content" + ] + }, + "Info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "next_page_token": { + "type": "string" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "sort_by": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "previous_page_token": { + "type": "string" + }, + "page_token_expiry": { + "type": "string", + "format": "date-time" + }, + "sort_order": { + "type": "string" + }, + "more_records": { + "type": "boolean" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Note" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "data" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Note" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "record not deleted" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Module_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string", + "enum": [ + "the module name given seems to be invalid" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "expected_data_type" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Max_Length_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "maximum_length" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "Note_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION", + "INVALID_URL_PATTERN", + "NOT_SUPPORTED", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "REQUIRED_PARAM_MISSING", + "INVALID_TOKEN", + "INTERNAL_ERROR", + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "The module name given seems to be invalid", + "record not deleted", + "invalid oauth token", + "Please check if the URL trying to access is a correct one", + "One of the expected parameter is missing", + "Internal server error occurred.", + "the id given seems to be invalid", + "The http request method type is not a valid one" + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "api_name": { + "type": "string" + }, + "param": { + "type": "string" + }, + "id": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "param_name": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "If-Modified-Since": { + "name": "If-Modified-Since", + "in": "header", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "fields": { + "name": "fields", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notifications.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notifications.json new file mode 100644 index 0000000..76297ee --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/notifications.json @@ -0,0 +1,679 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "notifications", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/actions/watch": { + "get": { + "operationId": "Get Notifications", + "parameters": [ + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/channel_id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Notification_Response" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "post": { + "operationId": "Enable Notifications", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "202": { + "$ref": "#/components/responses/WrappedErrorResponse" + } + } + }, + "put": { + "operationId": "Update Notifications", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "202": { + "$ref": "#/components/responses/WrappedErrorResponse" + } + } + }, + "patch": { + "operationId": "Disable Notification", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "202": { + "$ref": "#/components/responses/WrappedErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Notification", + "parameters": [ + { + "$ref": "#/components/parameters/channel_ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "202": { + "$ref": "#/components/responses/WrappedErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.notifications.ALL" + ] + } + ], + "components": { + "schemas": { + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "value": { + "type": "object", + "nullable": true + }, + "group_operator": { + "type": "string", + "nullable": true + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "comparator", + "field", + "value", + "group_operator", + "group" + ] + }, + "event": { + "type": "object", + "properties": { + "resource_name": { + "type": "string" + }, + "channel_expiry": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "resource_id": { + "type": "string" + }, + "resource_uri": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "notification_condition": { + "items": { + "$ref": "#/components/schemas/notification_condition" + }, + "type": "array" + } + }, + "required": [ + "resource_name", + "channel_expiry", + "resource_id", + "resource_uri", + "channel_id", + "notification_condition" + ] + }, + "notification_condition": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "field_selection": { + "$ref": "#/components/schemas/Criteria" + } + }, + "required": [ + "module", + "field_selection" + ] + }, + "Module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "Notification": { + "type": "object", + "properties": { + "channel_id": { + "type": "object" + }, + "notify_url": { + "type": "string", + "pattern": "www[.][a-z]{5}zoho[.]com" + }, + "events": { + "type": "array", + "items": { + "type": "string" + } + }, + "token": { + "type": "string", + "nullable": true + }, + "fields": { + "type": "object", + "nullable": true + }, + "notify_on_related_action": { + "type": "boolean", + "nullable": true + }, + "return_affected_field_values": { + "type": "boolean", + "nullable": true + }, + "_delete_events": { + "type": "boolean", + "enum": [ + true + ] + }, + "resource_name": { + "type": "string" + }, + "channel_expiry": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "resource_id": { + "type": "string" + }, + "resource_uri": { + "type": "string" + }, + "notification_condition": { + "items": { + "$ref": "#/components/schemas/notification_condition" + }, + "type": "array" + } + } + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "page", + "count", + "more_records" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "watch": { + "items": { + "$ref": "#/components/schemas/Notification" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "watch", + "info" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "watch": { + "items": { + "$ref": "#/components/schemas/Notification" + }, + "type": "array" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "Successfully removed the subscribe details", + "Successfully un-subscribed from actions-watch", + "Successfully updated the subscribe details", + "Successfully subscribed for actions-watch of the given module" + ] + }, + "details": { + "type": "object", + "properties": { + "events": { + "items": { + "$ref": "#/components/schemas/event" + }, + "type": "array" + }, + "resource_uri": { + "type": "string" + }, + "resource_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + }, + "required": [ + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "watch": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "watch" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "watch": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "watch" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "watch": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "watch" + ] + }, + "InvalidValueWrapper": { + "type": "object", + "properties": { + "watch": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "watch" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_SUBSCRIBED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidParamWrapper": { + "type": "object", + "properties": { + "watch": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidParamError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "watch" + ] + } + }, + "responses": { + "Notification_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "WrappedErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "#/components/schemas/InvalidParamWrapper" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + } + ] + } + } + } + } + }, + "parameters": { + "channel_ids": { + "name": "channel_ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "channel_id": { + "name": "channel_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/org.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/org.json new file mode 100644 index 0000000..9b01f71 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/org.json @@ -0,0 +1,795 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "org", + "description": "org", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/org": { + "get": { + "operationId": "Get Organization", + "parameters": [ + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/org/photo": { + "get": { + "operationId": "Get Org Photo", + "responses": { + "200": { + "description": "", + "content": { + "image/png": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + ] + } + } + } + } + } + }, + "post": { + "operationId": "Upload Organization Photo", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Organization Photo", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.org.all" + ] + } + ], + "components": { + "schemas": { + "License_Details": { + "type": "object", + "properties": { + "paid_expiry": { + "type": "string", + "format": "date-time" + }, + "users_license_purchased": { + "type": "integer", + "format": "int32" + }, + "trial_type": { + "type": "string", + "nullable": true + }, + "trial_expiry": { + "type": "string", + "nullable": true + }, + "paid": { + "type": "boolean" + }, + "paid_type": { + "type": "string" + }, + "trial_action": { + "type": "string" + } + }, + "required": [ + "paid_expiry", + "users_license_purchased", + "trial_type", + "trial_expiry", + "paid", + "paid_type", + "trial_action" + ] + }, + "hierarchy_preferences": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "Role_Hierarchy", + "Reporting_To_Hierarchy" + ] + }, + "strictly_reporting": { + "type": "boolean" + } + }, + "required": [ + "type", + "strictly_reporting" + ] + }, + "checkin_preferences": { + "type": "object", + "properties": { + "restricted_event_types": { + "type": "string", + "nullable": true + } + }, + "required": [ + "restricted_event_types" + ] + }, + "Org": { + "type": "object", + "properties": { + "country": { + "type": "string" + }, + "photo_id": { + "type": "string", + "nullable": true + }, + "city": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "mc_status": { + "type": "boolean" + }, + "gapps_enabled": { + "type": "boolean" + }, + "translation_enabled": { + "type": "boolean" + }, + "street": { + "type": "string", + "nullable": true + }, + "domain_name": { + "type": "string" + }, + "alias": { + "type": "string", + "nullable": true + }, + "currency": { + "type": "string" + }, + "id": { + "type": "string" + }, + "state": { + "type": "string", + "nullable": true + }, + "fax": { + "type": "string", + "nullable": true + }, + "zip": { + "type": "string", + "nullable": true + }, + "employee_count": { + "type": "string" + }, + "website": { + "type": "string" + }, + "currency_symbol": { + "type": "string" + }, + "mobile": { + "type": "string", + "nullable": true + }, + "currency_locale": { + "type": "string" + }, + "primary_zuid": { + "type": "string" + }, + "zia_portal_id": { + "type": "string", + "nullable": true + }, + "time_zone": { + "type": "string" + }, + "zgid": { + "type": "string" + }, + "country_code": { + "type": "string" + }, + "deletable_org_account": { + "type": "boolean" + }, + "license_details": { + "$ref": "#/components/schemas/License_Details" + }, + "hierarchy_preferences": { + "$ref": "#/components/schemas/hierarchy_preferences" + }, + "phone": { + "type": "string" + }, + "company_name": { + "type": "string" + }, + "privacy_settings": { + "type": "boolean" + }, + "primary_email": { + "type": "string" + }, + "iso_code": { + "type": "string" + }, + "hipaa_compliance_enabled": { + "type": "boolean" + }, + "lite_users_enabled": { + "type": "boolean" + }, + "max_per_page": { + "type": "integer", + "format": "int32" + }, + "ezgid": { + "type": "string" + }, + "call_icon": { + "type": "string" + }, + "oauth_presence": { + "type": "boolean" + }, + "zia_zgid": { + "type": "integer", + "format": "int32" + }, + "checkin_preferences": { + "$ref": "#/components/schemas/checkin_preferences" + }, + "type": { + "type": "string", + "enum": [ + "Bigin", + "Production", + "Developer", + "Sandbox" + ] + }, + "created_time": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "country", + "photo_id", + "city", + "description", + "mc_status", + "gapps_enabled", + "translation_enabled", + "street", + "domain_name", + "alias", + "currency", + "id", + "state", + "fax", + "zip", + "currency_symbol", + "mobile", + "currency_locale", + "primary_zuid", + "zia_portal_id", + "time_zone", + "zgid", + "country_code", + "deletable_org_account", + "license_details", + "hierarchy_preferences", + "phone", + "company_name", + "privacy_settings", + "primary_email", + "iso_code", + "hipaa_compliance_enabled", + "lite_users_enabled", + "max_per_page", + "ezgid", + "call_icon", + "oauth_presence", + "zia_zgid", + "checkin_preferences" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "org": { + "items": { + "$ref": "#/components/schemas/Org" + }, + "type": "array" + } + }, + "required": [ + "org" + ] + }, + "Expected_DataType": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "Error_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Maximum_Length": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + }, + "Resource": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "Feature": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Resource" + } + } + }, + "required": [ + "name", + "resources" + ] + }, + "ShiftHour_Error_Detail": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "features": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Feature" + } + } + }, + "required": [ + "status", + "api_name", + "json_path", + "features" + ] + }, + "Cannot_Update": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "CANNOT_UPDATE" + ] + }, + "message": { + "type": "string", + "enum": [ + "Company not created" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Detail" + }, + { + "$ref": "#/components/schemas/ShiftHour_Error_Detail" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_Not_Found": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Detail" + }, + { + "$ref": "#/components/schemas/Expected_DataType" + }, + { + "$ref": "#/components/schemas/Maximum_Length" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Success_Response_Wrapper": { + "type": "object", + "properties": { + "org": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "org" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "org": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Cannot_Update" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + } + }, + "required": [ + "org" + ] + }, + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + } + }, + "Invalid_Data_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + } + }, + "parameters": { + "X-ZOHO-SERVICE": { + "name": "X-ZOHO-SERVICE", + "in": "header", + "required": false, + "schema": { + "type": "string", + "enum": [ + "crmmobile" + ] + } + }, + "X-ZCSRF-TOKEN": { + "name": "X-ZCSRF-TOKEN", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pick_list_values.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pick_list_values.json new file mode 100644 index 0000000..8ccfcbd --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pick_list_values.json @@ -0,0 +1,263 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "pick_list_values", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/fields/{field_id}/pick_list_values": { + "get": { + "operationId": "Get Pick List Values", + "parameters": [ + { + "$ref": "#/components/parameters/field_id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/PickListValues" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "403": { + "$ref": "#/components/responses/NoPermission" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.custom_views.All" + ] + } + ], + "components": { + "schemas": { + "pick_list_values": { + "type": "object", + "properties": { + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "display_value": { + "type": "string" + }, + "reference_value": { + "type": "string" + }, + "colour_code": { + "type": "string", + "nullable": true + }, + "actual_value": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "layout_associations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + } + }, + "required": [ + "sequence_number", + "display_value", + "reference_value", + "colour_code", + "actual_value", + "id", + "type", + "layout_associations" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "pick_list_values": { + "items": { + "$ref": "#/components/schemas/pick_list_values" + }, + "type": "array" + } + }, + "required": [ + "pick_list_values" + ] + }, + "Invalid_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "VERSION_NOT_SUPPORTED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "No_Permission_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "responses": { + "PickListValues": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/Invalid_API_Exception" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidIDError" + } + ] + } + } + } + }, + "NoPermission": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/No_Permission_Exception" + } + } + } + } + }, + "parameters": { + "field_id": { + "name": "field_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pipeline.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pipeline.json new file mode 100644 index 0000000..2bdd281 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/pipeline.json @@ -0,0 +1,1203 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "pipeline", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/pipeline": { + "get": { + "operationId": "get pipelines", + "parameters": [ + { + "$ref": "#/components/parameters/layout_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/GetPipelines" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "post": { + "operationId": "create pipeline", + "parameters": [ + { + "$ref": "#/components/parameters/layout_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/RequestBody" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update Pipelines", + "parameters": [ + { + "$ref": "#/components/parameters/layout_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/RequestBody" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/pipeline/{id}": { + "get": { + "operationId": "get pipeline", + "parameters": [ + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/GetPipelines" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "update pipeline", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/layout_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/RequestBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "patch": { + "operationId": "delete pipeline", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/layout_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/DRequestBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/pipeline/actions/transfer": { + "post": { + "operationId": "Transfer Pipelines", + "parameters": [ + { + "$ref": "#/components/parameters/layout_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/TRequestBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/TSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/TErrorResponse" + }, + "500": { + "$ref": "#/components/responses/TInternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.pipeline.ALL" + ] + } + ], + "components": { + "schemas": { + "forecast_category": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "maps": { + "type": "object", + "properties": { + "display_value": { + "type": "string" + }, + "sequence_number": { + "type": "integer", + "format": "int32", + "nullable": true, + "maximum": 10 + }, + "forecast_category": { + "$ref": "#/components/schemas/forecast_category" + }, + "_delete": { + "type": "boolean" + }, + "actual_value": { + "type": "string" + }, + "id": { + "type": "string" + }, + "colour_code": { + "type": "string" + }, + "forecast_type": { + "type": "string" + } + }, + "required": [ + "display_value", + "sequence_number", + "forecast_category", + "actual_value", + "id", + "forecast_type" + ] + }, + "pipeline": { + "type": "object", + "properties": { + "display_value": { + "type": "string" + }, + "default": { + "type": "boolean", + "nullable": true + }, + "maps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/maps" + } + }, + "actual_value": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + }, + "child_available": { + "type": "boolean" + }, + "parent": { + "$ref": "#/components/schemas/pipeline" + } + }, + "required": [ + "display_value", + "default", + "maps", + "actual_value", + "id" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "$ref": "#/components/schemas/pipeline" + }, + "type": "array" + } + }, + "required": [ + "pipeline" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "$ref": "#/components/schemas/pipeline" + }, + "type": "array" + } + }, + "required": [ + "pipeline" + ] + }, + "SuccessDetails": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/SuccessDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "pipeline" + ] + }, + "_delete": { + "type": "object", + "properties": { + "permanent": { + "type": "boolean" + } + }, + "required": [ + "permanent" + ] + }, + "DPipeline": { + "type": "object", + "properties": { + "_delete": { + "$ref": "#/components/schemas/_delete" + } + }, + "required": [ + "_delete" + ] + }, + "DPipelineWrapper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "$ref": "#/components/schemas/DPipeline" + }, + "type": "array" + } + }, + "required": [ + "pipeline" + ] + }, + "TPipeline": { + "type": "object", + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + }, + "required": [ + "from", + "to" + ] + }, + "stages": { + "type": "object", + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + }, + "required": [ + "from", + "to" + ] + }, + "transfer_pipeline": { + "type": "object", + "properties": { + "pipeline": { + "$ref": "#/components/schemas/TPipeline" + }, + "stages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/stages" + } + } + }, + "required": [ + "pipeline", + "stages" + ] + }, + "TransferWrapper": { + "type": "object", + "properties": { + "transfer_pipeline": { + "items": { + "$ref": "#/components/schemas/transfer_pipeline" + }, + "type": "array" + } + }, + "required": [ + "transfer_pipeline" + ] + }, + "TSuccessDetails": { + "type": "object", + "properties": { + "job_id": { + "type": "string" + } + }, + "required": [ + "job_id" + ] + }, + "TSuccess": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/TSuccessDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "TSuccessWrapper": { + "type": "object", + "properties": { + "transfer_pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TSuccess" + } + ] + }, + "type": "array" + } + }, + "required": [ + "transfer_pipeline" + ] + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "MandatoryDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails1" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "pipeline" + ] + }, + "TMandatoryWrapper": { + "type": "object", + "properties": { + "transfer_pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "transfer_pipeline" + ] + }, + "Duplicate_Error": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "DuplicateWarpper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Duplicate_Error" + } + ] + }, + "type": "array" + } + }, + "required": [ + "pipeline" + ] + }, + "invalidDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "URLInvalidError": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/invalidDetails" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "JsonDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "JsonDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "InvalidError": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/JsonDetails1" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "InvalidWrapper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "pipeline" + ] + }, + "TInvalidWrapper": { + "type": "object", + "properties": { + "transfer_pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "transfer_pipeline" + ] + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MandatoryParamDetails" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "MaxLengthDetails": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "MaxLengthError": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MaxLengthDetails" + } + } + }, + "MaxLengthWrapper": { + "type": "object", + "properties": { + "pipeline": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MaxLengthError" + } + ] + }, + "type": "array" + } + } + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "responses": { + "GetPipelines": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "TSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/TSuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/URLInvalidError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/DuplicateWarpper" + }, + { + "$ref": "#/components/schemas/MaxLengthWrapper" + }, + { + "$ref": "#/components/schemas/InvalidWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/URLInvalidError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + } + ] + } + } + } + }, + "TErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/URLInvalidError" + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/TMandatoryWrapper" + }, + { + "$ref": "#/components/schemas/TInvalidWrapper" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "TInternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "layout_id": { + "name": "layout_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "RequestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "DRequestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DPipelineWrapper" + } + } + }, + "required": true + }, + "TRequestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferWrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_invite.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_invite.json new file mode 100644 index 0000000..be2ea84 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_invite.json @@ -0,0 +1,644 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "portal_invite", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{record}/actions/portal_invite": { + "post": { + "operationId": "Invite Users", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record" + }, + { + "$ref": "#/components/parameters/user_type_id" + }, + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/language" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/{module}/actions/portal_invite": { + "post": { + "operationId": "Bulk Invite Users", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/Bulk_Request" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "get": { + "operationId": "Get Bulk Invite Status", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/JobResponse" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.clientportal.ALL" + ] + } + ], + "components": { + "schemas": { + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS", + "SCHEDULED" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "type": "object", + "properties": { + "record_id": { + "type": "string" + }, + "job_id": { + "type": "string" + } + } + } + } + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "portal_invite": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "portal_invite": { + "type": "array", + "items": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + }, + "job_id": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + } + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + } + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/MandatoryParamDetails" + } + } + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + } + } + }, + "Error_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Api_Name": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Regex": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "regex": { + "type": "string" + } + } + }, + "Mandatory_Not_Found": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + } + } + }, + "Invalid_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Regex" + }, + { + "$ref": "#/components/schemas/Error_Detail" + }, + { + "$ref": "#/components/schemas/Api_Name" + } + ] + } + } + }, + "Portal_Invite": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "user_type_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reinvite", + "invite" + ] + }, + "language": { + "type": "string", + "enum": [ + "it_IT", + "ru_RU", + "pl_PL", + "tr_TR", + "hi_IN", + "pt_BR", + "th_TH", + "fr_FR", + "ja_JP", + "in_ID", + "cs_CZ", + "de_DE", + "hu_HU", + "zh_TW", + "es_ES", + "nl_NL", + "sv_SE", + "da_DK", + "bg_BG", + "vi_VN", + "iw_IL", + "hr_HR", + "en_GB", + "ko_KR", + "en_US", + "zh_CN", + "ar_EG", + "pt_PT" + ] + } + } + } + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "portal_invite": { + "items": { + "$ref": "#/components/schemas/Portal_Invite" + }, + "type": "array" + } + } + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "JobResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "portal_invite": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record": { + "name": "record", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "user_type_id": { + "name": "user_type_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "reinvite", + "invite" + ] + } + }, + "language": { + "name": "language", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "it_IT", + "ru_RU", + "pl_PL", + "tr_TR", + "hi_IN", + "pt_BR", + "th_TH", + "fr_FR", + "ja_JP", + "in_ID", + "cs_CZ", + "de_DE", + "hu_HU", + "zh_TW", + "es_ES", + "nl_NL", + "sv_SE", + "da_DK", + "bg_BG", + "vi_VN", + "iw_IL", + "hr_HR", + "en_GB", + "ko_KR", + "en_US", + "zh_CN", + "ar_EG", + "pt_PT" + ] + } + }, + "job_id": { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "Bulk_Request": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_user_type.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_user_type.json new file mode 100644 index 0000000..6efbdcc --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portal_user_type.json @@ -0,0 +1,695 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "portal_user_type", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/portals/{portal}/user_type": { + "get": { + "operationId": "Get User Types", + "parameters": [ + { + "$ref": "#/components/parameters/portal" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/UserType" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create User Type", + "parameters": [ + { + "$ref": "#/components/parameters/portal" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/portals/{portal}/user_type/{user_type_id}": { + "get": { + "operationId": "Get User Type", + "parameters": [ + { + "$ref": "#/components/parameters/portal" + }, + { + "$ref": "#/components/parameters/user_type_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UserType" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update User Type", + "parameters": [ + { + "$ref": "#/components/parameters/portal" + }, + { + "$ref": "#/components/parameters/user_type_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete User Type", + "parameters": [ + { + "$ref": "#/components/parameters/portal" + }, + { + "$ref": "#/components/parameters/user_type_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.clientportal.ALL" + ] + } + ], + "components": { + "schemas": { + "owner": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "personality_module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "plural_label": { + "type": "string" + } + }, + "required": [ + "api_name", + "id", + "plural_label" + ] + }, + "permissions": { + "type": "object", + "properties": { + "view": { + "type": "boolean" + }, + "edit": { + "type": "boolean" + }, + "edit_shared_records": { + "type": "boolean" + }, + "create": { + "type": "boolean" + }, + "delete": { + "type": "boolean" + }, + "delete_attachment": { + "type": "boolean" + }, + "create_attachment": { + "type": "boolean" + } + }, + "required": [ + "view", + "edit", + "edit_shared_records", + "create", + "delete", + "delete_attachment", + "create_attachment" + ] + }, + "fields": { + "type": "object", + "properties": { + "read_only": { + "type": "boolean" + }, + "api_name": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "read_only", + "api_name", + "id" + ] + }, + "layouts": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "_default_view": { + "$ref": "#/components/schemas/views" + } + }, + "required": [ + "display_label", + "name", + "id", + "_default_view" + ] + }, + "filters": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "display_label", + "api_name", + "id" + ] + }, + "views": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "display_label", + "name", + "id", + "type" + ] + }, + "modules": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "plural_label": { + "type": "string" + }, + "shared_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/filters" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/fields" + } + }, + "layouts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/layouts" + } + }, + "views": { + "$ref": "#/components/schemas/views" + }, + "permissions": { + "$ref": "#/components/schemas/permissions" + } + }, + "required": [ + "id", + "plural_label", + "shared_type", + "api_name", + "filters", + "fields", + "layouts", + "views", + "permissions" + ] + }, + "user_type": { + "type": "object", + "properties": { + "personality_module": { + "$ref": "#/components/schemas/personality_module" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "modified_by": { + "$ref": "#/components/schemas/owner" + }, + "created_by": { + "$ref": "#/components/schemas/owner" + }, + "name": { + "type": "string" + }, + "active": { + "type": "boolean", + "nullable": true + }, + "default": { + "type": "boolean", + "nullable": true + }, + "no_of_users": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string" + }, + "modules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/modules" + } + } + }, + "required": [ + "personality_module", + "created_time", + "modified_time", + "modified_by", + "created_by", + "name", + "active", + "default", + "no_of_users", + "id", + "modules" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "user_type": { + "items": { + "$ref": "#/components/schemas/user_type" + }, + "type": "array" + } + }, + "required": [ + "user_type" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "user_type": { + "items": { + "$ref": "#/components/schemas/user_type" + }, + "type": "array" + } + }, + "required": [ + "user_type" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "user_type": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "user_type" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "responses": { + "UserType": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "UnsupportedVersionResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/UnsupportedVersionError" + }, + { + "$ref": "#/components/schemas/InvalidUrlError" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "user_type": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "user_type" + ] + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + } + } + }, + "parameters": { + "portal": { + "name": "portal", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "user_type_id": { + "name": "user_type_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals.json new file mode 100644 index 0000000..7799373 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals.json @@ -0,0 +1,739 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "portals", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/portals": { + "get": { + "operationId": "Get Portals", + "responses": { + "200": { + "$ref": "#/components/responses/GetPortals" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Portal", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/portals/{portal_name}": { + "get": { + "operationId": "Get Portal", + "parameters": [ + { + "$ref": "#/components/parameters/portal_name" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/GetPortals" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Portal", + "parameters": [ + { + "$ref": "#/components/parameters/portal_name" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.clientportal.ALL" + ] + } + ], + "components": { + "schemas": { + "owner": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "portals": { + "type": "object", + "properties": { + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "modified_by": { + "$ref": "#/components/schemas/owner" + }, + "created_by": { + "$ref": "#/components/schemas/owner" + }, + "zaid": { + "type": "string" + }, + "name": { + "type": "string", + "minLength": 6, + "maxLength": 30 + }, + "active": { + "type": "boolean" + } + }, + "required": [ + "created_time", + "modified_time", + "modified_by", + "created_by", + "zaid", + "name", + "active" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "portals": { + "items": { + "$ref": "#/components/schemas/portals" + }, + "type": "array" + } + }, + "required": [ + "portals" + ] + }, + "details": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "portals": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "portals" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "portals": { + "items": { + "$ref": "#/components/schemas/portals" + }, + "type": "array" + } + } + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MandatoryErrorWrapper": { + "type": "object", + "properties": { + "portals": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "portals" + ] + }, + "UniqueError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "UniqueErrorWrapper": { + "type": "object", + "properties": { + "portals": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UniqueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "portals" + ] + }, + "InvalidDataError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MinLengthDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "minimum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "json_path", + "minimum_length" + ] + }, + "MinLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MinLengthDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MinLengthErrorWrapper": { + "type": "object", + "properties": { + "portals": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MinLengthError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "portals" + ] + }, + "MaxLengthDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "json_path": { + "type": "string", + "nullable": true + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + }, + "MaxLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MaxLengthDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MaxLengthErrorWrapper": { + "type": "object", + "properties": { + "portals": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MaxLengthError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "portals" + ] + }, + "InvalidPatternDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + }, + "InvalidPatternError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "PATTERN_NOT_MATCHED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidPatternDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "JsonError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "JSON_PARSE_ERROR" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidPortalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "GetPortals": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/UniqueErrorWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/MandatoryErrorWrapper" + }, + { + "$ref": "#/components/schemas/MinLengthErrorWrapper" + }, + { + "$ref": "#/components/schemas/MaxLengthErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidPatternError" + }, + { + "$ref": "#/components/schemas/InvalidPortalError" + }, + { + "$ref": "#/components/schemas/JsonError" + }, + { + "$ref": "#/components/schemas/InvalidDataError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/UnsupportedVersionError" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidPatternError" + }, + { + "$ref": "#/components/schemas/InvalidPortalError" + }, + { + "$ref": "#/components/schemas/JsonError" + }, + { + "$ref": "#/components/schemas/InvalidDataError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/UnsupportedVersionError" + } + ] + } + } + } + } + }, + "parameters": { + "portal_name": { + "name": "portal_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals_meta.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals_meta.json new file mode 100644 index 0000000..7e2ccdf --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/portals_meta.json @@ -0,0 +1,215 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "portals_meta", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/portals/meta": { + "get": { + "operationId": "GetMeta", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Meta" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.clientportal.ALL" + ] + } + ], + "components": { + "schemas": { + "layouts": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "display_label", + "name", + "id" + ] + }, + "filters": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "display_label", + "api_name", + "id" + ] + }, + "views": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + }, + "required": [ + "display_label", + "name", + "id", + "type" + ] + }, + "modules": { + "type": "object", + "properties": { + "plural_label": { + "type": "string", + "nullable": true + }, + "shared_type": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/filters" + } + }, + "layouts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/layouts" + } + }, + "views": { + "type": "array", + "items": { + "$ref": "#/components/schemas/views" + } + } + }, + "required": [ + "plural_label", + "shared_type", + "api_name", + "id", + "filters", + "layouts", + "views" + ] + }, + "related_lists": { + "type": "object", + "properties": { + "module": { + "$ref": "#/components/schemas/modules" + } + }, + "required": [ + "module" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "related_lists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/related_lists" + } + } + }, + "required": [ + "related_lists" + ] + } + }, + "responses": { + "Meta": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/profiles.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/profiles.json new file mode 100644 index 0000000..53cdfe6 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/profiles.json @@ -0,0 +1,1212 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "profiles", + "description": "Profiles", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/profiles": { + "get": { + "operationId": "Get Profiles", + "parameters": [ + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + }, + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + }, + { + "$ref": "#/components/parameters/include_lite_profile" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.profiles.all", + "ZohoCRM.settings.profiles.read" + ] + } + ] + } + }, + "/crm/v8/settings/profiles/{id}/actions/clone": { + "post": { + "operationId": "Clone Profiles", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.profiles.all", + "ZohoCRM.settings.profiles.read" + ] + } + ] + } + }, + "/crm/v8/settings/profiles/{id}": { + "put": { + "operationId": "Update Profile", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/INVALID_ID" + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Profile", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + }, + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + }, + "204": { + "description": "" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.profiles.all", + "ZohoCRM.settings.profiles.read" + ] + } + ] + }, + "delete": { + "operationId": "Delete Profile", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "transfer_to", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + }, + { + "$ref": "#/components/schemas/INVALID_ID" + }, + { + "$ref": "#/components/schemas/INVALID_ACTION" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.profiles.all", + "ZohoCRM.settings.profiles.read" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Minified_Profile": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string" + }, + "_delete": { + "type": "boolean" + } + }, + "required": [ + "id", + "name" + ] + }, + "Permission_Detail": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "display_label": { + "type": "string" + }, + "customizable": { + "type": "boolean" + }, + "parent_permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "module": { + "type": "string" + } + }, + "required": [ + "id", + "enabled", + "name", + "display_label", + "module" + ] + }, + "Category_Others": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "permissions_details": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "display_label", + "permissions_details", + "name" + ] + }, + "Category_Module": { + "type": "object", + "properties": { + "display_label": { + "type": "string", + "nullable": true + }, + "permissions_details": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "nullable": true + }, + "module": { + "type": "string", + "nullable": true + } + }, + "required": [ + "display_label", + "permissions_details", + "name", + "module" + ] + }, + "Section": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "categories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Category_Others" + }, + { + "$ref": "#/components/schemas/Category_Module" + } + ] + }, + "type": "array" + } + }, + "required": [ + "name", + "categories" + ] + }, + "Default_View": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "Profile": { + "type": "object", + "properties": { + "_default_view": { + "$ref": "#/components/schemas/Default_View" + }, + "name": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + }, + "default": { + "type": "boolean" + }, + "_delete": { + "type": "boolean" + }, + "permission_type": { + "type": "string" + }, + "custom": { + "type": "boolean" + }, + "display_label": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "normal_profile", + "lite_profile" + ] + }, + "permissions_details": { + "items": { + "$ref": "#/components/schemas/Permission_Detail" + }, + "type": "array" + }, + "sections": { + "items": { + "$ref": "#/components/schemas/Section" + }, + "type": "array" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "category": { + "type": "boolean" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + }, + "required": [ + "name", + "description", + "id", + "display_label", + "permissions_details", + "sections", + "created_time", + "modified_time", + "modified_by", + "category", + "created_by" + ] + }, + "Info": { + "type": "object", + "properties": { + "license_limit": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "license_limit" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "profiles": { + "items": { + "$ref": "#/components/schemas/Profile" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "profiles" + ] + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "INTERNAL_ERROR" + ] + }, + "message": { + "type": "string", + "enum": [ + "The module name given seems to be invalid", + "invalid oauth token", + "Please check if the URL trying to access is a correct one", + "Internal server error occurred.", + "The http request method type is not a valid one" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_Name": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "name" + ] + } + }, + "required": [ + "api_name" + ] + }, + "Mandatory_Permission_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "name" + ] + }, + "index": { + "type": "integer", + "format": "int32" + }, + "parent_api_name": { + "type": "string", + "enum": [ + "permissions_details" + ] + } + }, + "required": [ + "api_name", + "index", + "parent_api_name" + ] + }, + "MANDATORY_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_Name" + }, + { + "$ref": "#/components/schemas/Mandatory_Permission_Details" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Profiles_Invalid_Datatype": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "profiles" + ] + }, + "expected_data_type": { + "type": "string", + "enum": [ + "jsonarray" + ] + } + }, + "required": [ + "api_name", + "expected_data_type" + ] + }, + "Profiles_Length_Violation": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "profiles" + ] + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "enum": [ + 1 + ] + } + }, + "required": [ + "api_name", + "maximum_length" + ] + }, + "Profiles_Empty": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "profiles" + ] + } + }, + "required": [ + "api_name" + ] + }, + "Name_Invalid_Datatype": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "name" + ] + }, + "index": { + "type": "integer", + "format": "int32" + }, + "expected_data_type": { + "type": "string", + "enum": [ + "jsonobject" + ] + } + }, + "required": [ + "api_name", + "index", + "expected_data_type" + ] + }, + "PermissionDetail_Invalid_Datatype": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "permissions_details" + ] + }, + "expected_data_type": { + "type": "string", + "enum": [ + "text" + ] + } + }, + "required": [ + "api_name", + "expected_data_type" + ] + }, + "Violating_Name_Length": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "name" + ] + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "enum": [ + 50 + ] + } + }, + "required": [ + "api_name", + "maximum_length" + ] + }, + "Violating_Description_Length": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "Description" + ] + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "enum": [ + 250 + ] + } + }, + "required": [ + "api_name", + "maximum_length" + ] + }, + "INVALID_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Name_Invalid_Datatype" + }, + { + "$ref": "#/components/schemas/Violating_Name_Length" + }, + { + "$ref": "#/components/schemas/Violating_Description_Length" + }, + { + "$ref": "#/components/schemas/PermissionDetail_Invalid_Datatype" + }, + { + "$ref": "#/components/schemas/Profiles_Invalid_Datatype" + }, + { + "$ref": "#/components/schemas/Profiles_Empty" + }, + { + "$ref": "#/components/schemas/Profiles_Length_Violation" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "DUPLICATE_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "duplicate data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "name" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "LIMIT_EXCEEDED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "LICENSE_LIMIT_EXCEEDED" + ] + }, + "message": { + "type": "string", + "enum": [ + "Request exceeds your license limit." + ] + }, + "details": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int32", + "enum": [ + 25 + ] + } + }, + "required": [ + "limit" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "INVALID_ID": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the id given seems to be invalid or already deleted" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "INVALID_ACTION": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "The action given is invalid" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "profile updated successfully", + "Profile deleted", + "profile created successfully" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Success_Response_Wrapper": { + "type": "object", + "properties": { + "profiles": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "profiles" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "profiles": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/INVALID_ID" + }, + { + "$ref": "#/components/schemas/DUPLICATE_DATA" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + } + ] + }, + "type": "array" + } + }, + "required": [ + "profiles" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "profiles": { + "items": { + "$ref": "#/components/schemas/Profile" + }, + "type": "array" + } + }, + "required": [ + "profiles" + ] + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "include_lite_profile": { + "name": "include_lite_profile", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + }, + "X-ZCSRF-TOKEN": { + "name": "X-ZCSRF-TOKEN", + "in": "header", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ab1234bn" + ] + } + }, + "X-ZOHO-SERVICE": { + "name": "X-ZOHO-SERVICE", + "in": "header", + "required": false, + "schema": { + "type": "string", + "enum": [ + "crmmobile" + ] + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/python/sample_api_runner.py b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/python/sample_api_runner.py new file mode 100644 index 0000000..1e1aa3c --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/python/sample_api_runner.py @@ -0,0 +1,98 @@ +import requests +import logging +import os +from dotenv import load_dotenv + +import swagger_client +from swagger_client.rest import ApiException +from swagger_client.configuration import Configuration +from swagger_client.api_client import ApiClient +from swagger_client.api.default_api import DefaultApi + +# Use this file for sample testing in your generated SDK file. + +# Load environment variables from .env +load_dotenv() + +# Configure logging +logging.basicConfig( + filename='access_token.log', + level=logging.DEBUG, + format='%(asctime)s - %(levelname)s - %(message)s' +) + +# Zoho token functions +def get_zoho_crm_access_token(): + # Get Zoho CRM access token + payload = { + "refresh_token": os.getenv("REFRESH_TOKEN"), + "client_id": os.getenv("CLIENT_ID"), + "client_secret": os.getenv("CLIENT_SECRET"), + "grant_type": "refresh_token" + } + url = "https://accounts.zoho.com/oauth/v2/token" + response = requests.post(url, data=payload) + logging.debug("Response body: %s", response.text) + + response.raise_for_status() + + print("Zoho Access Token:", response.json().get("access_token")) + +def create_refresh_token(): + # Create a refresh token + payload = { + "code": os.getenv("CODE"), + "client_id": os.getenv("CLIENT_ID"), + "client_secret": os.getenv("CLIENT_SECRET"), + "redirect_uri": os.getenv("REDIRECT_URI"), + "grant_type": "authorization_code" + } + url = "https://accounts.zoho.com/oauth/v2/token" + response = requests.post(url, data=payload) + logging.debug("Create refresh token response: %s", response.text) + response.raise_for_status() + return response.json() + +def fetch_record(api_instance, module_api_name, record_id): + try: + response = api_instance.get_record(module_api_name, record_id) + print("API response:", response) + except ApiException as e: + print("Exception when calling DefaultApi->get_record: %s" % e) + +def create_new_record(api_instance, module_api_name): + body = swagger_client.BodyWrapper( + data=[ + swagger_client.Record( + Last_Name="Sample Record" + ) + ] + ) + try: + response = api_instance.create_records(body, module_api_name) + print("Record created:", response) + except ApiException as e: + print("Exception when calling DefaultApi->create_records: %s" % e) + +def main(): + + configuration = Configuration() + configuration.access_token = os.getenv("ACCESS_TOKEN") + + api_client = ApiClient(configuration) + api_instance = DefaultApi(api_client) + + # Demonstrate API calls + # GET Record + + module_api_name = 'Leads' + record_id = 'FAKE_VLAUE' + + fetch_record(api_instance, module_api_name, record_id) + + #POST Record + + create_new_record(api_instance, module_api_name,) + +if __name__ == "__main__": + main() diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record.json new file mode 100644 index 0000000..ad494b8 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record.json @@ -0,0 +1,2732 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "record", + "description": "Record", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/{id}": { + "get": { + "operationId": "Get Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/approved" + }, + { + "$ref": "#/components/parameters/converted" + }, + { + "$ref": "#/components/parameters/cvid" + }, + { + "$ref": "#/components/parameters/uid" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/startDateTime" + }, + { + "$ref": "#/components/parameters/endDateTime" + }, + { + "$ref": "#/components/parameters/territory_id" + }, + { + "$ref": "#/components/parameters/include_child" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + }, + { + "$ref": "#/components/parameters/on_demand_properties" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/File_Body_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/wf_trigger" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}": { + "get": { + "operationId": "Get Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/approved" + }, + { + "$ref": "#/components/parameters/converted" + }, + { + "$ref": "#/components/parameters/cvid" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/uid" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/startDateTime" + }, + { + "$ref": "#/components/parameters/endDateTime" + }, + { + "$ref": "#/components/parameters/territory_id" + }, + { + "$ref": "#/components/parameters/include_child" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + }, + { + "$ref": "#/components/parameters/page_token" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "post": { + "operationId": "Create Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/wf_trigger" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/upsert": { + "post": { + "operationId": "Upsert Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/deleted": { + "get": { + "operationId": "Get Deleted Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Deleted_Records_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/search": { + "get": { + "operationId": "Search Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/criteria" + }, + { + "$ref": "#/components/parameters/email" + }, + { + "$ref": "#/components/parameters/phone" + }, + { + "$ref": "#/components/parameters/word" + }, + { + "$ref": "#/components/parameters/converted" + }, + { + "$ref": "#/components/parameters/approved" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/cvid" + }, + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{id}/photo": { + "get": { + "operationId": "Get Photo", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/x-download": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/File_Body_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "post": { + "operationId": "Upload Photo", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/restrict_triggers" + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/File_Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Photo", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/actions/mass_update": { + "post": { + "operationId": "Mass Update Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mass_Update_Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mass_Update_Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Mass Update Status", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mass_Update" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/actions/assign_territories": { + "post": { + "operationId": "Assign Territories To Multiple Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{id}/actions/assign_territories": { + "post": { + "operationId": "Assign Territory to Record", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/actions/remove_territories": { + "post": { + "operationId": "Remove Territories From Multiple Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{id}/actions/remove_territories": { + "post": { + "operationId": "Remove Territories From Record", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/actions/count": { + "get": { + "operationId": "Record Count", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/cvid" + }, + { + "$ref": "#/components/parameters/criteria" + }, + { + "$ref": "#/components/parameters/email" + }, + { + "$ref": "#/components/parameters/phone" + }, + { + "$ref": "#/components/parameters/word" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "count": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{external_field_value}": { + "get": { + "operationId": "Get Record Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_field_value" + }, + { + "$ref": "#/components/parameters/approved" + }, + { + "$ref": "#/components/parameters/converted" + }, + { + "$ref": "#/components/parameters/cvid" + }, + { + "$ref": "#/components/parameters/uid" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/startDateTime" + }, + { + "$ref": "#/components/parameters/endDateTime" + }, + { + "$ref": "#/components/parameters/territory_id" + }, + { + "$ref": "#/components/parameters/include_child" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/File_Body_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Record Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_field_value" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Record Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_field_value" + }, + { + "$ref": "#/components/parameters/wf_trigger" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{id}/actions/fetch_full_data": { + "get": { + "operationId": "Get Full Data For Rich Text", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/fields" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/actions/fetch_full_data": { + "get": { + "operationId": "Get Rich Text Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/fields" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{id}/actions/clone": { + "post": { + "operationId": "Clone Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "MultiSelectLookup": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "fieldName": { + "type": "object" + }, + "$has_more": { + "type": "object" + } + } + }, + "MultiSelectPicklist": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "fieldName": { + "type": "object" + } + } + }, + "Territory": { + "type": "object", + "properties": { + "$assigned": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "$assigned_time": { + "type": "string", + "format": "date-time" + }, + "$assigned_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + } + }, + "Image_Upload": { + "type": "object", + "properties": { + "Preview_Id__s": { + "type": "string" + }, + "File_Name__s": { + "type": "string" + }, + "Description__s": { + "type": "string" + }, + "Size__s": { + "type": "string" + }, + "id": { + "type": "string" + }, + "Sequence_Number__s": { + "type": "integer", + "format": "int64" + }, + "State__s": { + "type": "string" + }, + "File_Id__s": { + "type": "string" + }, + "_delete": { + "type": "string" + }, + "Created_Time__s": { + "type": "string", + "format": "date-time" + }, + "Modified_Time__s": { + "type": "string", + "format": "date-time" + }, + "Created_By__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Owner__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_By__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + } + }, + "Time_Range": { + "type": "object", + "properties": { + "From": { + "type": "string" + }, + "To": { + "type": "string" + } + } + }, + "Widget": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Wizard": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Record": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Tag": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/tags.json#/components/schemas/Tag" + }, + "type": "array" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": true + }, + "Consent": { + "type": "object", + "properties": { + "Owner": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Contact_Through_Email": { + "type": "boolean" + }, + "Contact_Through_Social": { + "type": "boolean" + }, + "Contact_Through_Survey": { + "type": "boolean" + }, + "Contact_Through_Phone": { + "type": "boolean" + }, + "Mail_Sent_Time": { + "type": "string", + "format": "date-time" + }, + "Consent_Date": { + "type": "string", + "format": "date" + }, + "Consent_Remarks": { + "type": "string" + }, + "Consent_Through": { + "type": "string" + }, + "Data_Processing_Basis": { + "type": "string" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Tag": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/tags.json#/components/schemas/Tag" + }, + "type": "array" + }, + "name": { + "type": "string" + } + } + }, + "Reminder": { + "type": "object", + "properties": { + "period": { + "type": "string" + }, + "unit": { + "type": "integer", + "format": "int32" + }, + "time": { + "type": "string" + } + } + }, + "Info": { + "type": "object", + "properties": { + "call": { + "type": "boolean" + }, + "per_page": { + "type": "integer", + "format": "int32" + }, + "next_page_token": { + "type": "string" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "previous_page_token": { + "type": "string" + }, + "page_token_expiry": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "boolean" + }, + "more_records": { + "type": "boolean" + }, + "sort_by": { + "type": "string" + }, + "sort_order": { + "type": "string" + } + } + }, + "Comment": { + "type": "object", + "properties": { + "commented_by": { + "type": "string" + }, + "commented_time": { + "type": "string", + "format": "date-time" + }, + "comment_content": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "Recurring_Activity": { + "type": "object", + "properties": { + "RRULE": { + "type": "string" + }, + "EXDATE": { + "type": "string" + } + } + }, + "FileDetails": { + "type": "object", + "properties": { + "Created_Time__s": { + "type": "string", + "format": "date-time" + }, + "File_Name__s": { + "type": "string" + }, + "Modified_Time__s": { + "type": "string", + "format": "date-time" + }, + "Created_By__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Size__s": { + "type": "string" + }, + "id": { + "type": "string" + }, + "Owner__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_By__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "File_Id__s": { + "type": "string" + }, + "_delete": { + "type": "string" + } + } + }, + "Remind_At": { + "type": "object", + "properties": { + "ALARM": { + "type": "string" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "duplicate_field": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "insert", + "update" + ] + }, + "message": { + "type": "string", + "enum": [ + "record updated", + "Photo deleted", + "photo uploaded successfully", + "the territories data updated successfully", + "record deleted", + "The record has been converted successfully", + "record added", + "the territories are removed successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "External_Contact_ID": { + "type": "string" + }, + "$approval_state": { + "type": "string" + }, + "Contacts": { + "$ref": "#/components/schemas/Record" + }, + "Deals": { + "$ref": "#/components/schemas/Record" + }, + "Accounts": { + "$ref": "#/components/schemas/Record" + } + } + } + } + }, + "Mass_Update_Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "record updated", + "mass update scheduled successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "job_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + } + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Record" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Record" + }, + "type": "array" + }, + "trigger": { + "type": "array", + "items": { + "type": "string" + } + }, + "process": { + "type": "array", + "items": { + "type": "string" + } + }, + "duplicate_check_fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "wf_trigger": { + "type": "string" + }, + "lar_id": { + "type": "string" + } + } + }, + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + } + }, + "Deleted_Record": { + "type": "object", + "properties": { + "deleted_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "id": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "deleted_time": { + "type": "string", + "format": "date-time" + } + } + }, + "Deleted_Records_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Deleted_Record" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + } + }, + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "enum": [ + "in", + "greater_equal", + "starts_with", + "equal", + "contains", + "ends_with", + "not_contains", + "not_equal", + "not_in", + "greater_than", + "less_than", + "not_between", + "less_equal", + "between" + ] + }, + "field": { + "type": "string" + }, + "value": { + "type": "object" + }, + "group_operator": { + "type": "string", + "enum": [ + "or", + "and" + ] + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + } + }, + "Mass_Update_Body_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Record" + }, + "type": "array" + }, + "cvid": { + "type": "string" + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "territory": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "include_child": { + "type": "boolean" + } + } + }, + "over_write": { + "type": "boolean" + }, + "criteria": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + } + }, + "Mass_Update": { + "type": "object", + "properties": { + "Status": { + "type": "string", + "enum": [ + "COMPLETED", + "FAILED", + "RUNNING", + "SCHEDULED" + ] + }, + "Failed_Count": { + "type": "integer", + "format": "int32" + }, + "Updated_Count": { + "type": "integer", + "format": "int32" + }, + "Not_Updated_Count": { + "type": "integer", + "format": "int32" + }, + "Total_Count": { + "type": "integer", + "format": "int32" + } + } + }, + "PriceBook": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Tag": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/tags.json#/components/schemas/Tag" + }, + "type": "array" + } + } + }, + "LineItemProduct": { + "type": "object", + "properties": { + "Product_Code": { + "type": "string" + }, + "Currency": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Tag": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/tags.json#/components/schemas/Tag" + }, + "type": "array" + } + } + }, + "Line_Tax": { + "type": "object", + "properties": { + "percentage": { + "type": "number", + "format": "double" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "value": { + "type": "number", + "format": "double" + }, + "display_name": { + "type": "string" + } + } + }, + "PricingDetails": { + "type": "object", + "properties": { + "to_range": { + "type": "number", + "format": "double" + }, + "discount": { + "type": "number", + "format": "double" + }, + "from_range": { + "type": "number", + "format": "double" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Tag": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/tags.json#/components/schemas/Tag" + }, + "type": "array" + }, + "name": { + "type": "string" + } + } + }, + "Participants": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "Email": { + "type": "string" + }, + "invited": { + "type": "boolean" + }, + "type": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "status": { + "type": "string" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Tag": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/tags.json#/components/schemas/Tag" + }, + "type": "array" + } + } + }, + "Tax": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA", + "RECORD_IN_BLUEPRINT", + "PATTERN_NOT_MATCHED", + "ID_ALREADY_CONVERTED", + "DEPENDENT_FIELD_MISSING", + "NO_CONTENT", + "RECORD_LOCKED", + "TERRITORY_NOT_ENABLED", + "MANDATORY_NOT_FOUND", + "INVALID_MODULE", + "FEATURE_NOT_SUPPORTED", + "AUTHENTICATION_FAILURE", + "INVALID_DATA", + "NO_RECORDS_FOUND", + "LIMIT_EXCEEDED", + "DATA_MISMATCH", + "INVALID_QUERY", + "NO_PERMISSION", + "OAUTH_SCOPE_MISMATCH", + "INVALID_URL_PATTERN", + "NOT_FOUND", + "INTERNAL_ERROR", + "NOT_ALLOWED", + "ALREADY_USED", + "FILE_SIZE_MORE_THAN_ALLOWED_SIZE", + "MAPPING_MISMATCH", + "LIMIT_REACHED", + "NOT_SUPPORTED", + "CANNOT_PERFORM_ACTION", + "CANNOT_PROCESS", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "REQUIRED_PARAM_MISSING", + "CANNOT_DELETE", + "ALREADY_SCHEDULED", + "STORAGE_SPACE_EXCEEDED", + "NOT_APPROVED", + "EXPECTED_FIELD_MISSING", + "CONVERTED_RECORD", + "Not Modified" + ] + }, + "message": { + "type": "string", + "enum": [ + "Maximum lookup field limit in criteria exceeded", + "Scheduled Mass Operation feature is not available in your edition", + "permission denied", + "mandatory param missing", + "Record count exceeded", + "given id is invalid", + "no permission to perform an action on this record", + "body", + "The http request method type is not a valid one", + "The record is in blue print", + "The module name given seems to be invalid", + "invalid oauth token", + "the id given seems to be invalid.", + "One of the expected parameter is missing", + "Already a Mass Action scheduler is running for the given cvid", + "duplicate data", + "record not deleted", + "Specify Atleast one field", + "required field not found", + "Field cannot be updated as it is associated with a layout rule.This field cannot be updated in the Mass Update", + "Record insertion limit for Image upload field has been exceeded.", + "Please check if the URL trying to access is a correct one", + "Authentication failed", + "no record found to update", + "Internal server error occurred.", + "duplicate territory id found", + "No field found", + "Please check whether the input values are correct", + "the territory feature is not enabled", + "Empty response", + "Field Edit Permission not given", + "give contact id is mismatched with the data", + "There is no data for the ID specified or there is no matching record in the given module.", + "The external ID of the lookup field or the Price Book is incorrect", + "Invalid Sequence Number", + "Territory is not supported for the given module", + "User has no permission to assign this territory", + "The value of the external field is invalid.", + "id already converted", + "Dependent Fields missing", + "record not deletable", + "the id given seems to be invalid", + "Max field limit exceeded", + "The image format is invalid.", + "give account id is mismatched with the data", + "Field is not visible", + "Given Territory id already exists for that record", + "The record is not approved", + "record not approved", + "Record insertion limit has been exceeded.", + "can't update the converted record", + "invalid data", + "Territory id which you are trying to remove was system assigned", + "Maximum limit of territories for that record exceeds", + "the given id seems to be invalid", + "Already an Mass Action scheduler is runing for the given cvid", + "Layout doesn't contain the Pipeline", + "The external field contains duplicate data.", + "The record is in stop processing", + "Customview not accessible", + "invalid query formed", + "Pipeline doesn't contain the Stage", + "The record under merge is locked", + "Given Probability is not valid", + "Field cannot be updated in Scheduled Mass Update", + "Field cannot be updated as it is associated with a validation rule." + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "duplicate_record": { + "type": "object", + "properties": { + "Owner": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "id": { + "type": "string" + } + } + }, + "param_name": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "module": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "index": { + "type": "integer", + "format": "int32" + }, + "maximum_length": { + "type": "string" + }, + "mapped_field": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "allowed_count": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "json_path": { + "type": "string" + }, + "parent_api_name": { + "type": "string" + }, + "param": { + "type": "string" + }, + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "External": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "wf_trigger": { + "name": "wf_trigger", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + }, + "attachment_id": { + "name": "attachment_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "criteria": { + "name": "criteria", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "fields": { + "name": "fields", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "email": { + "name": "email", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "phone": { + "name": "phone", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "word": { + "name": "word", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "converted": { + "name": "converted", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "approved": { + "name": "approved", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "cvid": { + "name": "cvid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "territory_id": { + "name": "territory_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include_child": { + "name": "include_child", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "job_id": { + "name": "job_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "startDateTime": { + "name": "startDateTime", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "endDateTime": { + "name": "endDateTime", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "uid": { + "name": "uid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "If-Modified-Since": { + "name": "If-Modified-Since", + "in": "header", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "X-EXTERNAL": { + "name": "X-EXTERNAL", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + "external_field_value": { + "name": "external_field_value", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "on_demand_properties": { + "name": "on_demand_properties", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page_token": { + "name": "page_token", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "restrict_triggers": { + "name": "restrict_triggers", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking.json new file mode 100644 index 0000000..6cdee4a --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking.json @@ -0,0 +1,918 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "record_locking", + "description": "record_locking", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_name}/{record_id}/Locking_Information__s": { + "get": { + "operationId": "Get Record Locking Informations", + "parameters": [ + { + "$ref": "#/components/parameters/module_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/page_token" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/RError_Response" + } + } + }, + "post": { + "operationId": "Lock Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_name" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + } + }, + "/crm/v8/{module_name}/{record_id}/Locking_Information__s/{lock_id}": { + "get": { + "operationId": "Get Record Locking Information", + "parameters": [ + { + "$ref": "#/components/parameters/module_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/lock_id" + }, + { + "$ref": "#/components/parameters/fields" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/RError_Response" + } + } + }, + "put": { + "operationId": "Update Record Locking Information", + "parameters": [ + { + "$ref": "#/components/parameters/module_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/lock_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + }, + "delete": { + "operationId": "Unlock Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/lock_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.record_locking_configurations.ALL" + ] + } + ], + "components": { + "schemas": { + "Locked_For_s": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + } + }, + "Info": { + "type": "object", + "properties": { + "call": { + "type": "boolean" + }, + "per_page": { + "type": "integer", + "format": "int32" + }, + "next_page_token": { + "type": "string" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "previous_page_token": { + "type": "string" + }, + "page_token_expiry": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "boolean" + }, + "more_records": { + "type": "boolean" + }, + "sort_by": { + "type": "string" + }, + "sort_order": { + "type": "string" + } + } + }, + "Record_Lock": { + "type": "object", + "properties": { + "lock_source__s": { + "type": "string", + "enum": [ + "Manual", + "Automatic" + ] + }, + "locked_by__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "locked_for_s": { + "$ref": "#/components/schemas/Locked_For_s" + }, + "locked_reason__s": { + "type": "string" + }, + "Locked_time__s": { + "type": "string" + }, + "record_locking_configuration_id__s": { + "type": "integer", + "format": "int64" + }, + "record_locking_rule_id__s": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Tag": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/tags.json#/components/schemas/Tag" + }, + "type": "array" + }, + "name": { + "type": "string" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Lock_Record" + }, + "type": "array" + } + } + }, + "Lock_Record": { + "type": "object", + "properties": { + "Locked_Reason__s": { + "type": "string" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Record_Lock" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + } + }, + "Record_Action_Locked_Detail_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "action": { + "type": "string" + } + } + }, + "Record_Action_Locked_Detail_2": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "action": { + "type": "string" + } + } + }, + "Error_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "RECORD_LOCKED" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Action_Locked_Detail_1" + }, + { + "$ref": "#/components/schemas/Record_Action_Locked_Detail_2" + } + ] + } + } + } + } + ] + }, + "type": "array" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "duplicate_field": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "insert", + "update" + ] + }, + "message": { + "type": "string", + "enum": [ + "record updated", + "Photo deleted", + "photo uploaded successfully", + "the territories data updated successfully", + "record deleted", + "The record has been converted successfully", + "record added", + "the territories are removed successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + } + } + } + }, + "Success_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Limit_Exceeded_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "available_limit": { + "type": "integer", + "format": "int32" + } + } + }, + "Limit_Exceeded_2": { + "type": "object", + "properties": { + "param": { + "type": "string" + }, + "limit": { + "type": "integer", + "format": "int32" + } + } + }, + "Limit_Exceeded_3": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + } + }, + "LIMIT_EXCEEDED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Limit_Exceeded_1" + }, + { + "$ref": "#/components/schemas/Limit_Exceeded_2" + }, + { + "$ref": "#/components/schemas/Limit_Exceeded_3" + } + ] + } + } + }, + "Required_Param_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + } + } + } + }, + "Invalid_API_Name": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "MANDATORY_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "$ref": "#/components/schemas/Invalid_API_Name" + } + } + }, + "Invalid_Module": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + }, + "INVALID_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "Invalid data" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Param_Name" + }, + { + "$ref": "#/components/schemas/Invalid_API_Name" + }, + { + "$ref": "#/components/schemas/Maximum_Length" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Invalid_ID" + } + ] + } + } + }, + "Invalid_Param_Name": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + "Invalid_ID": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Maximum_Length": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + }, + "responses": { + "Error_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Wrapper" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + } + ] + } + } + } + }, + "RError_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + } + ] + } + } + } + } + }, + "parameters": { + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module_name": { + "name": "module_name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "Leads" + ] + } + }, + "lock_id": { + "name": "lock_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "fields": { + "name": "fields", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page_token": { + "name": "page_token", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking_configuration.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking_configuration.json new file mode 100644 index 0000000..4b8406a --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_locking_configuration.json @@ -0,0 +1,1125 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "record_locking_configuration", + "description": "record_locking_configurations", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/record_locking_configurations": { + "get": { + "operationId": "Get Record Locking Configurations", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/feature_type" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/RError_Response" + } + } + }, + "post": { + "operationId": "Add Record Locking Configuration", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + }, + "put": { + "operationId": "Update Record Locking Configurations", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + }, + "delete": { + "operationId": "Delete Record Locking Configurations", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + } + }, + "/crm/v8/settings/record_locking_configurations/{record_locking_config_id}": { + "get": { + "operationId": "Get Record Locking Configuration", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_locking_config_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/RError_Response" + } + } + }, + "put": { + "operationId": "Update Record Locking Configuration", + "parameters": [ + { + "$ref": "#/components/parameters/record_locking_config_id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + }, + "delete": { + "operationId": "Delete Record Locking Configuration", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_locking_config_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "$ref": "#/components/responses/Error_Response" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.record_locking_configurations.ALL" + ] + } + ], + "components": { + "schemas": { + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "value": { + "type": "object", + "nullable": true + }, + "group_operator": { + "type": "string", + "nullable": true + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "comparator", + "field", + "value", + "group_operator", + "group" + ] + }, + "locking_rules": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "lock_existing_records": { + "type": "boolean" + }, + "criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "_delete": { + "type": "boolean" + } + } + }, + "restricted_custom_button": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "lock_excluded_profile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "Record_Lock": { + "type": "object", + "properties": { + "created_time": { + "type": "string", + "format": "date-time" + }, + "locked_for": { + "type": "string" + }, + "excluded_fields": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/Minified_Field" + }, + "type": "array" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "feature_type": { + "type": "string" + }, + "locking_rules": { + "items": { + "$ref": "#/components/schemas/locking_rules" + }, + "type": "array" + }, + "restricted_actions": { + "type": "array", + "items": { + "type": "string" + } + }, + "lock_for_portal_users": { + "type": "boolean" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "restricted_communications": { + "type": "array", + "items": { + "type": "string" + } + }, + "system_defined": { + "type": "boolean" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "id": { + "type": "string" + }, + "lock_type": { + "type": "string", + "enum": [ + "automatic", + "manual", + "both" + ] + }, + "restricted_custom_buttons": { + "items": { + "$ref": "#/components/schemas/restricted_custom_button" + }, + "type": "array" + }, + "lock_excluded_profiles": { + "items": { + "$ref": "#/components/schemas/lock_excluded_profile" + }, + "type": "array" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "record_locking_configurations": { + "items": { + "$ref": "#/components/schemas/Record_Lock" + }, + "type": "array" + } + } + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "record locking configuration created successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "record_locking_configurations": { + "items": { + "$ref": "#/components/schemas/Record_Lock" + }, + "type": "array" + } + } + }, + "Invalid_Param_Name": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + "Invalid_API_Name": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Invalid_ID": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "Maximum_Length": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Dependent_Field": { + "type": "object", + "properties": { + "dependee": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Expected_Field": { + "type": "object", + "properties": { + "expected_fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + } + } + }, + "Supported_Values": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Ambiguity_Field": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + } + } + }, + "Limit_Exceeded_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "available_limit": { + "type": "integer", + "format": "int32" + } + } + }, + "Limit_Exceeded_2": { + "type": "object", + "properties": { + "param": { + "type": "string" + }, + "limit": { + "type": "integer", + "format": "int32" + } + } + }, + "Limit_Exceeded_3": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + } + }, + "NOT_SUPPORTED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NOT_SUPPORTED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Invalid_API_Name" + } + } + }, + "MANDATORY_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "$ref": "#/components/schemas/Invalid_API_Name" + } + } + }, + "INVALID_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "Invalid data" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Param_Name" + }, + { + "$ref": "#/components/schemas/Invalid_API_Name" + }, + { + "$ref": "#/components/schemas/Maximum_Length" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Invalid_ID" + }, + { + "$ref": "#/components/schemas/Supported_Values" + } + ] + } + } + }, + "DEPENDENT_FIELD_MISSING": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Dependent_Field" + } + } + }, + "EXPECTED_FIELD_MISSING": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Expected_Field" + } + } + }, + "AMBIGUITY": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "AMBIGUITY_DURING_PROCESSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Ambiguity_Field" + } + } + }, + "Invalid_Module": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + }, + "LIMIT_EXCEEDED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Limit_Exceeded_1" + }, + { + "$ref": "#/components/schemas/Limit_Exceeded_2" + }, + { + "$ref": "#/components/schemas/Limit_Exceeded_3" + } + ] + } + } + }, + "Required_Param_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + } + } + } + }, + "Record_Action_Locked_Detail_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "action": { + "type": "string" + } + } + }, + "Record_Action_Locked_Detail_2": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "action": { + "type": "string" + } + } + }, + "Record_Action_Locked": { + "type": "object", + "properties": { + "record_locking_configurations": { + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "RECORD_LOCKED" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Action_Locked_Detail_1" + }, + { + "$ref": "#/components/schemas/Record_Action_Locked_Detail_2" + } + ] + } + } + } + } + ] + }, + "type": "array" + } + } + }, + "Success_Wrapper": { + "type": "object", + "properties": { + "record_locking_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Error_Wrapper": { + "type": "object", + "properties": { + "record_locking_configurations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/DEPENDENT_FIELD_MISSING" + }, + { + "$ref": "#/components/schemas/EXPECTED_FIELD_MISSING" + }, + { + "$ref": "#/components/schemas/AMBIGUITY" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + }, + { + "$ref": "#/components/schemas/NOT_SUPPORTED" + } + ] + }, + "type": "array" + } + } + } + }, + "responses": { + "Error_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Error_Wrapper" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + } + ] + } + } + } + }, + "RError_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + } + ] + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "record_locking_config_id": { + "name": "record_locking_config_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "feature_type": { + "name": "feature_type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_share_email.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_share_email.json new file mode 100644 index 0000000..d85901d --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/record_share_email.json @@ -0,0 +1,1006 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "record_share_email", + "description": "RecordShareEmail API", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/{id}/actions/share_emails": { + "post": { + "description": "To perform custom level record sharing", + "operationId": "Share Emails", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "Emails shared successfully", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Shared_Successfully" + } + ] + } + } + } + }, + "400": { + "description": "Failure in email sharing", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Id" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Module_not_supported" + }, + { + "$ref": "#/components/schemas/Custom_sharing_disabled" + }, + { + "$ref": "#/components/schemas/Email_not_configured" + }, + { + "$ref": "#/components/schemas/Already_Shared" + }, + { + "$ref": "#/components/schemas/Invalid_ID_API_Exception" + }, + { + "$ref": "#/components/schemas/Id_not_supported" + } + ] + } + } + } + }, + "403": { + "$ref": "#/components/responses/Permission_Denied" + } + } + } + }, + "/crm/v8/{module_api_name}/{id}/actions/unshare_emails": { + "post": { + "description": "To perform custom level record sharing", + "operationId": "UnShare Emails", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "Emails sharing revoked successfully", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Shared_Successfully" + } + ] + } + } + } + }, + "400": { + "description": "Failure in revoking", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Id" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Module_not_supported" + }, + { + "$ref": "#/components/schemas/Custom_sharing_disabled" + }, + { + "$ref": "#/components/schemas/Email_not_configured" + }, + { + "$ref": "#/components/schemas/Already_Revoked" + }, + { + "$ref": "#/components/schemas/Invalid_ID_API_Exception" + }, + { + "$ref": "#/components/schemas/Id_not_supported" + } + ] + } + } + } + }, + "403": { + "$ref": "#/components/responses/Permission_Denied" + } + } + } + }, + "/crm/v8/{module_api_name}/actions/share_emails": { + "post": { + "description": "To perform custom level record sharing", + "operationId": "Share Bulk Emails", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "description": "The request sent with list of ids", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Emails shared successfully", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Shared_Successfully" + } + ] + } + } + } + }, + "400": { + "description": "Failure in email sharing", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Bulk_Invalid_Id" + }, + { + "$ref": "#/components/schemas/Id_not_supported" + }, + { + "$ref": "#/components/schemas/Duplicate_Data" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Module_not_supported" + }, + { + "$ref": "#/components/schemas/Custom_sharing_disabled" + }, + { + "$ref": "#/components/schemas/Email_not_configured" + }, + { + "$ref": "#/components/schemas/Invalid_ID_API_Exception" + } + ] + } + } + } + }, + "207": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Already_Shared_Structure" + }, + { + "$ref": "#/components/schemas/Shared_Successfully_Structure" + }, + { + "$ref": "#/components/schemas/Bulk_Invalid_Id" + }, + { + "$ref": "#/components/schemas/Id_not_supported" + }, + { + "$ref": "#/components/schemas/Duplicate_Data" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "403": { + "$ref": "#/components/responses/Permission_Denied" + } + } + } + }, + "/crm/v8/{module_api_name}/actions/unshare_emails": { + "post": { + "description": "To perform custom level record sharing", + "operationId": "UnShare Bulk Emails", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "description": "The request sent with list of ids", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "207": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Already_Revoked_Structure" + }, + { + "$ref": "#/components/schemas/Bulk_Invalid_Id" + }, + { + "$ref": "#/components/schemas/Id_not_supported" + }, + { + "$ref": "#/components/schemas/Duplicate_Data" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "200": { + "description": "Emails sharing revoked successfully", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Shared_Successfully" + } + ] + } + } + } + }, + "400": { + "description": "Failure in revoking", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Bulk_Invalid_Id" + }, + { + "$ref": "#/components/schemas/Id_not_supported" + }, + { + "$ref": "#/components/schemas/Duplicate_Data" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Module_not_supported" + }, + { + "$ref": "#/components/schemas/Custom_sharing_disabled" + }, + { + "$ref": "#/components/schemas/Email_not_configured" + }, + { + "$ref": "#/components/schemas/Invalid_ID_API_Exception" + } + ] + } + } + } + }, + "403": { + "$ref": "#/components/responses/Permission_Denied" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Email_not_configured": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string", + "enum": [ + "Email Configuration does not exist" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Custom_sharing_disabled": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string", + "enum": [ + "User did not enable custom sharing" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Duplicate_Data": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/details_id" + }, + "message": { + "type": "string", + "enum": [ + "Duplicate Data" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "module_path_details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "Module_not_supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_SUPPORTED" + ] + }, + "details": { + "$ref": "#/components/schemas/module_path_details" + }, + "message": { + "type": "string", + "enum": [ + "the given module is not supported in api" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Id_not_supported": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "details": { + "$ref": "#/components/schemas/module_path_details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Module": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "details": { + "$ref": "#/components/schemas/module_path_details" + }, + "message": { + "type": "string", + "enum": [ + "the module name given seems to be invalid" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Id": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/module_path_details" + }, + "message": { + "type": "string", + "enum": [ + "the related id given seems to be invalid" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Bulk_Invalid_Id": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/details_id" + }, + "message": { + "type": "string", + "enum": [ + "The id given seems to be invalid" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "details_id": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Already_Shared_Structure": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "ALREADY_SHARED" + ] + }, + "details": { + "$ref": "#/components/schemas/details_id" + }, + "message": { + "type": "string", + "enum": [ + "Emails are already shared to the colleagues already" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Already_Revoked_Structure": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_SHARED" + ] + }, + "details": { + "$ref": "#/components/schemas/details_id" + }, + "message": { + "type": "string", + "enum": [ + "Emails are not shared to the colleagues already" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Already_Shared": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Already_Shared_Structure" + } + ] + }, + "type": "array" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "ids" + ] + }, + "Already_Revoked": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Already_Revoked_Structure" + } + ] + }, + "type": "array" + } + } + }, + "Invalid_ID_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Shared_Successfully_Structure": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "details": { + "$ref": "#/components/schemas/details_id" + }, + "message": { + "type": "string", + "enum": [ + "Successfully shared", + "Sharing revoked successfully" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Shared_Successfully": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Shared_Successfully_Structure" + } + ] + }, + "type": "array" + } + } + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "expected key is missing" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "responses": { + "Permission_Denied": { + "description": "Permission denied", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "message": { + "type": "string", + "enum": [ + "permission denied" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/recycle_bin.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/recycle_bin.json new file mode 100644 index 0000000..9c0dff4 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/recycle_bin.json @@ -0,0 +1,1096 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "recycle_bin", + "description": "recycle_bin", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/recycle_bin": { + "get": { + "operationId": "Get RecycleBin Records", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "$ref": "#/components/responses/RError_Response_Wrapper" + } + } + }, + "delete": { + "operationId": "Delete RecycleBin Records", + "parameters": [ + { + "$ref": "#/components/parameters/filters" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Success_Response_Wrapper" + }, + "400": { + "$ref": "#/components/responses/Error_Response_Wrapper" + }, + "207": { + "$ref": "#/components/responses/Multi_Status_Response_Wrapper" + } + } + } + }, + "/crm/v8/settings/recycle_bin/{record_id}": { + "get": { + "operationId": "Get RecycleBin Record", + "parameters": [ + { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "$ref": "#/components/responses/RError_Response_Wrapper" + } + } + }, + "delete": { + "operationId": "Delete RecycleBin Record", + "parameters": [ + { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Success_Response_Wrapper" + }, + "400": { + "$ref": "#/components/responses/Error_Response_Wrapper" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.recycle_bin.UPDATE", + "ZohoCRM.settings.recycle_bin.DELETE", + "ZohoCRM.settings.recycle_bin.READ" + ] + } + ], + "components": { + "schemas": { + "Response_Wrapper": { + "type": "object", + "properties": { + "recycle_bin": { + "type": "array", + "items": { + "type": "object", + "properties": { + "display_name": { + "type": "string" + }, + "deleted_time": { + "type": "string", + "format": "date-time" + }, + "owner": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + }, + "deleted_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "id": { + "type": "string" + } + } + }, + "required": [ + "display_name", + "deleted_time", + "owner", + "module", + "deleted_by", + "id" + ] + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "recycle_bin", + "info" + ] + }, + "Info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + }, + "Count": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "count" + ] + }, + "Restore_All_Records": { + "type": "object", + "properties": { + "restore_all_records": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "required": [ + "restore_all_records" + ] + }, + "Field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS", + "CANNOT_DELETE", + "SCHEDULED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Field_Missing": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ExpectedParam" + }, + { + "$ref": "#/components/schemas/Expected_Field" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "ExpectedParam": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + }, + "expected_fields": { + "items": { + "$ref": "#/components/schemas/Property_Details" + }, + "type": "array" + } + }, + "required": [ + "expected_fields" + ] + }, + "ExpectedDependentFieldMissing": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "EXPECTED_DEPENDENT_FIELD_MISSING" + ] + }, + "details": { + "$ref": "#/components/schemas/DependeeDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "DependeeDetails": { + "type": "object", + "properties": { + "dependee": { + "$ref": "#/components/schemas/Property_Details" + }, + "expected_fields": { + "items": { + "$ref": "#/components/schemas/Property_Details" + }, + "type": "array" + } + }, + "required": [ + "dependee", + "expected_fields" + ] + }, + "Expected_Field": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/Property_Details" + }, + "type": "array" + } + }, + "required": [ + "expected_fields" + ] + }, + "Invalid_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "$ref": "#/components/schemas/Resource_Path_index" + }, + { + "$ref": "#/components/schemas/Param_Data" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Property_Details" + }, + { + "$ref": "#/components/schemas/Expected_Type" + }, + { + "$ref": "#/components/schemas/ExpectedParamType" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "param_name": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "param_name" + ] + }, + "Expected_Type": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + }, + "ExpectedParamType": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "param_name": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path", + "param_name" + ] + }, + "Param_Data": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "param_name": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "param_name" + ] + }, + "Property_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Id": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Resource_Path_index": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "INVALID_URL_PATTERN": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "object", + "nullable": true + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "REQUIRED_PARAM_MISSING": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Dependent_Field_Missing_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Dependee_Details" + }, + { + "$ref": "#/components/schemas/DependentParam" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "status" + ] + }, + "DependentParam": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + }, + "dependee": { + "$ref": "#/components/schemas/Property_Details" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "dependee", + "api_name", + "json_path" + ] + }, + "Dependee_Details": { + "type": "object", + "properties": { + "dependee": { + "$ref": "#/components/schemas/Property_Details" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "dependee", + "api_name", + "json_path" + ] + }, + "Criteria_Limit_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "CRITERIA_LIMIT_EXCEEDED" + ] + }, + "details": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "limit" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Expected_Param_Missing_Expection": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "EXPECTED_PARAM_MISSING" + ] + }, + "details": { + "type": "object", + "properties": { + "param_names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "param_names" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Ambiguity_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "AMBIGUITY_DURING_PROCESSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Ambiguity_Due_To" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Ambiguity_Due_To": { + "type": "object", + "properties": { + "ambiguity_due_to": { + "type": "array", + "items": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + } + } + }, + "required": [ + "ambiguity_due_to" + ] + }, + "cannot_Restore": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "CANNOT_RESTORE_WITHOUT_PARENT" + ] + }, + "details": { + "$ref": "#/components/schemas/Id" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + }, + "responses": { + "Multi_Status_Response_Wrapper": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "recycle_bin": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "recycle_bin" + ] + } + ] + } + } + } + }, + "Success_Response_Wrapper": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "recycle_bin": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "recycle_bin" + ] + } + ] + } + } + } + }, + "Error_Response_Wrapper": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "recycle_bin": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/cannot_Restore" + } + ] + }, + "type": "array" + } + }, + "required": [ + "recycle_bin" + ] + }, + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Criteria_Limit_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Field_Missing" + }, + { + "$ref": "#/components/schemas/Dependent_Field_Missing_Exception" + }, + { + "$ref": "#/components/schemas/Ambiguity_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Param_Missing_Expection" + }, + { + "$ref": "#/components/schemas/ExpectedDependentFieldMissing" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/AmbiguityError" + } + ] + } + } + } + }, + "RError_Response_Wrapper": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Criteria_Limit_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Param_Missing_Expection" + }, + { + "$ref": "#/components/schemas/ExpectedDependentFieldMissing" + } + ] + } + } + } + } + }, + "parameters": { + "filters": { + "name": "filters", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_lists.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_lists.json new file mode 100644 index 0000000..6ce01b0 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_lists.json @@ -0,0 +1,334 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "related_lists", + "description": "Related List", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/related_lists": { + "get": { + "operationId": "Get Related Lists", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/layout_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/RelatedLists" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/related_lists/{id}": { + "get": { + "operationId": "Get Related List", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/layout_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/RelatedLists" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.related_lists.all", + "ZohoCRM.settings.related_lists.read" + ] + } + ], + "components": { + "schemas": { + "ModuleMap": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "related_list": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "sequence_number": { + "type": "string", + "nullable": true + }, + "display_label": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + }, + "module": { + "$ref": "#/components/schemas/ModuleMap" + }, + "name": { + "type": "string", + "nullable": true + }, + "action": { + "type": "string", + "nullable": true + }, + "href": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "connectedmodule": { + "type": "string" + }, + "linkingmodule": { + "type": "string" + }, + "visible": { + "type": "boolean", + "nullable": true + }, + "customize_sort": { + "type": "boolean", + "nullable": true + }, + "customize_fields": { + "type": "boolean", + "nullable": true + }, + "customize_display_label": { + "type": "boolean", + "nullable": true + }, + "sort_by": { + "$ref": "#/components/schemas/field" + }, + "sort_order": { + "type": "string", + "nullable": true + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/field" + } + }, + "status": { + "type": "string", + "enum": [ + "visible", + "scheduled_for_deletion", + "user_hidden" + ] + } + }, + "required": [ + "id", + "sequence_number", + "display_label", + "api_name", + "module", + "name", + "action", + "href", + "type", + "visible", + "customize_sort", + "customize_fields", + "customize_display_label", + "sort_by", + "sort_order", + "fields", + "status" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "related_lists": { + "items": { + "$ref": "#/components/schemas/related_list" + }, + "type": "array" + } + }, + "required": [ + "related_lists" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "responses": { + "RelatedLists": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "layout_id": { + "name": "layout_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_records.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_records.json new file mode 100644 index 0000000..26536d4 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/related_records.json @@ -0,0 +1,974 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "related_records", + "description": "Related Records", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/{record_id}/{related_list_api_name}": { + "get": { + "operationId": "Get Related Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Related Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delink Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{external_value}/{related_list_api_name}": { + "get": { + "operationId": "Get Related Records Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_value" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Related Records Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_value" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Related Records Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_value" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{record_id}/{related_list_api_name}/{related_record_id}": { + "get": { + "operationId": "Get Related Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/related_record_id" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/File_Body_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Related Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/related_record_id" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delink Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/related_record_id" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{external_value}/{related_list_api_name}/{external_field_value}": { + "get": { + "operationId": "Get Related Record Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_value" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/external_field_value" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/File_Body_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Related Record Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_value" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/external_field_value" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Related Record Using External ID", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/external_value" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/external_field_value" + }, + { + "$ref": "#/components/parameters/X-EXTERNAL" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/deleted/{record_id}/{related_list_api_name}": { + "get": { + "operationId": "Get Deleted Parent Records Related Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/related_list_api_name" + }, + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "External_Deal_ID": { + "type": "string" + } + } + }, + "message": { + "type": "string", + "enum": [ + "relation added", + "relation removed" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + } + }, + "File_Body_Wrapper": { + "type": "object", + "properties": { + "file": { + "type": "object" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "type": "array" + }, + "info": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Info" + } + } + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/record.json#/components/schemas/Record" + }, + "type": "array" + } + } + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION", + "INVALID_URL_PATTERN", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "INTERNAL_ERROR", + "CANNOT_BE_UPDATED" + ] + }, + "message": { + "type": "string", + "enum": [ + "record not deleted", + "invalid oauth token", + "Please check if the URL trying to access is a correct one", + "the related id given seems to be invalid", + "Internal server error occurred.", + "The relation name given seems to be invalid", + "invalid data", + "The http request method type is not a valid one" + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "param_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + } + } + } + }, + "parameters": { + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "related_list_api_name": { + "name": "related_list_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "related_record_id": { + "name": "related_record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "If-Modified-Since": { + "name": "If-Modified-Since", + "in": "header", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "external_value": { + "name": "external_value", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "external_field_value": { + "name": "external_field_value", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "X-EXTERNAL": { + "name": "X-EXTERNAL", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + "fields": { + "name": "fields", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/reschedule_history.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/reschedule_history.json new file mode 100644 index 0000000..8c5bf0e --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/reschedule_history.json @@ -0,0 +1,1104 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "reschedule_history", + "description": "Reschedule History", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/Appointments_Rescheduled_History__s": { + "post": { + "operationId": "Add Appointments Rescheduled History", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "207": { + "$ref": "#/components/responses/MultiStatus" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.roles.all", + "ZohoCRM.settings.roles.read" + ] + } + ] + }, + "put": { + "operationId": "Update Appointments Rescheduled History", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.roles.all", + "ZohoCRM.settings.roles.read" + ] + } + ] + }, + "get": { + "operationId": "Get Appointments Rescheduled History", + "parameters": [ + { + "$ref": "#/components/parameters/fields" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Response" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.roles.all", + "ZohoCRM.settings.roles.read" + ] + } + ] + } + }, + "/crm/v8/Appointments_Rescheduled_History__s/{id}": { + "put": { + "operationId": "Update Appointment Rescheduled History", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.roles.all", + "ZohoCRM.settings.roles.read" + ] + } + ] + }, + "get": { + "operationId": "Get Appointment Rescheduled History", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/fields" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Response" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.roles.all", + "ZohoCRM.settings.roles.read" + ] + } + ] + }, + "delete": { + "operationId": "Delete Appointments Rescheduled History", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.roles.all", + "ZohoCRM.settings.roles.read" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "required": [ + "name", + "id", + "email" + ] + }, + "Reschedule_History": { + "type": "object", + "properties": { + "$currency_symbol": { + "type": "string" + }, + "Rescheduled_To": { + "type": "string", + "format": "date-time" + }, + "$review_process": { + "type": "boolean" + }, + "Reschedule_Reason": { + "type": "string", + "nullable": true + }, + "$sharing_permission": { + "type": "string" + }, + "Name": { + "type": "string", + "nullable": true + }, + "Modified_By": { + "$ref": "#/components/schemas/User" + }, + "$review": { + "type": "boolean" + }, + "Rescheduled_By": { + "$ref": "#/components/schemas/User" + }, + "$state": { + "type": "string" + }, + "$canvas_id": { + "type": "string" + }, + "$process_flow": { + "type": "boolean" + }, + "id": { + "type": "string", + "nullable": true + }, + "Rescheduled_Time": { + "type": "string", + "format": "date-time" + }, + "$zia_visions": { + "type": "boolean" + }, + "$approved": { + "type": "boolean" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "$approval": { + "type": "object", + "properties": { + "delegate": { + "type": "boolean" + }, + "approve": { + "type": "boolean" + }, + "reject": { + "type": "boolean" + }, + "resubmit": { + "type": "boolean" + } + }, + "required": [ + "delegate", + "approve", + "reject", + "resubmit" + ] + }, + "Created_Time": { + "type": "string", + "format": "date-time" + }, + "Rescheduled_From": { + "type": "string", + "format": "date-time" + }, + "Appointment_Name": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "$editable": { + "type": "boolean" + }, + "$orchestration": { + "type": "boolean" + }, + "$in_merge": { + "type": "boolean" + }, + "Created_By": { + "$ref": "#/components/schemas/User" + }, + "$approval_state": { + "type": "string" + }, + "Reschedule_Note": { + "type": "string", + "nullable": true + } + }, + "required": [ + "$currency_symbol", + "Rescheduled_To", + "$review_process", + "Reschedule_Reason", + "$sharing_permission", + "Name", + "Modified_By", + "$review", + "Rescheduled_By", + "$state", + "$canvas_id", + "$process_flow", + "id", + "Rescheduled_Time", + "$zia_visions", + "$approved", + "Modified_Time", + "$approval", + "Created_Time", + "Rescheduled_From", + "Appointment_Name", + "$editable", + "$orchestration", + "$in_merge", + "Created_By", + "$approval_state", + "Reschedule_Note" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "Modified_Time": { + "type": "string", + "nullable": true + }, + "Modified_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "Created_Time": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "Created_By": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "$approval_state": { + "type": "string", + "nullable": true + } + }, + "required": [ + "Modified_Time", + "Modified_By", + "Created_Time", + "id", + "Created_By", + "$approval_state" + ] + }, + "message": { + "type": "string", + "enum": [ + "record deleted", + "record added" + ], + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Resource_Path_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "record not deleted" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Data_API_Exception_Without_ID": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "record not deleted" + ], + "nullable": true + }, + "details": { + "type": "object", + "nullable": true + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Module_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string", + "enum": [ + "the module name given seems to be invalid" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "expected_data_type", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Max_Length_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "maximum_length", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Max_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "expected_data_type": { + "type": "string", + "nullable": true + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "json_path": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "expected_data_type", + "maximum_length", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Reschedule_History" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Reschedule_History" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + } + }, + "Info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "next_page_token": { + "type": "string" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "previous_page_token": { + "type": "string" + }, + "page_token_expiry": { + "type": "string", + "format": "date-time" + }, + "more_records": { + "type": "boolean" + } + } + } + }, + "responses": { + "Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "MultiStatus": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Max_Data_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Max_Data_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Max_Data_API_Exception" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Module_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Max_Data_API_Exception" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "fields": { + "name": "fields", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/roles.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/roles.json new file mode 100644 index 0000000..c93c9b5 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/roles.json @@ -0,0 +1,547 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "roles", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/roles": { + "get": { + "operationId": "Get Roles", + "responses": { + "200": { + "$ref": "#/components/responses/Roles" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Roles", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Roles", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/roles/{role_id}": { + "get": { + "operationId": "Get Role", + "parameters": [ + { + "name": "role_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Roles" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Role", + "parameters": [ + { + "$ref": "#/components/parameters/role_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Role", + "parameters": [ + { + "$ref": "#/components/parameters/role_id" + }, + { + "$ref": "#/components/parameters/transfer_to_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.roles.ALL" + ] + } + ], + "components": { + "schemas": { + "reporting_to": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + }, + "Role": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "forecast_manager": { + "$ref": "#/components/schemas/reporting_to" + }, + "reporting_to": { + "$ref": "#/components/schemas/reporting_to" + }, + "share_with_peers": { + "type": "boolean", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "created_by__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "modified_by__s": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "modified_time__s": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "created_time__s": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "admin_user": { + "type": "boolean" + } + }, + "required": [ + "display_label", + "forecast_manager", + "reporting_to", + "share_with_peers", + "description", + "id", + "name", + "created_by__s", + "modified_by__s", + "modified_time__s", + "created_time__s" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "roles": { + "items": { + "$ref": "#/components/schemas/Role" + }, + "type": "array" + } + }, + "required": [ + "roles" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "roles": { + "items": { + "$ref": "#/components/schemas/Role" + }, + "type": "array" + } + }, + "required": [ + "roles" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "roles": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "roles" + ] + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "role_status": { + "type": "string" + }, + "param_name": { + "type": "string" + } + }, + "required": [ + "role_status", + "param_name" + ] + }, + "DataTypeDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA", + "INVALID_DATA", + "PATTERN_NOT_MATCHED", + "REQUIRED_PARAM_MISSING", + "INVALID_MODULE", + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryParamDetails" + }, + { + "$ref": "#/components/schemas/DataTypeDetails" + }, + { + "$ref": "#/components/schemas/MandatoryDetails" + }, + { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + { + "$ref": "#/components/schemas/InvalidParamDetails" + } + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "ErrorWrapper": { + "type": "object", + "properties": { + "roles": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + }, + "type": "array" + } + }, + "required": [ + "roles" + ] + } + }, + "responses": { + "Roles": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorWrapper" + }, + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + } + }, + "parameters": { + "role_id": { + "name": "role_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "transfer_to_id": { + "name": "transfer_to_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/scoring_rules.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/scoring_rules.json new file mode 100644 index 0000000..4b2bf03 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/scoring_rules.json @@ -0,0 +1,1707 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "scoring_rules", + "description": "Scoring Rules", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/automation/scoring_rules": { + "post": { + "operationId": "Create Scoring Rules", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "scoring_rules" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Field_API_Exception" + }, + { + "$ref": "#/components/schemas/Limit_API_Exception" + }, + { + "$ref": "#/components/schemas/Duplicate_Data_Type_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "scoring_rules" + ] + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Scoring Rules", + "parameters": [ + { + "name": "module", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/active" + }, + { + "$ref": "#/components/parameters/name" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Scoring Rules", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Field_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Scoring Rules", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "scoring_rules" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Param_API_Exception" + }, + { + "$ref": "#/components/schemas/Required_Param_API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/automation/scoring_rules/{id}": { + "put": { + "operationId": "Update Scoring Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "scoring_rules" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Max_Length_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Field_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "scoring_rules" + ] + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Scoring Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/layout_id" + }, + { + "$ref": "#/components/parameters/active" + }, + { + "$ref": "#/components/parameters/name" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Scoring Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "scoring_rules" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/automation/scoring_rules/{id}/actions/activate": { + "put": { + "operationId": "Activate Scoring Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Deactivate Scoring Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/automation/scoring_rules/{id}/actions/clone": { + "post": { + "operationId": "Clone Scoring Rule", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module}/actions/run_scoring_rules": { + "put": { + "operationId": "Scoring Rule execution using Rule IDs", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Already_Scheduled_API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.storage_analytics.READ", + "ZohoCRM.settings.storage_analytics.CREATE" + ] + } + ], + "components": { + "schemas": { + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "value": { + "type": "object", + "nullable": true + }, + "group_operator": { + "type": "string", + "nullable": true + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "comparator", + "field", + "value", + "group_operator", + "group" + ] + }, + "Layout": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + }, + "Scoring_Rule": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 25 + }, + "description": { + "type": "string", + "nullable": true, + "maxLength": 500 + }, + "id": { + "type": "string", + "nullable": true + }, + "layout": { + "$ref": "#/components/schemas/Layout" + }, + "created_time": { + "type": "string" + }, + "modified_time": { + "type": "string" + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/modules" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "active": { + "type": "boolean" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "field_rules": { + "type": "array", + "items": { + "type": "object", + "properties": { + "score": { + "type": "integer", + "format": "int32" + }, + "criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "id": { + "type": "string" + } + }, + "required": [ + "score", + "criteria", + "id" + ] + } + }, + "signal_rules": { + "type": "array", + "items": { + "type": "object", + "properties": { + "score": { + "type": "integer", + "format": "int32" + }, + "signal": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "namespace", + "id" + ] + }, + "id": { + "type": "string" + } + }, + "required": [ + "score", + "signal", + "id" + ] + } + } + }, + "required": [ + "name", + "description", + "id", + "layout", + "created_time", + "modified_time", + "module", + "modified_by", + "active", + "created_by", + "field_rules", + "signal_rules" + ] + }, + "Invalid_Module_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string", + "enum": [ + "the module name given seems to be invalid" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "scoring rule created successfully" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "job_id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Already_Scheduled_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "ALREADY_SCHEDULED" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "object", + "nullable": true + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Required_Param_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Param_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Required_Param_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Resource_Path_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Url_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Data_Type_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Duplicate_Data_Type_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Limit_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "limit", + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Max_Length_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "maximum_length", + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Field_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "expected_fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "json_path": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "json_path" + ] + } + } + }, + "required": [ + "expected_fields" + ] + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "$ref": "#/components/schemas/Scoring_Rule" + }, + "type": "array" + } + }, + "required": [ + "scoring_rules" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "scoring_rules": { + "items": { + "$ref": "#/components/schemas/Scoring_Rule" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "scoring_rules" + ] + }, + "Info": { + "type": "object", + "properties": { + "call": { + "type": "boolean" + }, + "per_page": { + "type": "integer", + "format": "int32" + }, + "next_page_token": { + "type": "string" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "previous_page_token": { + "type": "string" + }, + "page_token_expiry": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "boolean" + }, + "more_records": { + "type": "boolean" + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "layout_id": { + "name": "layout_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "name": { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "active": { + "name": "active", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "enum": [ + false, + true + ] + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/send_mail.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/send_mail.json new file mode 100644 index 0000000..6d366c8 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/send_mail.json @@ -0,0 +1,710 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "send_mail", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{moduleName}/{id}/actions/send_mail": { + "post": { + "operationId": "Send Mail", + "parameters": [ + { + "$ref": "#/components/parameters/moduleName" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/RequestBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.send_mail.all.CREATE" + ] + } + ], + "components": { + "schemas": { + "to": { + "type": "object", + "properties": { + "user_name": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]zoho[.]com" + } + }, + "required": [ + "user_name", + "email" + ] + }, + "cc": { + "type": "object", + "properties": { + "user_name": { + "type": "string" + }, + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]zoho[.]com", + "nullable": true + } + }, + "required": [ + "user_name", + "email" + ] + }, + "from": { + "type": "object", + "properties": { + "user_name": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "required": [ + "user_name", + "email" + ] + }, + "attachment": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "linked_module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "linked_record": { + "type": "object", + "properties": { + "module": { + "$ref": "#/components/schemas/linked_module" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "module", + "name", + "id" + ] + }, + "data": { + "type": "object", + "properties": { + "from": { + "$ref": "#/components/schemas/from" + }, + "to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/to" + } + }, + "cc": { + "type": "array", + "items": { + "$ref": "#/components/schemas/cc" + } + }, + "bcc": { + "type": "array", + "items": { + "$ref": "#/components/schemas/cc" + } + }, + "reply_to": { + "$ref": "#/components/schemas/to" + }, + "org_email": { + "type": "boolean", + "nullable": true + }, + "scheduled_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "mail_format": { + "type": "string", + "enum": [ + "html", + "text" + ], + "nullable": true + }, + "consent_email": { + "type": "boolean" + }, + "content": { + "type": "string", + "nullable": true + }, + "subject": { + "type": "string", + "nullable": true + }, + "in_reply_to": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "owner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + }, + "template": { + "oneOf": [ + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/email_templates.json#/components/schemas/Email_Template" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/inventory_templates.json#/components/schemas/Inventory_Templates" + } + ] + }, + "inventory_details": { + "type": "object", + "properties": { + "inventory_template": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "inventory_template" + ] + }, + "data_subject_request": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "id", + "type" + ] + }, + "attachments": { + "items": { + "$ref": "#/components/schemas/attachment" + }, + "type": "array" + }, + "linked_record": { + "$ref": "#/components/schemas/linked_record" + } + }, + "required": [ + "from", + "to", + "cc", + "bcc", + "reply_to", + "org_email", + "scheduled_time", + "mail_format", + "consent_email", + "content", + "subject", + "in_reply_to", + "template", + "inventory_details", + "data_subject_request", + "attachments", + "linked_record" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/data" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "details": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "blocked_email_addresses": { + "type": "array", + "items": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "reason": { + "type": "string" + } + } + }, + "required": [ + "email", + "reason" + ] + } + }, + "required": [ + "message_id", + "blocked_email_addresses" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "AmbiguityWrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/AmbiguityError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/InvalidWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/AmbiguityWrapper" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "moduleName": { + "name": "moduleName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "RequestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/service_preference.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/service_preference.json new file mode 100644 index 0000000..69dde3a --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/service_preference.json @@ -0,0 +1,345 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "service_preference", + "description": "Service Preference", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/service_preferences": { + "get": { + "operationId": "Get Service Preference", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "service_preferences": { + "type": "object", + "properties": { + "job_sheet_enabled": { + "type": "boolean" + } + }, + "required": [ + "job_sheet_enabled" + ] + } + }, + "required": [ + "service_preferences" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Service Preference", + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "service_preferences": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + } + }, + "required": [ + "service_preferences" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "service_preferences": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + } + ] + } + }, + "required": [ + "service_preferences" + ] + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "Appointments preferences updated successfully" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Primary_Details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Supported_Values": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "do_not_create_deal", + "create_deal" + ] + } + } + }, + "required": [ + "api_name", + "json_path", + "supported_values" + ] + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Primary_Details" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Supported_Values" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/share_records.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/share_records.json new file mode 100644 index 0000000..3f3e27b --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/share_records.json @@ -0,0 +1,553 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "share_records", + "description": "Share Records", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module_api_name}/{record_id}/actions/share": { + "get": { + "operationId": "Get Shared Record Details", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/sharedTo" + }, + { + "$ref": "#/components/parameters/view" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Share_Record_API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.share.{module_api_name}.ALL", + "ZohoCRM.share.{module_api_name}.READ" + ] + } + ] + }, + "post": { + "operationId": "Share Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "share": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Share_Record_API_Exception" + } + ] + }, + "type": "array" + }, + "notify": { + "type": "boolean" + } + }, + "required": [ + "share" + ] + }, + { + "$ref": "#/components/schemas/Share_Record_API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.share.{module_api_name}.ALL", + "ZohoCRM.share.{module_api_name}.CREATE" + ] + } + ] + }, + "put": { + "operationId": "Update Share Permissions", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "share": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Share_Record_API_Exception" + } + ] + }, + "type": "array" + }, + "notify": { + "type": "boolean" + } + }, + "required": [ + "share" + ] + }, + { + "$ref": "#/components/schemas/Share_Record_API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.share.{module_api_name}.ALL", + "ZohoCRM.share.{module_api_name}.UPDATE" + ] + } + ] + }, + "delete": { + "operationId": "Revoke Shared Record", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "share": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + }, + { + "$ref": "#/components/schemas/Share_Record_API_Exception" + } + ] + } + }, + "required": [ + "share" + ] + }, + { + "$ref": "#/components/schemas/Share_Record_API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.share.{module_api_name}.ALL", + "ZohoCRM.share.{module_api_name}.DELETE" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Shared_Through": { + "type": "object", + "properties": { + "module": { + "$ref": "#/components/schemas/Module" + }, + "id": { + "type": "string", + "nullable": true + }, + "entity_name": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string" + } + }, + "required": [ + "module", + "id", + "entity_name" + ] + }, + "Module": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "Share_Record": { + "type": "object", + "properties": { + "shared_with": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/users" + }, + "share_related_records": { + "type": "boolean", + "nullable": true + }, + "shared_through": { + "$ref": "#/components/schemas/Shared_Through" + }, + "shared_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "permission": { + "type": "string", + "nullable": true + }, + "shared_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/users" + }, + "user": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/users" + }, + "type": { + "type": "string", + "enum": [ + "private", + "public" + ] + } + }, + "required": [ + "share_related_records", + "shared_through", + "shared_time", + "permission", + "shared_by", + "user" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "record will be shared successfully", + "Sharing Revoked" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "share": { + "items": { + "$ref": "#/components/schemas/Share_Record" + }, + "type": "array" + }, + "shareable_user": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/users" + }, + "type": "array" + } + }, + "required": [ + "share", + "shareable_user" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "share": { + "items": { + "$ref": "#/components/schemas/Share_Record" + }, + "type": "array" + }, + "notify_on_completion": { + "type": "boolean" + }, + "notify": { + "type": "boolean" + } + }, + "required": [ + "share" + ] + }, + "Dependee": { + "type": "object", + "properties": { + "json_path": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + }, + "Share_Record_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA", + "OAUTH_SCOPE_MISMATCH", + "INVALID_URL_PATTERN", + "SHARE_LIMIT_EXCEEDED", + "INVALID_DATA", + "BAD_REQUEST", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "LIMIT_EXCEEDED", + "INVALID_MODULE", + "MANDATORY_NOT_FOUND", + "ENTITY_ID_INVALID" + ] + }, + "message": { + "type": "string", + "enum": [ + "record not deleted", + "Scheduler is running", + "Cannot share a record to more than 10 users.", + "Please check if the URL trying to access is a correct one.", + "No sharing through this record is available to revoke.", + "Please check if the URL trying to access is a correct one", + "The http request method type is not a valid one", + "ENTITY_ID_INVALID", + "invalid oauth scope to access this URL", + "invalid oauth token", + "the related id given seems to be invalid", + "cannot share to the user", + "The relation name given seems to be invalid.", + "Permission is invalid", + "record is already visible to the user." + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "dependee": { + "$ref": "#/components/schemas/Dependee" + }, + "ambiguity_due_to": { + "items": { + "$ref": "#/components/schemas/Dependee" + }, + "type": "array" + }, + "json_path": { + "type": "string" + }, + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + } + }, + "required": [ + "status", + "code", + "message" + ] + } + }, + "parameters": { + "sharedTo": { + "name": "sharedTo", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + "view": { + "name": "view", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/shift_hours.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/shift_hours.json new file mode 100644 index 0000000..d122f53 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/shift_hours.json @@ -0,0 +1,1135 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "shift_hours", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/business_hours/shift_hours": { + "get": { + "operationId": "Get Shift Hours", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/ShiftHours" + }, + "400": { + "$ref": "#/components/responses/RRootResponse" + } + } + }, + "post": { + "operationId": "Create Shifts Hours", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Shift Hours", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/business_hours/shift_hours/{shift_id}": { + "get": { + "operationId": "Get Shift Hour", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + }, + { + "$ref": "#/components/parameters/shift_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ShiftHours" + }, + "400": { + "$ref": "#/components/responses/RRootResponse" + } + } + }, + "put": { + "operationId": "Update Shift Hour", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + }, + { + "$ref": "#/components/parameters/shift_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Shift Hour", + "parameters": [ + { + "$ref": "#/components/parameters/X-CRM-ORG" + }, + { + "$ref": "#/components/parameters/shift_id" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/RootResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.business_hours.ALL" + ] + } + ], + "components": { + "schemas": { + "holidays": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date", + "nullable": true + }, + "year": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "date", + "year", + "name", + "id" + ] + }, + "role": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "users": { + "type": "object", + "properties": { + "role": { + "$ref": "#/components/schemas/role" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string" + }, + "zuid": { + "type": "string" + }, + "effective_from": { + "type": "string", + "format": "date", + "nullable": true + } + }, + "required": [ + "role", + "name", + "id", + "email", + "zuid", + "effective_from" + ] + }, + "shift_custom_timing": { + "type": "object", + "properties": { + "days": { + "type": "string" + }, + "shift_timing": { + "type": "array", + "items": { + "type": "object", + "pattern": "hh:mm" + } + } + }, + "required": [ + "days", + "shift_timing" + ] + }, + "break_custom_timing": { + "type": "object", + "properties": { + "days": { + "type": "string" + }, + "break_timing": { + "type": "array", + "items": { + "type": "object", + "pattern": "hh:mm" + } + } + }, + "required": [ + "days", + "break_timing" + ] + }, + "break_hours": { + "type": "object", + "properties": { + "break_days": { + "type": "array", + "items": { + "type": "string" + } + }, + "same_as_everyday": { + "type": "boolean" + }, + "daily_timing": { + "type": "array", + "items": { + "type": "object", + "pattern": "hh:mm" + } + }, + "custom_timing": { + "type": "array", + "items": { + "$ref": "#/components/schemas/break_custom_timing" + } + }, + "id": { + "type": "string" + } + }, + "required": [ + "break_days", + "same_as_everyday", + "daily_timing", + "custom_timing", + "id" + ] + }, + "shift_hours": { + "type": "object", + "properties": { + "same_as_everyday": { + "type": "boolean" + }, + "shift_days": { + "type": "array", + "items": { + "type": "string" + } + }, + "daily_timing": { + "type": "array", + "items": { + "type": "object", + "pattern": "hh:mm" + } + }, + "custom_timing": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shift_custom_timing" + } + }, + "id": { + "type": "string" + }, + "break_hours": { + "type": "array", + "items": { + "$ref": "#/components/schemas/break_hours" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "holidays": { + "type": "array", + "items": { + "$ref": "#/components/schemas/holidays" + } + }, + "users_count": { + "type": "integer", + "format": "int32" + }, + "timezone": { + "type": "object" + }, + "name": { + "type": "string" + } + }, + "required": [ + "same_as_everyday", + "shift_days", + "daily_timing", + "custom_timing", + "id", + "break_hours", + "users", + "holidays", + "users_count", + "timezone", + "name" + ] + }, + "shift_count": { + "type": "object", + "properties": { + "total_shift_with_user": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "total_shift": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "total_shift_with_user", + "total_shift" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "$ref": "#/components/schemas/shift_hours" + }, + "type": "array" + }, + "shift_count": { + "$ref": "#/components/schemas/shift_count" + } + }, + "required": [ + "shift_hours", + "shift_count" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "$ref": "#/components/schemas/shift_hours" + }, + "type": "array" + } + } + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "shift_hours" + ] + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "MandatoryDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails1" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MandatoryErrorWrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "shift_hours" + ] + }, + "DependeeDetails": { + "type": "object", + "properties": { + "dependee": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "dependee", + "api_name", + "json_path" + ] + }, + "DependeeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DependeeDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "DependeeErrorWrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DependeeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "shift_hours" + ] + }, + "InvalidRegexDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "json_path": { + "type": "string", + "nullable": true + }, + "regex": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "json_path", + "regex" + ] + }, + "InvalidValueError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryDetails1" + }, + { + "$ref": "#/components/schemas/InvalidRegexDetails" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidValueErrorWrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "shift_hours" + ] + }, + "TypeDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type", + "regex" + ] + }, + "ExpectedDataTypeDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "ExpectedDataTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/ExpectedDataTypeDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidTypeDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "details": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "details" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/TypeDetails" + }, + { + "$ref": "#/components/schemas/InvalidTypeDetails" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidTypeErrorWrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "shift_hours" + ] + }, + "MaxLengthDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "json_path": { + "type": "string", + "nullable": true + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + }, + "MinLengthDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "minimum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "json_path", + "minimum_length" + ] + }, + "MinLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/MinLengthDetails" + }, + { + "$ref": "#/components/schemas/MaxLengthDetails" + } + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MinLengthErrorWrapper": { + "type": "object", + "properties": { + "shift_hours": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MinLengthError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "shift_hours" + ] + } + }, + "responses": { + "ShiftHours": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "RootResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + } + } + } + }, + "RRootResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryErrorWrapper" + }, + { + "$ref": "#/components/schemas/DependeeErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeErrorWrapper" + }, + { + "$ref": "#/components/schemas/MinLengthErrorWrapper" + }, + { + "$ref": "#/components/schemas/ExpectedDataTypeError" + }, + { + "$ref": "#/components/schemas/InvalidValueError" + } + ] + } + } + } + } + }, + "parameters": { + "X-CRM-ORG": { + "name": "X-CRM-ORG", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + "shift_id": { + "name": "shift_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/tags.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/tags.json new file mode 100644 index 0000000..0b41eea --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/tags.json @@ -0,0 +1,1652 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "tags", + "description": "tags", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/tags": { + "get": { + "operationId": "Get Tags", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/my_tags" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + } + ] + } + } + } + } + } + }, + "post": { + "operationId": "Create Tags", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/color_code" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Tags", + "parameters": [ + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/tags/{id}": { + "put": { + "operationId": "Update Tag", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete Tag", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/tags/{id}/actions/merge": { + "post": { + "operationId": "Merge Tags", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Merge_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{record_id}/actions/add_tags": { + "post": { + "operationId": "Add Tags", + "parameters": [ + { + "$ref": "#/components/parameters/over_write" + }, + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/New_Tag_Request_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Action_Wrapper_Error" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Expected_Field_Missing" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/{record_id}/actions/remove_tags": { + "post": { + "operationId": "Remove Tags", + "parameters": [ + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/module_api_name" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Existing_Tag_Request_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Action_Wrapper_Error" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Expected_Field_Missing" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/actions/add_tags": { + "post": { + "operationId": "Add Tags To Multiple Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/over_write" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/New_Tag_Request_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Action_Wrapper_Error" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Expected_Field_Missing" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module_api_name}/actions/remove_tags": { + "post": { + "operationId": "Remove Tags From Multiple Records", + "parameters": [ + { + "$ref": "#/components/parameters/module_api_name" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Existing_Tag_Request_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Action_Wrapper_Error" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Expected_Field_Missing" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/tags/{id}/actions/records_count": { + "get": { + "operationId": "Get Record Count For Tag", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/module" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "count": { + "type": "string" + } + }, + "required": [ + "count" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Required_Param_Missing" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.tags.all" + ] + } + ] + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.tags.all" + ] + } + ], + "components": { + "schemas": { + "Tag": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 25 + }, + "color_code": { + "type": "string", + "enum": [ + "#57B1FD", + "#879BFC", + "#658BA8", + "#FD87BD", + "#969696", + "#F48435", + "#1DB9B4", + "#E7A826", + "#63C57E", + "#F17574", + "#D297EE", + "#A8C026", + "#B88562" + ], + "nullable": true + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "color_code", + "created_time", + "modified_time", + "modified_by", + "created_by", + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "message": { + "type": "string", + "enum": [ + "tags created successfully", + "tags deleted successfully", + "tags updated successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "id": { + "type": "string" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "color_code": { + "type": "string", + "nullable": true + } + }, + "required": [ + "created_time", + "modified_time", + "modified_by", + "id", + "created_by", + "color_code" + ] + } + }, + "required": [ + "code", + "status", + "details" + ] + }, + "Existing_Tag_Request_Wrapper": { + "type": "object", + "properties": { + "tags": { + "items": { + "$ref": "#/components/schemas/Existing_Tag" + }, + "type": "array" + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "tags", + "ids" + ] + }, + "Existing_Tag": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "New_Tag_Request_Wrapper": { + "type": "object", + "properties": { + "tags": { + "items": { + "$ref": "#/components/schemas/Tag" + }, + "type": "array" + }, + "over_write": { + "type": "boolean", + "nullable": true + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "tags", + "over_write", + "ids" + ] + }, + "Success_Wrapper": { + "type": "object", + "properties": { + "tags": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "tags" + ] + }, + "Record_Detail_Tag": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "color_code": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "color_code" + ] + }, + "Record_Success_Detail": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "tags": { + "items": { + "$ref": "#/components/schemas/Record_Detail_Tag" + }, + "type": "array" + } + }, + "required": [ + "id", + "tags" + ] + }, + "Record_Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Record_Success_Detail" + } + }, + "required": [ + "code", + "status", + "message", + "details" + ] + }, + "Info": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "allowed_count": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "count", + "allowed_count" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "tags": { + "items": { + "$ref": "#/components/schemas/Tag" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "tags", + "info" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "tags": { + "items": { + "$ref": "#/components/schemas/Tag" + }, + "type": "array" + } + } + }, + "Conflict_Wrapper": { + "type": "object", + "properties": { + "conflict_id": { + "type": "string" + } + }, + "required": [ + "conflict_id" + ] + }, + "Merge_Wrapper": { + "type": "object", + "properties": { + "tags": { + "items": { + "$ref": "#/components/schemas/Conflict_Wrapper" + }, + "type": "array" + } + }, + "required": [ + "tags" + ] + }, + "Record_Success_Wrapper": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Record_Success_Response" + } + ] + }, + "type": "array" + }, + "wf_scheduler": { + "type": "boolean" + }, + "success_count": { + "type": "string" + }, + "locked_count": { + "type": "string" + } + } + }, + "Associated_Places": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Not_Allowed_Detail": { + "type": "object", + "properties": { + "associated_places": { + "items": { + "$ref": "#/components/schemas/Associated_Places" + }, + "type": "array" + } + } + }, + "Not_Allowed": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Not_Allowed_Detail" + } + } + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + } + }, + "Record_Action_Wrapper_Error": { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Not_Allowed" + } + ] + }, + "type": "array" + } + } + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "Expected_Detail": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "type": "array" + } + } + }, + "Expected_Field_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Expected_Detail" + } + } + }, + "Maximum_Length": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + }, + "Expected_Data_Type": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "Error_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Invalid_Id": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "Mandatory_Not_Found": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/Error_Detail" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Tag": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "object", + "nullable": true + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Maximum_Length" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type" + }, + { + "$ref": "#/components/schemas/Error_Detail" + }, + { + "$ref": "#/components/schemas/Invalid_Id" + } + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Duplicate_Data": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Resource_Detail": { + "type": "object", + "properties": { + "associations": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "associations" + ] + }, + "Resources": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/Resource_Detail" + } + }, + "required": [ + "name", + "id", + "details" + ] + }, + "Required_Param_Missing": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param": { + "type": "string" + } + }, + "required": [ + "param" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Module": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "tags": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Required_Param_Missing" + }, + { + "$ref": "#/components/schemas/Invalid_Module" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found" + }, + { + "$ref": "#/components/schemas/Invalid_Data" + }, + { + "$ref": "#/components/schemas/Duplicate_Data" + }, + { + "$ref": "#/components/schemas/Not_Allowed" + } + ] + }, + "type": "array" + } + }, + "required": [ + "tags" + ] + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "over_write": { + "name": "over_write", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "my_tags": { + "name": "my_tags", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "module_api_name": { + "name": "module_api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "color_code": { + "name": "color_code", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territories.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territories.json new file mode 100644 index 0000000..9fa4632 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territories.json @@ -0,0 +1,1208 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "territories", + "description": "Territories", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/territories": { + "get": { + "operationId": "Get Territories", + "parameters": [ + { + "$ref": "#/components/parameters/filters" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Territories" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + }, + "post": { + "operationId": "Create Territories", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update Territories", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Territories", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/delete_previous_forecasts" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/territories/{id}": { + "get": { + "operationId": "Get Territory", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Territories" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update Territory", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Territory", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/delete_previous_forecasts" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/territories/{id}/__child_territories": { + "get": { + "operationId": "Get Child Territory", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/filters" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Territories" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/territories/actions/associated_users_count": { + "get": { + "operationId": "Get Associated User Count", + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Associated_Usesr_Count" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/territories/actions/deleted_associated_territories": { + "get": { + "operationId": "Get Deleted Associated Territory", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Deleted_Associated_Territories" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + } + }, + "/crm/v8/settings/territories/{id}/actions/transfer_and_delete": { + "post": { + "operationId": "Transfer And Delete Territory", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/TransferBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/territories/actions/transfer_and_delete": { + "post": { + "operationId": "Transfer And Delete Territories", + "requestBody": { + "$ref": "#/components/requestBodies/TransferBody" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.territories.ALL", + "ZohoCRM.users.All" + ] + } + ], + "components": { + "schemas": { + "Minified_Territory": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "subordinates": { + "type": "boolean" + } + }, + "required": [ + "name", + "id", + "subordinates" + ] + }, + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string", + "nullable": true + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "api_name", + "id" + ] + }, + "value": { + "type": "object", + "nullable": true + }, + "group_operator": { + "type": "string", + "nullable": true + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + }, + "required": [ + "comparator", + "field", + "value", + "group_operator", + "group" + ] + }, + "manager": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "reporting_to": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "territories": { + "type": "object", + "properties": { + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "manager": { + "$ref": "#/components/schemas/manager" + }, + "reporting_to": { + "$ref": "#/components/schemas/reporting_to" + }, + "permission_type": { + "type": "string", + "enum": [ + "read_write_delete", + "read_only" + ] + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "description": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "account_rule_criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "deal_rule_criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "lead_rule_criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "name": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "created_time", + "modified_time", + "manager", + "reporting_to", + "permission_type", + "modified_by", + "description", + "id", + "created_by", + "account_rule_criteria", + "deal_rule_criteria", + "name", + "api_name" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "$ref": "#/components/schemas/territories" + }, + "type": "array" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "$ref": "#/components/schemas/territories" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "territories", + "info" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "MandatoryDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "api_name", + "json_path", + "supported_values" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MandatoryErrorWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "DuplicateError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "DuplicateErrorWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DuplicateError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "TypeDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/TypeDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidTypeErrorWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "InvalidValueError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MandatoryDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidValueErrorWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "NOT_ALLOWED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InvalidUrlErrorWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "associated_users_count": { + "type": "object", + "properties": { + "count": { + "type": "string" + }, + "territory": { + "$ref": "#/components/schemas/Minified_Territory" + } + }, + "required": [ + "count", + "territory" + ] + }, + "Associated_Users_Count_Wrapper": { + "type": "object", + "properties": { + "associated_users_count": { + "items": { + "$ref": "#/components/schemas/associated_users_count" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "associated_users_count", + "info" + ] + }, + "deleted_associated_territories": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "deleted_time": { + "type": "string", + "format": "date-time" + }, + "deleted_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + } + }, + "required": [ + "name", + "id", + "deleted_time", + "deleted_by" + ] + }, + "Deleted_Associated_Wrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "$ref": "#/components/schemas/deleted_associated_territories" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "territories", + "info" + ] + } + }, + "responses": { + "Territories": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidUrlErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueErrorWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeErrorWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryErrorWrapper" + }, + { + "$ref": "#/components/schemas/DuplicateErrorWrapper" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "RInternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "Associated_Usesr_Count": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Associated_Users_Count_Wrapper" + } + ] + } + } + } + }, + "Deleted_Associated_Territories": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Deleted_Associated_Wrapper" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "delete_previous_forecasts": { + "name": "delete_previous_forecasts", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + }, + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record": { + "name": "record", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "TransferBody": { + "content": { + "application/json": {} + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territory_users.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territory_users.json new file mode 100644 index 0000000..6ce453a --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/territory_users.json @@ -0,0 +1,544 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "territory_users", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/territories/{territory}/users": { + "get": { + "operationId": "Get Territory Users", + "parameters": [ + { + "name": "territory", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Users" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Territory Users", + "parameters": [ + { + "name": "territory", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Deassociate Territory Users", + "parameters": [ + { + "$ref": "#/components/parameters/territory" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/territories/{territory}/users/{user}": { + "get": { + "operationId": "Get territory User", + "parameters": [ + { + "$ref": "#/components/parameters/territory" + }, + { + "$ref": "#/components/parameters/user" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Users" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update territory User", + "parameters": [ + { + "name": "territory", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "user", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Deassociate Territory User", + "parameters": [ + { + "$ref": "#/components/parameters/territory" + }, + { + "$ref": "#/components/parameters/user" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.territories.ALL", + "ZohoCRM.users.All" + ] + } + ], + "components": { + "schemas": { + "Body_Wrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/users" + }, + "type": "array" + } + } + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/users" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + } + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + } + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + } + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "owner_status": { + "type": "string" + } + } + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidUrlWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "type": "object", + "properties": { + "owner_status": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidParamWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidParamError" + } + ] + }, + "type": "array" + } + } + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "type": "object", + "properties": { + "owner_status": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InvalidWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + } + ] + }, + "type": "array" + } + } + } + }, + "responses": { + "Users": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/InvalidError" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "#/components/schemas/InvalidWrapper" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/DuplicateWrapper" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "#/components/schemas/InvalidParamWrapper" + }, + { + "$ref": "#/components/schemas/InvalidUrlWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/InvalidError" + } + ] + } + } + } + } + }, + "parameters": { + "territory": { + "name": "territory", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "user": { + "name": "user", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/timelines.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/timelines.json new file mode 100644 index 0000000..16a519a --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/timelines.json @@ -0,0 +1,541 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "timelines", + "description": "timelines", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/{record_id}/__timeline": { + "get": { + "operationId": "Get Timelines", + "parameters": [ + { + "$ref": "#/components/parameters/record_id" + }, + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/include_inner_details" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/include_timeline_type" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/filters" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/page_token" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/INVALID_MODULE" + }, + { + "$ref": "#/components/schemas/INVALID_ID" + }, + { + "$ref": "#/components/schemas/INVALID_FILTER" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.modules.ALL" + ] + } + ], + "components": { + "schemas": { + "Name_Id_Structure": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "Related_Record": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "module": { + "$ref": "#/components/schemas/Name_Id_Structure" + } + } + }, + "pathfinder": { + "type": "object", + "properties": { + "process_entry": { + "type": "boolean" + }, + "process_exit": { + "type": "boolean" + }, + "state": { + "$ref": "#/components/schemas/state" + } + } + }, + "state": { + "type": "object", + "properties": { + "trigger_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "is_last_state": { + "type": "boolean" + }, + "id": { + "type": "string" + } + } + }, + "Automation_Detail": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "rule": { + "$ref": "#/components/schemas/Name_Id_Structure" + }, + "pathfinder": { + "$ref": "#/components/schemas/pathfinder" + } + } + }, + "Record": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "module": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + } + } + }, + "Picklist_Detail": { + "type": "object", + "properties": { + "display_value": { + "type": "string" + }, + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "colour_code": { + "type": "string" + }, + "actual_value": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "Field_History": { + "type": "object", + "properties": { + "data_type": { + "type": "string" + }, + "enable_colour_code": { + "type": "boolean" + }, + "pick_list_values": { + "items": { + "$ref": "#/components/schemas/Picklist_Detail" + }, + "type": "array" + }, + "field_label": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "_value": { + "type": "object", + "properties": { + "new": { + "type": "string" + }, + "old": { + "type": "string" + } + } + } + } + }, + "Timeline": { + "type": "object", + "properties": { + "audited_time": { + "type": "string", + "format": "date-time" + }, + "action": { + "type": "string" + }, + "id": { + "type": "string" + }, + "source": { + "type": "string" + }, + "extension": { + "type": "string" + }, + "type": { + "type": "string" + }, + "done_by": { + "$ref": "#/components/schemas/Name_Id_Structure" + }, + "related_record": { + "$ref": "#/components/schemas/Related_Record" + }, + "automation_details": { + "$ref": "#/components/schemas/Automation_Detail" + }, + "record": { + "$ref": "#/components/schemas/Record" + }, + "field_history": { + "items": { + "$ref": "#/components/schemas/Field_History" + }, + "type": "array" + } + } + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + }, + "next_page_token": { + "type": "string" + }, + "previous_page_token": { + "type": "string" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "__timeline": { + "items": { + "$ref": "#/components/schemas/Timeline" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + } + }, + "INVALID_MODULE": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string", + "enum": [ + "the module name given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + } + } + }, + "INVALID_ID": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the related id given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + } + } + }, + "INVALID_FILTER": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "the relation name given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + } + } + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "include_inner_details": { + "name": "include_inner_details", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "field_history.data_type", + "field_history.enable_colour_code", + "field_history.field_label", + "field_history.pick_list_values" + ] + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include_timeline_type": { + "name": "include_timeline_type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "extension", + "type" + ] + } + }, + "page_token": { + "name": "page_token", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unblock_email.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unblock_email.json new file mode 100644 index 0000000..c117762 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unblock_email.json @@ -0,0 +1,342 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "unblock_email", + "description": "Unblock Email", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/{module}/actions/unblock_email": { + "post": { + "operationId": "Unblock Emails", + "parameters": [ + { + "$ref": "#/components/parameters/module" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/{module}/{id}/actions/unblock_email": { + "post": { + "operationId": "Unblock email", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "data" + ] + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.send_mail.all.CREATE" + ] + } + ], + "components": { + "schemas": { + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "unblock_fields": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "ids", + "unblock_fields" + ] + }, + "API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "The module name given seems to be invalid", + "invalid oauth token", + "invalid file type", + "Please check if the URL trying to access is a correct one", + "the request does not contain any file", + "The http request method type is not a valid one" + ], + "nullable": true + }, + "details": { + "type": "object", + "nullable": true + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Resource_Path_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "The module name given seems to be invalid", + "invalid oauth token", + "invalid file type", + "Please check if the URL trying to access is a correct one", + "the request does not contain any file", + "The http request method type is not a valid one" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "module": { + "name": "module", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unsubscribe_links.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unsubscribe_links.json new file mode 100644 index 0000000..2f79c78 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/unsubscribe_links.json @@ -0,0 +1,889 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "unsubscribe_links", + "description": "Unsubscribe Link", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/unsubscribe_links": { + "get": { + "operationId": "Get Unsubscribe Links", + "responses": { + "200": { + "$ref": "#/components/responses/UnsubscribeLinks" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Unsubscribe Link", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponseBody" + }, + "400": { + "$ref": "#/components/responses/ErrorResponses" + } + } + }, + "put": { + "operationId": "Update Unsubscribe Links", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponseBody" + }, + "400": { + "$ref": "#/components/responses/ErrorResponses" + } + } + } + }, + "/crm/v8/settings/unsubscribe_links/{id}": { + "get": { + "operationId": "Get Unsubscribe Link", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsubscribeLinks" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Unsubscribe Link", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponseBody" + }, + "400": { + "$ref": "#/components/responses/ErrorResponses" + } + } + }, + "delete": { + "operationId": "Delete Unsubscribe Link", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponseBody" + }, + "400": { + "$ref": "#/components/responses/ErrorResponses" + } + } + } + }, + "/crm/v8/settings/unsubscribe_link/actions/associations": { + "get": { + "operationId": "Get Associated Unsubscribe Links", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "associations": { + "items": { + "$ref": "#/components/schemas/Association_Details" + }, + "type": "array" + } + }, + "required": [ + "associations" + ] + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.unsubscribe.ALL" + ] + } + ], + "components": { + "schemas": { + "Unsubscribe_links": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "page_type": { + "type": "string", + "enum": [ + "standard", + "custom" + ] + }, + "custom_location_url": { + "type": "string", + "nullable": true + }, + "standard_page_message": { + "type": "string", + "nullable": true + }, + "submission_action_type": { + "type": "string", + "enum": [ + "redirect", + "display_message" + ] + }, + "submission_message": { + "type": "string", + "nullable": true + }, + "submission_redirect_url": { + "type": "string", + "nullable": true + }, + "location_url_type": { + "type": "string" + }, + "action_on_unsubscribe": { + "type": "string" + }, + "created_by": { + "$ref": "#/components/schemas/User" + }, + "modified_by": { + "$ref": "#/components/schemas/User" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "landing_url": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name", + "page_type", + "custom_location_url", + "standard_page_message", + "submission_action_type", + "submission_message", + "submission_redirect_url", + "created_by", + "modified_by", + "modified_time", + "created_time", + "landing_url" + ] + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "details": { + "$ref": "#/components/schemas/Id_Detail" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Association_Details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "associated_places": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "resource": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "name" + ] + }, + "details": { + "type": "object", + "properties": { + "module": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id", + "api_name" + ] + } + }, + "required": [ + "module" + ] + } + } + }, + "required": [ + "type", + "resource", + "details" + ] + } + }, + "required": [ + "id", + "associated_places" + ] + }, + "Invalid_Module_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_Detail" + }, + { + "$ref": "#/components/schemas/Id_Detail" + }, + { + "$ref": "#/components/schemas/Apiname_JsonPath_Detail" + }, + { + "$ref": "#/components/schemas/Expected_Type_Detail" + }, + { + "$ref": "#/components/schemas/Maximum_Length_Detail" + }, + { + "$ref": "#/components/schemas/Supported_Values_Detail" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Mandatory_Not_Found_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_Detail" + }, + { + "$ref": "#/components/schemas/Apiname_JsonPath_Detail" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Duplicate_Data_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/Apiname_JsonPath_Detail" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Limit_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "details": { + "$ref": "#/components/schemas/Limit_Detail" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Not_Allowed_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "NOT_ALLOWED" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/Resource_Path_Detail" + }, + { + "$ref": "#/components/schemas/Apiname_JsonPath_Detail" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Dependent_Field_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "details": { + "$ref": "#/components/schemas/Dependee_Detail" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Resource_Path_Detail": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "Id_Detail": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Apiname_JsonPath_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "Expected_Type_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + }, + "Maximum_Length_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "maximum_length": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + }, + "Limit_Detail": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "format": "int32" + }, + "limit_due_to": { + "items": { + "$ref": "#/components/schemas/Apiname_JsonPath_Detail" + }, + "type": "array" + } + }, + "required": [ + "limit", + "limit_due_to" + ] + }, + "Supported_Values_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "api_name", + "json_path", + "supported_values" + ] + }, + "Dependee_Detail": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "dependee": { + "$ref": "#/components/schemas/Apiname_JsonPath_Detail" + } + }, + "required": [ + "api_name", + "json_path", + "dependee" + ] + } + }, + "responses": { + "UnsubscribeLinks": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "unsubscribe_links": { + "items": { + "$ref": "#/components/schemas/Unsubscribe_links" + }, + "type": "array" + } + }, + "required": [ + "unsubscribe_links" + ] + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Not_Allowed_Exception" + } + ] + } + } + } + }, + "SuccessResponseBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "unsubscribe_links": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "unsubscribe_links" + ] + } + ] + } + } + } + }, + "ErrorResponses": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "unsubscribe_links": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Data_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_Not_Found_Exception" + }, + { + "$ref": "#/components/schemas/Duplicate_Data_Exception" + }, + { + "$ref": "#/components/schemas/Limit_Exception" + }, + { + "$ref": "#/components/schemas/Not_Allowed_Exception" + }, + { + "$ref": "#/components/schemas/Dependent_Field_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "unsubscribe_links" + ] + }, + { + "$ref": "#/components/schemas/Invalid_Module_Exception" + } + ] + } + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": {} + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_groups.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_groups.json new file mode 100644 index 0000000..57e365d --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_groups.json @@ -0,0 +1,1472 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "user_groups", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/user_groups": { + "get": { + "operationId": "Get Groups", + "parameters": [ + { + "$ref": "#/components/parameters/include" + }, + { + "$ref": "#/components/parameters/name" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + } + } + }, + "post": { + "operationId": "Create Groups", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Groups", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/{group}": { + "get": { + "operationId": "Get Group", + "parameters": [ + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + }, + "400": { + "$ref": "#/components/responses/InvalidUrlResponse" + } + } + }, + "put": { + "operationId": "Update Group", + "parameters": [ + { + "$ref": "#/components/parameters/group" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Group", + "parameters": [ + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/{group}/sources": { + "get": { + "operationId": "Get Sources", + "parameters": [ + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/user_type" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + }, + "400": { + "$ref": "#/components/responses/InvalidUrlResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/{group}/actions/sources_count": { + "get": { + "operationId": "Get Sources count", + "parameters": [ + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + }, + "400": { + "$ref": "#/components/responses/InvalidUrlResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/actions/deletion_jobs": { + "get": { + "operationId": "Get Status", + "parameters": [ + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + }, + "400": { + "$ref": "#/components/responses/MandatoryParamResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/{group}/actions/associations": { + "get": { + "operationId": "Get Associations", + "parameters": [ + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Association_Status" + }, + "400": { + "$ref": "#/components/responses/InvalidUrlResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/actions/associated_users_count": { + "get": { + "operationId": "Get Associated Users Count", + "parameters": [ + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Associated_UserCount_Response" + }, + "400": { + "$ref": "#/components/responses/InvalidUrlResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/actions/get_assigned": { + "post": { + "operationId": "GetAssignedGroups", + "requestBody": { + "$ref": "#/components/requestBodies/GetAssignBody" + }, + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/actions/get_unassigned": { + "post": { + "operationId": "GetUnassignedGroups", + "requestBody": { + "$ref": "#/components/requestBodies/GetUnassignBody" + }, + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + } + } + } + }, + "/crm/v8/users/{user}/actions/associated_groups": { + "get": { + "operationId": "Get Associate Groups of User", + "parameters": [ + { + "name": "user", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + } + } + } + }, + "/crm/v8/settings/user_groups/{group}/associated_users/actions/grouped_counts": { + "get": { + "operationId": "Get Grouped Counts", + "parameters": [ + { + "$ref": "#/components/parameters/group" + }, + { + "name": "group_by", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/UnsupportedVersionResponse" + }, + "204": { + "description": "" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.user_groups.ALL" + ] + } + ], + "components": { + "schemas": { + "owner": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "sources": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "territories", + "roles", + "users" + ] + }, + "source": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "readOnly": true + } + }, + "required": [ + "id", + "name" + ] + }, + "subordinates": { + "type": "boolean", + "nullable": true + }, + "sub_territories": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "type", + "source", + "subordinates", + "sub_territories" + ] + }, + "groups": { + "type": "object", + "properties": { + "created_by": { + "$ref": "#/components/schemas/owner" + }, + "modified_by": { + "$ref": "#/components/schemas/owner" + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sources_count": { + "$ref": "#/components/schemas/sources_count" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/sources" + } + } + }, + "required": [ + "created_by", + "modified_by", + "modified_time", + "created_time", + "description", + "id", + "name", + "sources_count", + "sources" + ] + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "user_groups": { + "items": { + "$ref": "#/components/schemas/groups" + }, + "type": "array" + } + } + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "user_groups": { + "items": { + "$ref": "#/components/schemas/groups" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "user_groups", + "info" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "ScheduleDetails": { + "type": "object", + "properties": { + "job_id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "job_id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS", + "SCHEDULED" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/details" + }, + { + "$ref": "#/components/schemas/ScheduleDetails" + } + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "user_groups": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "user_groups" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "user_groups": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "user_groups" + ] + }, + "InvalidValueWrapper": { + "type": "object", + "properties": { + "user_groups": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "user_groups" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "user_groups": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "user_groups" + ] + }, + "AssignMandatoryWrapper": { + "type": "object", + "properties": { + "get_assigned": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/ExpectedFieldMissingError" + } + ] + } + }, + "required": [ + "get_assigned" + ] + }, + "AssignInvalidValueWrapper": { + "type": "object", + "properties": { + "get_assigned": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + } + }, + "required": [ + "get_assigned" + ] + }, + "AssignInvalidTypeWrapper": { + "type": "object", + "properties": { + "get_assigned": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + }, + "required": [ + "get_assigned" + ] + }, + "UnAssignMandatoryWrapper": { + "type": "object", + "properties": { + "get_unassigned": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/ExpectedFieldMissingError" + } + ] + } + }, + "required": [ + "get_unassigned" + ] + }, + "UnAssignInvalidValueWrapper": { + "type": "object", + "properties": { + "get_unassigned": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + } + }, + "required": [ + "get_unassigned" + ] + }, + "UnAssignInvalidTypeWrapper": { + "type": "object", + "properties": { + "get_unassigned": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + }, + "required": [ + "get_unassigned" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "jobs": { + "type": "object", + "properties": { + "Status": { + "type": "string" + } + }, + "required": [ + "Status" + ] + }, + "JobsWrapper": { + "type": "object", + "properties": { + "deletion_jobs": { + "items": { + "$ref": "#/components/schemas/jobs" + }, + "type": "array" + } + }, + "required": [ + "deletion_jobs" + ] + }, + "MandatoryParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + }, + "required": [ + "param_name" + ] + }, + "MandatoryParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MandatoryParamDetails" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Association": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "resource": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "detail": { + "type": "object", + "properties": { + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/Minified_Module" + } + } + } + } + }, + "Association_Wrapper": { + "type": "object", + "properties": { + "associations": { + "items": { + "$ref": "#/components/schemas/Association" + }, + "type": "array" + } + } + }, + "users": { + "type": "object", + "properties": { + "inactive": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "deleted": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "active": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "inactive", + "deleted", + "active" + ] + }, + "sources_count": { + "type": "object", + "properties": { + "territories": { + "type": "integer", + "format": "int32" + }, + "roles": { + "type": "integer", + "format": "int32" + }, + "groups": { + "type": "integer", + "format": "int32" + }, + "users": { + "$ref": "#/components/schemas/users" + } + }, + "required": [ + "territories", + "roles", + "groups", + "users" + ] + }, + "associated_users_count": { + "type": "object", + "properties": { + "user_group": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "count": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "user_group", + "count" + ] + }, + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string" + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "api_name", + "id" + ] + }, + "group_operator": { + "type": "string", + "enum": [ + "OR", + "AND" + ] + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + }, + "value": { + "type": "object" + } + }, + "required": [ + "comparator", + "field", + "group_operator", + "group", + "value" + ] + }, + "assign": { + "type": "object", + "properties": { + "feature": { + "type": "string", + "enum": [ + "user_groups" + ] + }, + "related_entity_id": { + "type": "string" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "per_page": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string", + "readOnly": true + }, + "filters": { + "$ref": "#/components/schemas/Criteria" + } + }, + "required": [ + "feature", + "related_entity_id" + ] + }, + "GetAssignWrapper": { + "type": "object", + "properties": { + "get_assigned": { + "$ref": "#/components/schemas/assign" + } + }, + "required": [ + "get_assigned" + ] + }, + "GetUnassignWrapper": { + "type": "object", + "properties": { + "get_unassigned": { + "$ref": "#/components/schemas/assign" + } + }, + "required": [ + "get_unassigned" + ] + } + }, + "responses": { + "UserGroups": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "MandatoryResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + } + ] + } + } + } + }, + "InvalidErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidValueWrapper" + } + ] + } + } + } + }, + "InvalidTypeResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + } + } + } + }, + "InvalidUrlResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + } + ] + } + } + } + }, + "JobStatus": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobsWrapper" + } + } + } + }, + "MandatoryParamResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryParamError" + } + ] + } + } + } + }, + "UnsupportedVersionResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/UnsupportedVersionError" + } + ] + } + } + } + }, + "SourcesCount": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "sources_count": { + "items": { + "$ref": "#/components/schemas/sources_count" + }, + "type": "array" + } + }, + "required": [ + "sources_count" + ] + } + ] + } + } + } + }, + "Sources": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "sources": { + "items": { + "$ref": "#/components/schemas/sources" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "sources", + "info" + ] + } + ] + } + } + } + }, + "Association_Status": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Association_Wrapper" + } + ] + } + } + } + }, + "Associated_UserCount_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "associated_users_count": { + "items": { + "$ref": "#/components/schemas/associated_users_count" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + } + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryParamError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/InvalidValueWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + } + ] + } + } + } + } + }, + "parameters": { + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "name": { + "name": "name", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "user_type": { + "name": "user_type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "group": { + "name": "group", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "job_id": { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "1234567890" + ] + } + }, + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Criteria" + } + ] + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + }, + "GetAssignBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAssignWrapper" + } + } + }, + "required": true + }, + "GetUnassignBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetUnassignWrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_type_users.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_type_users.json new file mode 100644 index 0000000..7714f59 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/user_type_users.json @@ -0,0 +1,530 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "user_type_users", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/portals/{portal_name}/user_type/{user_type_id}/users": { + "get": { + "operationId": "Get Users of User Type", + "parameters": [ + { + "$ref": "#/components/parameters/portal_name" + }, + { + "$ref": "#/components/parameters/user_type_id" + }, + { + "$ref": "#/components/parameters/filters" + }, + { + "$ref": "#/components/parameters/type" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Users" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete User from the Portal", + "parameters": [ + { + "$ref": "#/components/parameters/portal_name" + }, + { + "$ref": "#/components/parameters/user_type_id" + }, + { + "$ref": "#/components/parameters/personality_ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/portals/{portal_name}/user_type/{user_type_id}/users/action/transfer": { + "post": { + "operationId": "Transfer Users of a User Type", + "parameters": [ + { + "$ref": "#/components/parameters/portal_name" + }, + { + "$ref": "#/components/parameters/user_type_id" + }, + { + "$ref": "#/components/parameters/personality_ids" + }, + { + "$ref": "#/components/parameters/transfer_To" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/portals/{portal_name}/user_type/{user_type_id}/users/{user_id}/actions/change_status": { + "put": { + "operationId": "Change Users Status", + "parameters": [ + { + "$ref": "#/components/parameters/portal_name" + }, + { + "$ref": "#/components/parameters/user_type_id" + }, + { + "$ref": "#/components/parameters/user_id" + }, + { + "$ref": "#/components/parameters/active" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/StatusSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/StatusErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.clientportal.ALL" + ] + } + ], + "components": { + "schemas": { + "users": { + "type": "object", + "properties": { + "personality_id": { + "type": "string" + }, + "confirm": { + "type": "boolean" + }, + "status_reason__s": { + "type": "string" + }, + "invited_time": { + "type": "string", + "format": "date-time" + }, + "module": { + "type": "string" + }, + "name": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "email": { + "type": "string" + } + } + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "total_count": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + } + }, + "wrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "$ref": "#/components/schemas/users" + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "details": { + "type": "object", + "properties": { + "personality_id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "personality_id" + ] + }, + "success": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "Action_Wrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "$ref": "#/components/schemas/users" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + } + }, + "error_details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + }, + "API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "$ref": "#/components/schemas/error_details" + } + } + }, + "Status_Action_Wrapper": { + "type": "object", + "properties": { + "change_status": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/success" + } + ] + }, + "type": "array" + } + }, + "required": [ + "change_status" + ] + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Action_Wrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + }, + "Users": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + }, + "StatusSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Status_Action_Wrapper" + } + ] + } + } + } + }, + "StatusErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "change_status": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "change_status" + ] + }, + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + }, + "parameters": { + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "portal_name": { + "name": "portal_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "user_type_id": { + "name": "user_type_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "personality_ids": { + "name": "personality_ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "user_id": { + "name": "user_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "active": { + "name": "active", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + }, + "transfer_To": { + "name": "transfer_To", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users.json new file mode 100644 index 0000000..a6e2113 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users.json @@ -0,0 +1,1602 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "users", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/users": { + "get": { + "operationId": "Get Users", + "parameters": [ + { + "$ref": "#/components/parameters/type" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/ids" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + }, + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Users" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + }, + "post": { + "operationId": "Create Users", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/CreateSuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update Users", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/users/{user}": { + "get": { + "operationId": "Get User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + }, + { + "$ref": "#/components/parameters/X-ZOHO-SERVICE" + }, + { + "$ref": "#/components/parameters/X-ZCSRF-TOKEN" + }, + { + "$ref": "#/components/parameters/If-Modified-Since" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Users" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + }, + "put": { + "operationId": "Update User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/users/{user}/actions/associated_groups": { + "get": { + "operationId": "Get Associated Groups", + "parameters": [ + { + "$ref": "#/components/parameters/user" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Associated_Groups_Response" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + } + }, + "/crm/v8/users/actions/count": { + "get": { + "operationId": "Users Count", + "parameters": [ + { + "$ref": "#/components/parameters/type" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "count": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.users.ALL" + ] + } + ], + "components": { + "schemas": { + "Minified_User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "profile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "owner": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "last_name": { + "type": "string", + "nullable": true + }, + "first_name": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id", + "last_name", + "first_name" + ] + }, + "role": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "customize_info": { + "type": "object", + "properties": { + "notes_desc": { + "type": "object", + "nullable": true + }, + "show_right_panel": { + "type": "object", + "nullable": true + }, + "bc_view": { + "type": "object", + "nullable": true + }, + "unpin_recent_item": { + "type": "object", + "nullable": true + }, + "show_home": { + "type": "boolean", + "nullable": true + }, + "show_detail_view": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "notes_desc", + "show_right_panel", + "bc_view", + "unpin_recent_item", + "show_home", + "show_detail_view" + ] + }, + "tab": { + "type": "object", + "properties": { + "font_color": { + "type": "string", + "enum": [ + "#FFFFFF" + ], + "nullable": true + }, + "background": { + "type": "string", + "enum": [ + "#222222" + ], + "nullable": true + } + }, + "required": [ + "font_color", + "background" + ] + }, + "theme": { + "type": "object", + "properties": { + "normal_tab": { + "$ref": "#/components/schemas/tab" + }, + "selected_tab": { + "$ref": "#/components/schemas/tab" + }, + "new_background": { + "type": "string", + "nullable": true + }, + "background": { + "type": "string", + "enum": [ + "#F3F0EB" + ], + "nullable": true + }, + "screen": { + "type": "string", + "enum": [ + "fixed" + ], + "nullable": true + }, + "type": { + "type": "string" + } + }, + "required": [ + "normal_tab", + "selected_tab", + "new_background", + "background", + "screen", + "type" + ] + }, + "shift": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "name", + "id" + ] + }, + "users": { + "type": "object", + "properties": { + "country": { + "type": "string", + "nullable": true + }, + "language": { + "type": "string" + }, + "microsoft": { + "type": "boolean" + }, + "$shift_effective_from": { + "type": "object", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + }, + "state": { + "type": "string", + "nullable": true + }, + "fax": { + "type": "string", + "nullable": true + }, + "country_locale": { + "type": "string" + }, + "zip": { + "type": "string", + "nullable": true + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "time_format": { + "type": "string", + "enum": [ + "HH:mm", + "hh:mm a" + ], + "nullable": true + }, + "offset": { + "type": "integer", + "format": "int32" + }, + "imap_status": { + "type": "boolean" + }, + "image_link": { + "type": "string", + "nullable": true + }, + "ezuid": { + "type": "string" + }, + "profile": { + "$ref": "#/components/schemas/profile" + }, + "role": { + "$ref": "#/components/schemas/role" + }, + "created_by": { + "$ref": "#/components/schemas/Minified_User" + }, + "full_name": { + "type": "string" + }, + "zuid": { + "type": "string", + "nullable": true + }, + "phone": { + "type": "string", + "nullable": true + }, + "dob": { + "type": "string", + "format": "date", + "nullable": true + }, + "status": { + "type": "string" + }, + "customize_info": { + "$ref": "#/components/schemas/customize_info" + }, + "city": { + "type": "string", + "nullable": true + }, + "signature": { + "type": "string", + "nullable": true + }, + "sort_order_preference__s": { + "type": "string" + }, + "category": { + "type": "string" + }, + "date_format": { + "type": "string", + "enum": [ + "MMM d, yyyy" + ], + "nullable": true + }, + "confirm": { + "type": "boolean" + }, + "decimal_separator": { + "type": "string", + "enum": [ + "Comma", + "Period" + ], + "nullable": true + }, + "number_separator": { + "type": "string", + "enum": [ + "Space" + ], + "nullable": true + }, + "time_zone": { + "type": "object", + "nullable": true + }, + "last_name": { + "type": "string", + "pattern": "[A-Za-z0-9]", + "nullable": true, + "maxLength": 50 + }, + "mobile": { + "type": "string", + "nullable": true + }, + "$current_shift": { + "$ref": "#/components/schemas/shift" + }, + "Reporting_To": { + "$ref": "#/components/schemas/Minified_User" + }, + "Currency": { + "type": "string", + "nullable": true + }, + "$next_shift": { + "$ref": "#/components/schemas/shift" + }, + "Modified_Time": { + "type": "string", + "format": "date-time" + }, + "website": { + "type": "string", + "pattern": "[a-z0-9]{5}[.]com", + "nullable": true + }, + "status_reason__s": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "pattern": "[a-z0-9]{9}[@][a-z0-9]{5}[.]com" + }, + "first_name": { + "type": "string", + "pattern": "[A-Za-z0-9]", + "maxLength": 50 + }, + "sandboxDeveloper": { + "type": "boolean" + }, + "alias": { + "type": "string", + "nullable": true + }, + "street": { + "type": "string", + "nullable": true + }, + "Modified_By": { + "$ref": "#/components/schemas/owner" + }, + "Isonline": { + "type": "boolean" + }, + "locale": { + "type": "string", + "nullable": true + }, + "name_format__s": { + "type": "string", + "enum": [ + "Salutation,First Name,Last Name", + "Saluation,Last Name,First Name", + "First Name,Last Name,Saluation" + ], + "nullable": true + }, + "personal_account": { + "type": "boolean" + }, + "default_tab_group": { + "type": "string" + }, + "theme": { + "$ref": "#/components/schemas/theme" + }, + "ntc_notification_type": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "ntc_enabled": { + "type": "boolean" + }, + "rtl_enabled": { + "type": "boolean" + }, + "telephony_enabled": { + "type": "boolean" + }, + "sort_order_preference": { + "type": "string" + } + } + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "$ref": "#/components/schemas/users" + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "$ref": "#/components/schemas/users" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "users", + "info" + ] + }, + "Associated_Group": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "created_time": { + "type": "string", + "format": "date-time" + }, + "modified_time": { + "type": "string", + "format": "date-time" + }, + "created_by": { + "$ref": "#/components/schemas/Minified_User" + }, + "modified_by": { + "$ref": "#/components/schemas/Minified_User" + } + } + }, + "Associated_Groups_Wrapper": { + "type": "object", + "properties": { + "user_groups": { + "items": { + "$ref": "#/components/schemas/Associated_Group" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + } + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "ErrorDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "ExpectedFieldDetails": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "type": "array" + } + }, + "required": [ + "expected_fields" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND", + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorDetails1" + }, + { + "$ref": "#/components/schemas/ExpectedFieldDetails" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails1" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "DuplicateError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "DuplicateWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DuplicateError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "InvalidTypeDetais": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "regex", + "api_name", + "json_path" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetais" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "MappingDetails": { + "type": "object", + "properties": { + "mapped_field": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "mapped_field", + "api_name", + "json_path" + ] + }, + "InvalidMappingError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MAPPING_MISMATCH" + ] + }, + "details": { + "$ref": "#/components/schemas/MappingDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidMappingWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidMappingError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "MaxLengthDetails": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "maximum_length", + "api_name", + "json_path" + ] + }, + "MaxLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MaxLengthDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MaxLengthWrapper": { + "type": "object", + "properties": { + "users": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MaxLengthError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidParamDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + }, + "InvalidParamError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "PATTERN_NOT_MATCHED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidParamDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + }, + "responses": { + "Users": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "Associated_Groups_Response": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Associated_Groups_Wrapper" + } + ] + } + } + } + }, + "CreateSuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "#/components/schemas/InvalidWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/MaxLengthWrapper" + }, + { + "$ref": "#/components/schemas/DuplicateWrapper" + }, + { + "$ref": "#/components/schemas/InvalidMappingWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/InvalidParamError" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "RInternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "user": { + "name": "user", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "type": { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "ActiveUsers", + "CurrentUser", + "ActiveConfirmedUsers", + "DeactiveUsers", + "NotConfirmedUsers", + "ConfirmedUsers" + ] + } + }, + "X-ZOHO-SERVICE": { + "name": "X-ZOHO-SERVICE", + "in": "header", + "required": false, + "schema": { + "type": "string", + "enum": [ + "crmmobile" + ] + } + }, + "X-ZCSRF-TOKEN": { + "name": "X-ZCSRF-TOKEN", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + "If-Modified-Since": { + "name": "If-Modified-Since", + "in": "header", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "include": { + "name": "include", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "headers": {}, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_territories.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_territories.json new file mode 100644 index 0000000..3e5ca6f --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_territories.json @@ -0,0 +1,620 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "users_territories", + "description": "", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/users/{user}/territories": { + "get": { + "operationId": "Get Territories Of User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Territories" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + }, + "put": { + "operationId": "Associate Territories To User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Remove Territories from User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + }, + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + }, + "/crm/v8/users/{user}/territories/{territory}": { + "get": { + "operationId": "Get Territory Of User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + }, + { + "$ref": "#/components/parameters/territory" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Territories" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + }, + "500": { + "$ref": "#/components/responses/RInternalErrorResponse" + } + } + }, + "delete": { + "operationId": "Remove Territory from User", + "parameters": [ + { + "$ref": "#/components/parameters/user" + }, + { + "$ref": "#/components/parameters/territory" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "500": { + "$ref": "#/components/responses/InternalErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.territories.All" + ] + } + ], + "components": { + "schemas": { + "Manager": { + "type": "object", + "properties": { + "Name": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "Name", + "id" + ] + }, + "territories": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "Manager": { + "$ref": "#/components/schemas/Manager" + }, + "Reporting_To": { + "$ref": "#/components/schemas/Manager" + }, + "Name": { + "type": "string" + } + }, + "required": [ + "id", + "Manager", + "Reporting_To", + "Name" + ] + }, + "info": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "per_page": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "more_records": { + "type": "boolean", + "nullable": true + } + }, + "required": [ + "count", + "page", + "per_page", + "more_records" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "$ref": "#/components/schemas/territories" + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "$ref": "#/components/schemas/territories" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/info" + } + }, + "required": [ + "territories", + "info" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + } + }, + "required": [ + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ], + "nullable": true + }, + "message": { + "type": "string", + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/details" + }, + "status": { + "type": "string", + "enum": [ + "success" + ], + "nullable": true + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + }, + "owner_status": { + "type": "string" + } + }, + "required": [ + "resource_path_index", + "owner_status" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "message", + "details", + "status" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "InvalidWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "territories": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "territories" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + "InternalError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INTERNAL_SERVER_ERROR" + ] + }, + "details": { + "type": "object" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + } + }, + "responses": { + "Territories": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/MandatoryError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidValueError" + }, + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/InvalidWrapper" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + } + ] + } + } + } + }, + "InternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + }, + "RInternalErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InternalError" + } + ] + } + } + } + } + }, + "parameters": { + "user": { + "name": "user", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "territory": { + "name": "territory", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "ids": { + "name": "ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_transfer_delete.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_transfer_delete.json new file mode 100644 index 0000000..1db78eb --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_transfer_delete.json @@ -0,0 +1,667 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "users_transfer_delete", + "description": "Users", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/users/actions/transfer_and_delete": { + "post": { + "operationId": "Users Transfer and Delete", + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "transfer_and_delete": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "transfer_and_delete": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/User_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Not_an_user_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/User_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Not_an_user_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Status", + "parameters": [ + { + "$ref": "#/components/parameters/job_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "transfer_and_delete": { + "items": { + "$ref": "#/components/schemas/Status" + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/User_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Not_an_user_API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/users/{id}/actions/transfer_and_delete": { + "post": { + "operationId": "User Transfer and Delete", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": {} + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "transfer_and_delete": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "transfer_and_delete": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/User_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Not_an_user_API_Exception" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/User_API_Exception" + }, + { + "$ref": "#/components/schemas/Resource_Path_API_Exception" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_Type_API_Exception" + }, + { + "$ref": "#/components/schemas/Not_an_user_API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.users.all" + ] + } + ], + "components": { + "schemas": { + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "User updated", + "User added", + "User deleted" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "jobId": { + "type": "string" + } + } + } + } + }, + "User_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA", + "OAUTH_SCOPE_MISMATCH", + "INVALID_URL_PATTERN", + "PATTERN_NOT_MATCHED", + "ID_ALREADY_DELETED", + "EMAIL_UPDATE_NOT_ALLOWED", + "MANDATORY_NOT_FOUND", + "ID_ALREADY_DEACTIVATED", + "CANNOT_UPDATE_DELETED_USER", + "AUTHORIZATION_FAILED", + "UNAPPROVABLE", + "INVALID_DATA", + "INVALID_REQUEST", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "FEATURE_PERMISSION", + "ID_ALREADY_ACTIVE", + "LICENSE_LIMIT_EXCEEDED", + "EMAIL_UPDATE_NOT_ALOWED" + ] + }, + "message": { + "type": "string", + "enum": [ + "Error occurred in resending the invitation of CRMPLUS user in CRM account", + "Profile and Role cannot be Updated by the user.", + "User is already active", + "Re-invite is not allowed for a confirmed user", + "the id given seems to be invalid", + "Request exceeds your license limit. Need to upgrade in order to add", + "Cannot update email of a confirmed CRM User", + "The http request method type is not a valid one", + "Cannot add user under CRM Plus account. Kindly use CRMPlus URL to add user", + "Company Name is required", + "invalid oauth token", + "Error occurred while updating CRMPlus User in CRM Account", + "Primary Contact cannot be deactivated", + "invalid_data", + "User with same email id is already in CRM Plus", + "invalid data", + "Email Id should not contain @skydesk.jp. Please choose a different email id", + "Either trial has expired or user does not have sufficient privilege to perform this action", + "required field not found", + "Please check if the URL trying to access is a correct one", + "Cannot add user for CRMPlus account from CRM. Kindly add user through CRMPlus", + "Invalid Email Id. Please choose a different email id", + "Deleted user cannot be updated", + "Please check whether the input values are correct", + "Failed to add user since same email id is already present", + "Primary contact cannot be deleted", + "the_id_given_seems_to_be_invalid", + "User is already deleted", + "Cannot update the time_zone of another User", + "User is already deactivated", + "User does not have sufficient privilege to delete users", + "Share among Subordinates Feature is not available" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "email": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + } + } + }, + "Not_an_user_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "owner_status": { + "type": "string" + } + } + } + } + }, + "Resource_Path_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + } + } + } + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + } + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + } + } + }, + "Expected_Data_Type_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid data" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + } + } + } + }, + "transfer": { + "type": "object", + "properties": { + "records": { + "type": "boolean" + }, + "assignment": { + "type": "boolean" + }, + "criteria": { + "type": "boolean" + }, + "id": { + "type": "string" + } + } + }, + "move_subordinate": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "Transfer_and_Delete": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "transfer": { + "$ref": "#/components/schemas/transfer" + }, + "move_subordinate": { + "$ref": "#/components/schemas/move_subordinate" + } + } + }, + "Transfer_and_Delete_By_ID": { + "type": "object", + "properties": { + "transfer": { + "$ref": "#/components/schemas/transfer" + }, + "move_subordinate": { + "$ref": "#/components/schemas/move_subordinate" + } + } + }, + "Status": { + "type": "object", + "properties": { + "status": { + "type": "string" + } + } + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "job_id": { + "name": "job_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_unavailability.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_unavailability.json new file mode 100644 index 0000000..5226b19 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/users_unavailability.json @@ -0,0 +1,936 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "users_unavailability", + "description": "Users Unavailability Hours", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/users_unavailability": { + "post": { + "operationId": "Create Users Unavailability", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + } + ] + } + } + } + } + } + }, + "put": { + "operationId": "Update Users Unavailability", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get Users Unavailability", + "parameters": [ + { + "$ref": "#/components/parameters/include_inner_details" + }, + { + "$ref": "#/components/parameters/group_ids" + }, + { + "$ref": "#/components/parameters/role_ids" + }, + { + "$ref": "#/components/parameters/territory_ids" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_ID_API_Exception" + }, + { + "$ref": "#/components/schemas/Parse_Datatype_API_Exception" + }, + { + "$ref": "#/components/schemas/Invalid_Pattern_API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/users_unavailability/{id}": { + "put": { + "operationId": "Update User Unavailability", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Body_Wrapper" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + } + ] + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url" + } + ] + } + } + } + } + } + }, + "get": { + "operationId": "Get User Unavailability", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/include_inner_details" + }, + { + "$ref": "#/components/parameters/filters" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "204": { + "description": "" + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Invalid_Url" + } + ] + } + } + } + } + } + }, + "delete": { + "operationId": "Delete User Unavailability", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/error" + }, + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.users_unavailability.ALL" + ] + } + ], + "components": { + "schemas": { + "Users_Unavailability": { + "type": "object", + "properties": { + "service": { + "type": "string" + }, + "title": { + "type": "string" + }, + "all_day": { + "type": "boolean" + }, + "tp_calendar_id": { + "type": "string" + }, + "tp_event_id": { + "type": "string" + }, + "comments": { + "type": "string", + "nullable": true, + "maxLength": 250 + }, + "from": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string", + "nullable": true + }, + "to": { + "type": "string", + "format": "date-time" + }, + "user": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "zuid": { + "type": "string" + } + }, + "required": [ + "name", + "id", + "zuid" + ] + } + }, + "required": [ + "service", + "title", + "all_day", + "tp_calendar_id", + "tp_event_id", + "comments", + "from", + "id", + "to", + "user" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string", + "enum": [ + "Unavailability Hours saved successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Success_Wrapper": { + "type": "object", + "properties": { + "users_unavailability": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + } + }, + "Resource_Path_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path", + "expected_data_type" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Expected_Max_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "message": { + "type": "string", + "enum": [ + "required field not found" + ], + "nullable": true + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "nullable": true + }, + "json_path": { + "type": "string", + "nullable": true + }, + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "required": [ + "api_name", + "json_path", + "maximum_length" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_ID_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string", + "enum": [ + "Ids should be Long value with comma separated" + ] + }, + "details": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "format": "int32" + }, + "param_name": { + "type": "string" + } + }, + "required": [ + "index", + "param_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Url": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN" + ] + }, + "message": { + "type": "string", + "enum": [ + "Please check if the URL trying to access is a correct one" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Parse_Datatype_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "UNABLE_TO_PARSE_DATA_TYPE" + ] + }, + "message": { + "type": "string", + "enum": [ + "either the request body or parameters is in wrong format" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Invalid_Pattern_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "PATTERN_NOT_MATCHED" + ] + }, + "message": { + "type": "string", + "enum": [ + "Please check whether the input values are correct" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string", + "enum": [ + "include_inner_details" + ], + "nullable": true + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "Body_Wrapper": { + "type": "object", + "properties": { + "users_unavailability": { + "items": { + "$ref": "#/components/schemas/Users_Unavailability" + }, + "type": "array" + } + }, + "required": [ + "users_unavailability" + ] + }, + "error": { + "type": "object", + "properties": { + "users_unavailability": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Mandatory_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Data_API_Exception" + }, + { + "$ref": "#/components/schemas/Expected_Max_Data_API_Exception" + } + ] + }, + "type": "array" + } + }, + "required": [ + "users_unavailability" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "users_unavailability": { + "items": { + "$ref": "#/components/schemas/Users_Unavailability" + }, + "type": "array" + }, + "info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + } + } + }, + "required": [ + "users_unavailability" + ] + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "include_inner_details": { + "name": "include_inner_details", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "group_ids": { + "name": "group_ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "role_ids": { + "name": "role_ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "territory_ids": { + "name": "territory_ids", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variable_groups.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variable_groups.json new file mode 100644 index 0000000..05bf99d --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variable_groups.json @@ -0,0 +1,255 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "variable_groups", + "description": "Variable Groups", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/variable_groups": { + "get": { + "operationId": "Get Variable Groups", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Variable_Group_API_Exception" + } + ] + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.variable_groups.all", + "ZohoCRM.settings.variable_groups.read" + ] + } + ] + } + }, + "/crm/v8/settings/variable_groups/{id}": { + "get": { + "operationId": "Get Variable Group by ID", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Variable_Group_API_Exception" + } + ] + } + } + } + }, + "204": { + "description": "" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.variable_groups.all", + "ZohoCRM.settings.variable_groups.read" + ] + } + ] + } + }, + "/crm/v8/settings/variable_groups/{api_name}": { + "get": { + "operationId": "Get Variable Group by API Name", + "parameters": [ + { + "$ref": "#/components/parameters/api_name" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + }, + { + "$ref": "#/components/schemas/Variable_Group_API_Exception" + } + ] + } + } + } + }, + "204": { + "description": "" + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.variable_groups.all", + "ZohoCRM.settings.variable_groups.read" + ] + } + ] + } + } + }, + "components": { + "schemas": { + "Minified_Variable_Group": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name" + ] + }, + "Variable_Group": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "display_label", + "api_name", + "name", + "description", + "id" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "variable_groups": { + "items": { + "$ref": "#/components/schemas/Variable_Group" + }, + "type": "array" + } + }, + "required": [ + "variable_groups" + ] + }, + "Variable_Group_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "OAUTH_SCOPE_MISMATCH", + "INVALID_URL_PATTERN", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "message": { + "type": "string", + "enum": [ + "invalid oauth token", + "Please check if the URL trying to access is a correct one", + "The http request method type is not a valid one" + ] + }, + "details": { + "type": "object" + } + }, + "required": [ + "code", + "status", + "message", + "details" + ] + } + }, + "parameters": { + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "api_name": { + "name": "api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variables.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variables.json new file mode 100644 index 0000000..95514d2 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/variables.json @@ -0,0 +1,978 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "variables", + "description": "Variables", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/variables": { + "get": { + "operationId": "Get Variables", + "parameters": [ + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Variables" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Variables", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "put": { + "operationId": "Update Variables", + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Variables", + "parameters": [ + { + "$ref": "#/components/parameters/ids" + } + ], + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/variables/{id}": { + "get": { + "operationId": "Get Variable By ID", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Variables" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "put": { + "operationId": "Update Variable By ID", + "parameters": [ + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/group" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "operationId": "Delete Variable", + "parameters": [ + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/crm/v8/settings/variables/{api_name}": { + "put": { + "operationId": "Update Variable By APIName", + "parameters": [ + { + "$ref": "#/components/parameters/api_name" + }, + { + "$ref": "#/components/parameters/group" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/body" + }, + "responses": { + "201": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "get": { + "operationId": "Get Variable By APIName", + "parameters": [ + { + "$ref": "#/components/parameters/api_name" + }, + { + "$ref": "#/components/parameters/group" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/Variables" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.all", + "ZohoCRM.settings.variables.all", + "ZohoCRM.settings.variables.read" + ] + } + ], + "components": { + "schemas": { + "variable_group": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "api_name", + "name" + ] + }, + "variable": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "source": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "date", + "website", + "double", + "textarea", + "integer", + "percent", + "long", + "datetime", + "phone", + "checkbox", + "currency", + "text", + "email" + ] + }, + "variable_group": { + "$ref": "#/components/schemas/variable_group" + }, + "read_only": { + "type": "boolean" + }, + "value": { + "type": "object", + "nullable": true + } + }, + "required": [ + "api_name", + "name", + "description", + "source", + "id", + "type", + "variable_group", + "read_only", + "value" + ] + }, + "wrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "$ref": "#/components/schemas/variable" + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "$ref": "#/components/schemas/variable" + }, + "type": "array" + } + } + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Success_Response": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "SUCCESS" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "details": { + "$ref": "#/components/schemas/details" + } + }, + "required": [ + "code", + "message", + "status", + "details" + ] + }, + "SuccessWrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Success_Response" + } + ] + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + }, + "ParamDetails": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + }, + "api_name": { + "type": "string" + } + }, + "required": [ + "param_name", + "api_name" + ] + }, + "JSONError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "PATTERN_NOT_MATCHED", + "REQUIRED_PARAM_MISSING", + "JSON_PARSE_ERROR" + ] + }, + "details": { + "oneOf": [ + { + "type": "object" + }, + { + "$ref": "#/components/schemas/ParamDetails" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "ErrorDetails": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "ErrorDetails1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "ExpectedFieldDetails": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "type": "array" + } + }, + "required": [ + "expected_fields" + ] + }, + "MandatoryError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND", + "EXPECTED_FIELD_MISSING" + ] + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/ErrorDetails1" + }, + { + "$ref": "#/components/schemas/ExpectedFieldDetails" + } + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MandatoryWrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MandatoryError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + }, + "DuplicateError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DUPLICATE_DATA" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/ErrorDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "DuplicateWrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/DuplicateError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + }, + "RegexDetails": { + "type": "object", + "properties": { + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "regex", + "api_name", + "json_path" + ] + }, + "InvalidError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/RegexDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidWrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + }, + "InvalidTypeDetais": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "regex": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "regex", + "api_name", + "json_path" + ] + }, + "InvalidTypeError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidTypeDetais" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidTypeWrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidTypeError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + }, + "MaxLengthDetails": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "maximum_length", + "api_name", + "json_path" + ] + }, + "MaxLengthError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ], + "nullable": true + }, + "details": { + "$ref": "#/components/schemas/MaxLengthDetails" + }, + "message": { + "type": "string", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "error" + ], + "nullable": true + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "MaxLengthWrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MaxLengthError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + }, + "InvalidUrlDetails": { + "type": "object", + "properties": { + "resource_path_index": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "resource_path_index" + ] + }, + "InvalidUrlError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "details": { + "$ref": "#/components/schemas/InvalidUrlDetails" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "InvalidIDWrapper": { + "type": "object", + "properties": { + "variables": { + "items": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/schemas/InvalidIDError" + } + ] + }, + "type": "array" + } + }, + "required": [ + "variables" + ] + } + }, + "responses": { + "Variables": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/SuccessWrapper" + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/JSONError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + }, + { + "$ref": "#/components/schemas/InvalidTypeWrapper" + }, + { + "$ref": "#/components/schemas/InvalidWrapper" + }, + { + "$ref": "#/components/schemas/MandatoryWrapper" + }, + { + "$ref": "#/components/schemas/MaxLengthWrapper" + }, + { + "$ref": "#/components/schemas/DuplicateWrapper" + }, + { + "$ref": "#/components/schemas/InvalidIDWrapper" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/InvalidUrlError" + }, + { + "$ref": "#/components/schemas/InvalidTypeError" + }, + { + "$ref": "#/components/schemas/JSONError" + }, + { + "$ref": "#/components/schemas/MandatoryError" + }, + { + "$ref": "#/components/schemas/InvalidError" + } + ] + } + } + } + } + }, + "parameters": { + "ids": { + "name": "ids", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "id": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "api_name": { + "name": "api_name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "group": { + "name": "group", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + }, + "requestBodies": { + "body": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/wrapper" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/wizards.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/wizards.json new file mode 100644 index 0000000..b18365d --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/wizards.json @@ -0,0 +1,949 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "wizards", + "description": "Wizards", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/settings/wizards": { + "get": { + "operationId": "Get Wizards", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + }, + "/crm/v8/settings/wizards/{wizard_id}": { + "get": { + "operationId": "Get Wizard by ID", + "parameters": [ + { + "$ref": "#/components/parameters/wizard_id" + }, + { + "$ref": "#/components/parameters/layout_id" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/API_Exception" + } + ] + } + } + } + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.modules.all", + "ZohoCRM.modules.attachments.all", + "ZohoCRM.modules.attachments.read", + "ZohoCRM.settings.wizards.all" + ] + } + ], + "components": { + "schemas": { + "Portal_User_Type": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "layout": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/layouts.json#/components/schemas/layouts" + }, + "chart_data": { + "$ref": "#/components/schemas/Chart_Data" + }, + "screens": { + "items": { + "$ref": "#/components/schemas/Screen" + }, + "type": "array" + } + } + }, + "Wizard": { + "type": "object", + "properties": { + "created_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "modified_time": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "module": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/modules.json#/components/schemas/modules" + }, + "name": { + "type": "string", + "nullable": true + }, + "modified_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "profiles": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/profiles.json#/components/schemas/Profile" + }, + "type": "array" + }, + "active": { + "type": "boolean", + "nullable": true + }, + "containers": { + "items": { + "$ref": "#/components/schemas/Container" + }, + "type": "array" + }, + "id": { + "type": "string", + "nullable": true + }, + "created_by": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/users.json#/components/schemas/Minified_User" + }, + "portal_user_types": { + "items": { + "$ref": "#/components/schemas/Portal_User_Type" + }, + "type": "array" + }, + "exempted_portal_user_types": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + }, + "parent_wizard": { + "$ref": "#/components/schemas/Wizard" + }, + "draft": { + "type": "boolean" + } + }, + "required": [ + "created_time", + "modified_time", + "name", + "modified_by", + "active", + "containers", + "id", + "created_by" + ] + }, + "Container": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "layout": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/layouts.json#/components/schemas/layouts" + }, + "chart_data": { + "$ref": "#/components/schemas/Chart_Data" + }, + "screens": { + "items": { + "$ref": "#/components/schemas/Screen" + }, + "type": "array" + } + }, + "required": [ + "id" + ] + }, + "Chart_Data": { + "type": "object", + "properties": { + "nodes": { + "items": { + "$ref": "#/components/schemas/Node" + }, + "type": "array" + }, + "connections": { + "items": { + "$ref": "#/components/schemas/Connection" + }, + "type": "array" + }, + "color_palette": { + "type": "object", + "properties": { + "button_background": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "canvas_width": { + "type": "integer", + "format": "int32" + }, + "canvas_height": { + "type": "integer", + "format": "int32" + } + } + }, + "Screen": { + "type": "object", + "properties": { + "display_label": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "reference_id": { + "type": "string" + }, + "conditional_rules": { + "items": { + "$ref": "#/components/schemas/Conditional_Rules" + }, + "type": "array" + }, + "segments": { + "items": { + "$ref": "#/components/schemas/Segment" + }, + "type": "array" + } + }, + "required": [ + "display_label", + "api_name", + "id", + "reference_id" + ] + }, + "Actions": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "segment": { + "$ref": "#/components/schemas/Segment" + }, + "fields": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/fields" + }, + "field": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/fields" + }, + "value": { + "type": "object" + }, + "exempted_profiles": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/profiles.json#/components/schemas/Profile" + }, + "type": "array" + } + }, + "required": [ + "field" + ] + }, + "Conditional_Rules": { + "type": "object", + "properties": { + "query_id": { + "type": "string" + }, + "execute_on": { + "type": "string", + "enum": [ + "create_edit", + "edit", + "create" + ] + }, + "criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "actions": { + "items": { + "$ref": "#/components/schemas/Actions" + }, + "type": "array" + } + }, + "required": [ + "query_id", + "execute_on", + "criteria", + "actions" + ] + }, + "Node": { + "type": "object", + "properties": { + "pos_y": { + "type": "integer", + "format": "int32" + }, + "pos_x": { + "type": "integer", + "format": "int32" + }, + "start_node": { + "type": "boolean" + }, + "screen": { + "$ref": "#/components/schemas/Screen" + } + } + }, + "Segment": { + "type": "object", + "properties": { + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "display_label": { + "type": "string" + }, + "column_count": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "fields": { + "items": { + "$ref": "https://github.com/Zohocorp-Pvt-Ltd/crm-oas/raw/refs/heads/main/v8.0/fields.json#/components/schemas/fields" + }, + "type": "array" + }, + "buttons": { + "items": { + "$ref": "#/components/schemas/Button" + }, + "type": "array" + }, + "elements": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "resource": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "sequence_number", + "display_label", + "column_count", + "id", + "type", + "fields" + ] + }, + "Connection": { + "type": "object", + "properties": { + "source_button": { + "$ref": "#/components/schemas/Button" + }, + "target_screen": { + "$ref": "#/components/schemas/Screen" + }, + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "Transition": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "Criteria": { + "type": "object", + "properties": { + "comparator": { + "type": "string" + }, + "field": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "value": { + "type": "object" + }, + "group_operator": { + "type": "string" + }, + "group": { + "items": { + "$ref": "#/components/schemas/Criteria" + }, + "type": "array" + } + } + }, + "Button": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "sequence_number": { + "type": "integer", + "format": "int32" + }, + "display_label": { + "type": "string" + }, + "criteria": { + "$ref": "#/components/schemas/Criteria" + }, + "target_screen": { + "$ref": "#/components/schemas/Screen" + }, + "type": { + "type": "string" + }, + "message": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "content": { + "type": "string" + } + }, + "required": [ + "title", + "content" + ] + }, + "color": { + "type": "string" + }, + "shape": { + "type": "string" + }, + "background_color": { + "type": "string" + }, + "visibility": { + "type": "string" + }, + "resource": { + "type": "object" + }, + "transition": { + "$ref": "#/components/schemas/Transition" + }, + "category": { + "type": "string" + }, + "reference_id": { + "type": "string" + } + }, + "required": [ + "id", + "display_label", + "criteria", + "type", + "message", + "color", + "shape", + "background_color", + "visibility", + "resource", + "transition", + "category", + "reference_id" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "wizards": { + "items": { + "$ref": "#/components/schemas/Wizard" + }, + "type": "array" + } + } + }, + "API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "OAUTH_SCOPE_MISMATCH", + "INVALID_URL_PATTERN", + "INVALID_DATA", + "INVALID_REQUEST_METHOD", + "INVALID_TOKEN", + "INTERNAL_ERROR" + ] + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "message": { + "type": "string", + "enum": [ + "feature not available in this edition", + "invalid oauth token", + "Invalid Wizard ID", + "Please check if the URL trying to access is a correct one", + "permission denied", + "Internal server error occurred.", + "The http request method type is not a valid one", + "the module name given seems to be invalid" + ] + }, + "details": { + "type": "object", + "properties": { + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "param_name": { + "type": "string" + }, + "api_name": { + "type": "string" + } + } + } + } + }, + "Dependent_Field_API_Exception": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "details": { + "type": "object", + "properties": { + "dependee": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "dependee", + "api_name", + "json_path" + ] + }, + "message": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "error" + ] + } + }, + "required": [ + "code", + "details", + "message", + "status" + ] + }, + "Invalid_Data_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "expected_data_type": { + "type": "string" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "expected_data_type", + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Mandatory_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + }, + "required": [ + "api_name", + "json_path" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Module_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Invalid_Url_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_URL_PATTERN" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Pattern_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "PATTERN_NOT_MATCHED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + }, + "Required_Param_API_Exception": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "REQUIRED_PARAM_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + } + }, + "required": [ + "api_name" + ] + } + }, + "required": [ + "status", + "code", + "message", + "details" + ] + } + }, + "parameters": { + "wizard_id": { + "name": "wizard_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "layout_id": { + "name": "layout_id", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_org_enrichment.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_org_enrichment.json new file mode 100644 index 0000000..3159e36 --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_org_enrichment.json @@ -0,0 +1,972 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "zia_org_enrichment", + "description": "__zia_org_enrichment", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/__zia_org_enrichment": { + "get": { + "operationId": "Get Zia Org Enrichments", + "parameters": [ + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ZiaOrgEnrichment" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Zia Org Enrichment", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/OrgEnrichmentBody" + }, + "responses": { + "202": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "403": { + "$ref": "#/components/responses/NoPermissions" + } + } + } + }, + "/crm/v8/__zia_org_enrichment/{zia_org_enrichment_id}": { + "get": { + "operationId": "Get Zia Org Enrichment", + "parameters": [ + { + "$ref": "#/components/parameters/zia_org_enrichment_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ZiaOrgEnrichment" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.intelligence.All" + ] + } + ], + "components": { + "schemas": { + "address": { + "type": "object", + "properties": { + "country": { + "type": "string" + }, + "city": { + "type": "string" + }, + "pin_code": { + "type": "string" + }, + "state": { + "type": "string" + }, + "fill_address": { + "type": "string" + } + }, + "required": [ + "country", + "city", + "pin_code", + "state", + "fill_address" + ] + }, + "zia_org_enrichment": { + "type": "object", + "properties": { + "enriched_data": { + "type": "object", + "properties": { + "org_status": { + "type": "string" + }, + "description": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + }, + "ceo": { + "type": "string" + }, + "secondary_email": { + "type": "string" + }, + "revenue": { + "type": "string" + }, + "years_in_industry": { + "type": "string" + }, + "other_contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "techno_graphic_data": { + "type": "string" + }, + "logo": { + "type": "string" + }, + "secondary_contact": { + "type": "string" + }, + "id": { + "type": "string" + }, + "other_emails": { + "type": "array", + "items": { + "type": "string" + } + }, + "sign_in": { + "type": "string" + }, + "website": { + "type": "string" + }, + "address": { + "type": "array", + "items": { + "$ref": "#/components/schemas/address" + } + }, + "sign_up": { + "type": "string" + }, + "org_type": { + "type": "string" + }, + "head_quarters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/address" + } + }, + "no_of_employees": { + "type": "string" + }, + "territory_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "founding_year": { + "type": "string" + }, + "industries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + }, + "name": { + "type": "string" + }, + "primary_email": { + "type": "string" + }, + "business_model": { + "type": "array", + "items": { + "type": "string" + } + }, + "primary_contact": { + "type": "string" + }, + "social_media": { + "type": "array", + "items": { + "type": "object", + "properties": { + "media_type": { + "type": "string" + }, + "media_url": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "media_type", + "media_url" + ] + } + } + } + }, + "created_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "created_by": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "status": { + "type": "string" + }, + "enrich_based_on": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "[a-zA-Z]{5}", + "maxLength": 150 + }, + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]google[.]com" + }, + "website": { + "type": "string", + "pattern": "www[.][a-z0-9]+[.][a-z]{3}" + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "created_time", + "id", + "created_by", + "status", + "enrich_based_on" + ] + }, + "Info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + }, + "ZiaOrg_Enrichment": { + "type": "object", + "properties": { + "__zia_org_enrichment": { + "items": { + "$ref": "#/components/schemas/zia_org_enrichment" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + } + }, + "Org_Enrichment": { + "type": "object", + "properties": { + "__zia_org_enrichment": { + "items": { + "$ref": "#/components/schemas/zia_org_enrichment" + }, + "type": "array" + } + }, + "required": [ + "__zia_org_enrichment" + ] + }, + "RESOURCE_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "RESOURCE_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "resource": { + "type": "string" + } + } + } + } + }, + "SUCCESS": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SCHEDULED" + ] + }, + "message": { + "type": "string", + "enum": [ + "Org Enrichment scheduled successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + }, + "DETAIL_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "DETAIL_2": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "DETAIL_4": { + "type": "object", + "properties": { + "resource": { + "type": "string" + }, + "permissions_needed": { + "type": "string" + } + } + }, + "DETAIL_5": { + "type": "object", + "properties": { + "param": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DETAIL_6": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/DETAIL_1" + }, + "type": "array" + } + } + }, + "DETAIL_7": { + "type": "object", + "properties": { + "limit_due_to": { + "items": { + "$ref": "#/components/schemas/DETAIL_1" + }, + "type": "array" + }, + "limit": { + "type": "string" + } + } + }, + "DETAIL_8": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "DETAIL_9": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "format": "int32" + }, + "expected_data_type": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "MANDATORY_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DETAIL_1" + } + } + }, + "EXPECTED_FIELD_MISSING": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DETAIL_6" + } + } + }, + "API_NOT_SUPPORTED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "API_NOT_SUPPORTED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "supported_version": { + "type": "integer", + "format": "int32" + } + } + } + } + }, + "REQUIRED_PARAM_MISSING_EXCEPTION": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "REQUIRED_PARAM_MISSING", + "NOT_ALLOWED", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + } + } + }, + "LIMIT_EXCEEDED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DETAIL_7" + } + } + }, + "INVALID_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "NOT_ALLOWED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/DETAIL_1" + }, + { + "$ref": "#/components/schemas/DETAIL_2" + }, + { + "$ref": "#/components/schemas/DETAIL_4" + }, + { + "$ref": "#/components/schemas/DETAIL_5" + }, + { + "$ref": "#/components/schemas/DETAIL_8" + }, + { + "$ref": "#/components/schemas/DETAIL_9" + } + ] + } + } + }, + "NO_PERMISSION": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION" + ] + }, + "message": { + "type": "string", + "enum": [ + "permission denied" + ] + }, + "details": { + "type": "object" + } + } + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "__zia_org_enrichment": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SUCCESS" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "__zia_org_enrichment": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/EXPECTED_FIELD_MISSING" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING_EXCEPTION" + }, + { + "$ref": "#/components/schemas/NO_PERMISSION" + }, + { + "$ref": "#/components/schemas/API_NOT_SUPPORTED" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING_EXCEPTION" + }, + { + "$ref": "#/components/schemas/NO_PERMISSION" + }, + { + "$ref": "#/components/schemas/API_NOT_SUPPORTED" + } + ] + } + } + } + }, + "ZiaOrgEnrichment": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ZiaOrg_Enrichment" + } + ] + } + } + } + }, + "NoPermissions": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/NO_PERMISSION" + } + ] + } + } + } + } + }, + "parameters": { + "zia_org_enrichment_id": { + "name": "zia_org_enrichment_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "status": { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "COMPLETED", + "FAILED", + "DATA_NOT_FOUND", + "SCHEDULED" + ] + } + } + }, + "requestBodies": { + "OrgEnrichmentBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Org_Enrichment" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file diff --git a/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_people_enrichment.json b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_people_enrichment.json new file mode 100644 index 0000000..301a3fb --- /dev/null +++ b/packages/v1-ready/zoho-crm/specs/openAPI/v8.0/zia_people_enrichment.json @@ -0,0 +1,1098 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "zia_people_enrichment", + "description": "__zia_people_enrichment", + "version": "v8.0" + }, + "servers": [ + { + "url": "https://zohoapis.com" + } + ], + "paths": { + "/crm/v8/__zia_people_enrichment": { + "get": { + "operationId": "Get Zia People Enrichments", + "parameters": [ + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/sort_order" + }, + { + "$ref": "#/components/parameters/sort_by" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/count" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ZiaPeople_Enrichment" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + }, + "post": { + "operationId": "Create Zia People Enrichment", + "parameters": [ + { + "$ref": "#/components/parameters/module" + }, + { + "$ref": "#/components/parameters/record_id" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/PeopleEnrichmentBody" + }, + "responses": { + "202": { + "$ref": "#/components/responses/SuccessResponse" + }, + "400": { + "$ref": "#/components/responses/ErrorResponse" + }, + "403": { + "$ref": "#/components/responses/NoPermissions" + } + } + } + }, + "/crm/v8/__zia_people_enrichment/{zia_people_enrichment_id}": { + "get": { + "operationId": "Get Zia People Enrichment", + "parameters": [ + { + "$ref": "#/components/parameters/zia_people_enrichment_id" + } + ], + "responses": { + "204": { + "description": "" + }, + "200": { + "$ref": "#/components/responses/ZiaPeople_Enrichment" + }, + "400": { + "$ref": "#/components/responses/RErrorResponse" + } + } + } + } + }, + "security": [ + { + "iam-oauth2-schema": [ + "ZohoCRM.settings.intelligence.All" + ] + } + ], + "components": { + "schemas": { + "zia_people_enrichment": { + "type": "object", + "properties": { + "created_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "created_by": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "status": { + "type": "string" + }, + "enriched_data": { + "type": "object", + "properties": { + "website": { + "type": "string" + }, + "email_infos": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "required": [ + "type", + "email" + ] + } + }, + "gender": { + "type": "string" + }, + "company_info": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "industries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + }, + "experiences": { + "items": { + "$ref": "#/components/schemas/experience" + }, + "type": "array" + } + }, + "required": [ + "name", + "industries", + "experiences" + ] + }, + "last_name": { + "type": "string" + }, + "educations": { + "type": "array", + "items": { + "type": "object" + } + }, + "middle_name": { + "type": "string" + }, + "skills": { + "type": "array", + "items": { + "type": "object" + } + }, + "other_contacts": { + "type": "array", + "items": { + "type": "string" + } + }, + "address_list_info": { + "items": { + "$ref": "#/components/schemas/address" + }, + "type": "array" + }, + "primary_address_info": { + "$ref": "#/components/schemas/address" + }, + "name": { + "type": "string" + }, + "secondary_contact": { + "type": "string" + }, + "primary_email": { + "type": "string" + }, + "designation": { + "type": "string" + }, + "id": { + "type": "string" + }, + "interests": { + "type": "array", + "items": { + "type": "object" + } + }, + "first_name": { + "type": "string" + }, + "primary_contact": { + "type": "string" + }, + "social_media": { + "items": { + "$ref": "#/components/schemas/social_media" + }, + "type": "array" + } + } + }, + "enrich_based_on": { + "$ref": "#/components/schemas/enrich_based_on" + } + }, + "required": [ + "created_time", + "id", + "created_by", + "status", + "enriched_data", + "enrich_based_on" + ] + }, + "Info": { + "type": "object", + "properties": { + "per_page": { + "type": "integer", + "format": "int32" + }, + "count": { + "type": "integer", + "format": "int32" + }, + "page": { + "type": "integer", + "format": "int32" + }, + "more_records": { + "type": "boolean" + } + }, + "required": [ + "per_page", + "count", + "page", + "more_records" + ] + }, + "Response_Wrapper": { + "type": "object", + "properties": { + "__zia_people_enrichment": { + "items": { + "$ref": "#/components/schemas/zia_people_enrichment" + }, + "type": "array" + }, + "info": { + "$ref": "#/components/schemas/Info" + } + }, + "required": [ + "__zia_people_enrichment", + "info" + ] + }, + "experience": { + "type": "object", + "properties": { + "end_date": { + "type": "string" + }, + "company_name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "start_date": { + "type": "string" + }, + "primary": { + "type": "boolean" + } + }, + "required": [ + "end_date", + "company_name", + "title", + "start_date", + "primary" + ] + }, + "address": { + "type": "object", + "properties": { + "continent": { + "type": "string" + }, + "country": { + "type": "string" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "primary": { + "type": "boolean" + } + }, + "required": [ + "continent", + "country", + "name", + "region", + "primary" + ] + }, + "social_media": { + "type": "object", + "properties": { + "media_type": { + "type": "string" + }, + "media_url": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "media_type", + "media_url" + ] + }, + "enrich_based_on": { + "type": "object", + "properties": { + "social": { + "type": "object", + "properties": { + "twitter": { + "type": "string", + "pattern": "https[:][/][/]twitter[.]com[/][a-z]{3}" + }, + "facebook": { + "type": "string", + "pattern": "https[:][/][/]facebook[.]com[/][a-z]{3}" + }, + "linkedin": { + "type": "string", + "pattern": "https[:][/][/]linkedin[.]com[/][a-z]{3}" + } + } + }, + "name": { + "type": "string", + "pattern": "[a-zA-Z]{5}", + "maxLength": 150 + }, + "company": { + "type": "object", + "properties": { + "website": { + "type": "string", + "pattern": "www[.][a-z0-9]+[.][a-z]{3}" + }, + "name": { + "type": "string" + } + } + }, + "email": { + "type": "string", + "pattern": "[a-z]{7}[@]google[.]com" + } + }, + "required": [ + "email" + ] + }, + "People_Enrich": { + "type": "object", + "properties": { + "__zia_people_enrichment": { + "items": { + "$ref": "#/components/schemas/zia_people_enrichment" + }, + "type": "array" + } + }, + "required": [ + "__zia_people_enrichment" + ] + }, + "RESOURCE_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "RESOURCE_NOT_FOUND" + ] + }, + "message": { + "type": "string", + "enum": [ + "The requested resource doesn`t exist." + ] + }, + "details": { + "type": "object", + "properties": { + "resource": { + "type": "string" + } + } + } + } + }, + "SUCCESS": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ] + }, + "code": { + "type": "string", + "enum": [ + "SCHEDULED" + ] + }, + "message": { + "type": "string", + "enum": [ + "People Enrichment scheduled successfully" + ] + }, + "details": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + } + } + }, + "DETAIL_1": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "DETAIL_2": { + "type": "object", + "properties": { + "api_name": { + "type": "string" + }, + "expected_data_type": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "DETAIL_4": { + "type": "object", + "properties": { + "permissions_needed": { + "type": "string" + } + } + }, + "DETAIL_5": { + "type": "object", + "properties": { + "param": { + "type": "string" + }, + "supported_values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DETAIL_6": { + "type": "object", + "properties": { + "expected_fields": { + "items": { + "$ref": "#/components/schemas/DETAIL_1" + }, + "type": "array" + } + } + }, + "DETAIL_7": { + "type": "object", + "properties": { + "limit_due_to": { + "items": { + "$ref": "#/components/schemas/DETAIL_1" + }, + "type": "array" + }, + "limit": { + "type": "string" + } + } + }, + "DETAIL_8": { + "type": "object", + "properties": { + "maximum_length": { + "type": "integer", + "format": "int32" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "DETAIL_9": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "format": "int32" + }, + "expected_data_type": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "DETAIL_10": { + "type": "object", + "properties": { + "dependee": { + "$ref": "#/components/schemas/DETAIL_1" + }, + "api_name": { + "type": "string" + }, + "json_path": { + "type": "string" + } + } + }, + "MANDATORY_NOT_FOUND": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "MANDATORY_NOT_FOUND" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DETAIL_1" + } + } + }, + "EXPECTED_FIELD_MISSING": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "EXPECTED_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DETAIL_6" + } + } + }, + "DEPENDENT_FIELD_MISSING": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "DEPENDENT_FIELD_MISSING" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DETAIL_10" + } + } + }, + "REQUIRED_PARAM_MISSING_EXCEPTION": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "REQUIRED_PARAM_MISSING", + "NOT_ALLOWED", + "INVALID_MODULE" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "param_name": { + "type": "string" + } + } + } + } + }, + "LIMIT_EXCEEDED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "LIMIT_EXCEEDED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "$ref": "#/components/schemas/DETAIL_7" + } + } + }, + "INVALID_DATA": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "INVALID_DATA", + "NOT_ALLOWED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "oneOf": [ + { + "$ref": "#/components/schemas/DETAIL_1" + }, + { + "$ref": "#/components/schemas/DETAIL_2" + }, + { + "$ref": "#/components/schemas/DETAIL_4" + }, + { + "$ref": "#/components/schemas/DETAIL_5" + }, + { + "$ref": "#/components/schemas/DETAIL_8" + }, + { + "$ref": "#/components/schemas/DETAIL_9" + } + ] + } + } + }, + "API_NOT_SUPPORTED": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "API_NOT_SUPPORTED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object", + "properties": { + "supported_version": { + "type": "integer", + "format": "int32" + } + } + } + } + }, + "NO_PERMISSION": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "enum": [ + "NO_PERMISSION", + "FEATURE_NOT_ENABLED" + ] + }, + "message": { + "type": "string" + }, + "details": { + "type": "object" + } + } + } + }, + "responses": { + "SuccessResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "__zia_people_enrichment": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SUCCESS" + } + ] + }, + "type": "array" + } + } + } + ] + } + } + } + }, + "ErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "__zia_people_enrichment": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/EXPECTED_FIELD_MISSING" + }, + { + "$ref": "#/components/schemas/DEPENDENT_FIELD_MISSING" + }, + { + "$ref": "#/components/schemas/LIMIT_EXCEEDED" + } + ] + }, + "type": "array" + } + } + }, + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING_EXCEPTION" + }, + { + "$ref": "#/components/schemas/NO_PERMISSION" + }, + { + "$ref": "#/components/schemas/API_NOT_SUPPORTED" + } + ] + } + } + } + }, + "RErrorResponse": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/MANDATORY_NOT_FOUND" + }, + { + "$ref": "#/components/schemas/INVALID_DATA" + }, + { + "$ref": "#/components/schemas/REQUIRED_PARAM_MISSING_EXCEPTION" + }, + { + "$ref": "#/components/schemas/NO_PERMISSION" + }, + { + "$ref": "#/components/schemas/API_NOT_SUPPORTED" + } + ] + } + } + } + }, + "ZiaPeople_Enrichment": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Response_Wrapper" + } + ] + } + } + } + }, + "PeopleEnrichment": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/People_Enrich" + } + ] + } + } + } + }, + "NoPermissions": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/NO_PERMISSION" + } + ] + } + } + } + } + }, + "parameters": { + "zia_people_enrichment_id": { + "name": "zia_people_enrichment_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "page": { + "name": "page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "per_page": { + "name": "per_page", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, + "sort_by": { + "name": "sort_by", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "sort_order": { + "name": "sort_order", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "module": { + "name": "module", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + "record_id": { + "name": "record_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + "status": { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "COMPLETED", + "FAILED", + "DATA_NOT_FOUND", + "SCHEDULED" + ] + } + }, + "count": { + "name": "count", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + }, + "requestBodies": { + "PeopleEnrichmentBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/People_Enrich" + } + } + }, + "required": true + } + }, + "securitySchemes": { + "iam-oauth2-schema": { + "$ref": "https://raw.githubusercontent.com/Zohocorp-Pvt-Ltd/crm-oas/refs/heads/main/v8.0/common.json#/components/securitySchemes/iam-oauth2-schema" + } + } + } +} \ No newline at end of file From 7e495fbd0a1c9cd0836b2b0ec174ee36c1f59207 Mon Sep 17 00:00:00 2001 From: d-klotz Date: Wed, 25 Jun 2025 17:05:02 -0300 Subject: [PATCH 2/2] fix: update Zoho CRM configuration and correct parameter access in token handling --- packages/v1-ready/zoho-crm/defaultConfig.json | 2 +- packages/v1-ready/zoho-crm/definition.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/v1-ready/zoho-crm/defaultConfig.json b/packages/v1-ready/zoho-crm/defaultConfig.json index 5890580..c57e112 100644 --- a/packages/v1-ready/zoho-crm/defaultConfig.json +++ b/packages/v1-ready/zoho-crm/defaultConfig.json @@ -1,5 +1,5 @@ { - "name": "zoho-crm", + "name": "zohoCrm", "label": "Zoho CRM", "productUrl": "https://www.zoho.com/crm/", "apiDocs": "https://www.zoho.com/crm/developer/docs/", diff --git a/packages/v1-ready/zoho-crm/definition.js b/packages/v1-ready/zoho-crm/definition.js index 9c98847..23b4bf5 100644 --- a/packages/v1-ready/zoho-crm/definition.js +++ b/packages/v1-ready/zoho-crm/definition.js @@ -12,7 +12,7 @@ const Definition = { modelName: 'ZohoCRM', requiredAuthMethods: { getToken: async function (api, params) { - const code = get(params.data, 'code'); + const code = get(params, 'code'); return await api.getTokenFromCode(code); }, apiPropertiesToPersist: {