123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"productId": {
"type": "string",
"pattern": "^product_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"request": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "import_upload"
},
"kind": {
"$ref": "#/$defs/__schema0"
},
"fileName": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"byteSize": {
"type": "integer",
"minimum": 1,
"maximum": 52428800
}
},
"required": [
"type",
"kind",
"fileName",
"byteSize"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "import_validate"
},
"importId": {
"$ref": "#/$defs/__schema1"
},
"settings": {
"oneOf": [
{
"type": "object",
"properties": {
"format": {
"type": "string",
"const": "csv"
},
"mapping": {
"type": "object",
"propertyNames": {
"$ref": "#/$defs/__schema2"
},
"additionalProperties": {
"$ref": "#/$defs/__schema3"
}
},
"duplicatePolicy": {
"type": "string",
"enum": [
"skip",
"update"
]
}
},
"required": [
"format",
"mapping",
"duplicatePolicy"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"format": {
"type": "string",
"const": "khony-json"
},
"mapping": {
"type": "object",
"properties": {},
"additionalProperties": false
},
"duplicatePolicy": {
"type": "string",
"enum": [
"skip",
"update"
]
}
},
"required": [
"format",
"mapping",
"duplicatePolicy"
],
"additionalProperties": false
}
]
}
},
"required": [
"type",
"importId",
"settings"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "import_change"
},
"importId": {
"$ref": "#/$defs/__schema1"
},
"action": {
"type": "string",
"enum": [
"confirm",
"cancel",
"revert"
]
}
},
"required": [
"type",
"importId",
"action"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "export_create"
},
"kind": {
"$ref": "#/$defs/__schema0"
}
},
"required": [
"type",
"kind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "export_cancel"
},
"exportId": {
"type": "string",
"pattern": "^export_job_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
}
},
"required": [
"type",
"exportId"
],
"additionalProperties": false
}
]
},
"idempotencyKey": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"productId",
"request",
"idempotencyKey"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"type": "string",
"enum": [
"contacts",
"companies"
]
},
"__schema1": {
"type": "string",
"pattern": "^data_import_[0-7][0123456789abcdefghjkmnpqrstvwxyz]{25}$"
},
"__schema2": {
"type": "string",
"maxLength": 200
},
"__schema3": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
}
}