{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://cpobjects.mycpl.net/schema/subscriber.json", "title": "Subscriber", "description": "Communication channel subscriber", "type": "object", "properties": { "token": { "description": "Unique ID of the channel", "type": "string" }, "type": { "description": "Type of the subscriber: TODO add more fields for other types", "type": "string", "enum": ["user", "bot"] }, "user": { "description": "User account of the subscriber", "type": "object", "$ref": "./user.json" }, "phone": { "description": "Phone number of the subscriber", "type": "string" }, "email": { "description": "Email of the subscriber", "type": "string" }, "provider_relations": { "description": "Array of provider tokens", "type": "array", "items": { "type": "object", "$ref": "./provider_relation.json" }, "minItems": 1 }, "created_at": { "description": "Date-Time of create", "$ref": "./definitions/date_time.json" }, "updated_at": { "description": "Date-Time of update", "$ref": "./definitions/date_time.json" } }, "oneOf": [ { "required": [ "phone" ] }, { "required": [ "email" ] } ] }