{
    "swagger": "2.0",
    "info": {
        "version": "v1",
        "title": "Citrix Cloud Services - 2.1.0.24602"
    },
    "host": "webhooks.citrixworkspacesapi.net",
    "schemes": [
        "https"
    ],
    "paths": {
        "/{customer}/subscriptions": {
            "post": {
                "tags": [
                    "Subscriptions"
                ],
                "summary": "Creates a webhook subscription. [ServiceKey][BearerToken]",
                "operationId": "Subscriptions_Create",
                "consumes": [
                    "application/json",
                    "text/json"
                ],
                "produces": [
                    "application/json",
                    "text/json"
                ],
                "parameters": [
                    {
                        "name": "createModel",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Citrix.CloudServices.WebHooks.Api.Models.CreateWebHookSubscriptionModel"
                        }
                    },
                    {
                        "name": "customer",
                        "in": "path",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "in": "header",
                        "name": "Authorization",
                        "required": true,
                        "type": "string",
                        "description": "Bearer token."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/Citrix.CloudServices.WebHooks.Api.Models.WebHookSubscription"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "Citrix.CloudServices.ApiModels.GetFilter": {
            "type": "object",
            "properties": {
                "take": {
                    "format": "int32",
                    "type": "integer"
                },
                "nextToken": {
                    "type": "string"
                }
            }
        },
        "Citrix.CloudServices.WebHooks.Api.Models.ApiGetAllSubscriptionsResult": {
            "description": "Result of GetAllSubscriptions API",
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Citrix.CloudServices.WebHooks.Api.Models.WebHookSubscription"
                    }
                },
                "continuationToken": {
                    "maxLength": 8192,
                    "minLength": 0,
                    "type": "string"
                }
            }
        },
        "Citrix.CloudServices.WebHooks.Api.Models.WebHookSubscription": {
            "description": "Definition of a WebHookSubscription",
            "type": "object",
            "properties": {
                "id": {
                    "description": "This will be a guid that represents\r\nthe WebHook Subscription",
                    "type": "string"
                },
                "cryptoSecureId": {
                    "description": "This will be a 32-digits random string that represents\r\nthe WebHook Subscription",
                    "maxLength": 100,
                    "minLength": 0,
                    "type": "string"
                },
                "customerId": {
                    "description": "Customer Identifier (could be * for all customers).",
                    "pattern": "^[a-zA-Z0-9]{1,12}|\\*$",
                    "type": "string"
                },
                "customerGeo": {
                    "description": "Gets the customer geo filter (or * for all geos)..",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "serviceProfileId": {
                    "description": "Service Profile Id",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "subscriptionType": {
                    "description": "Type of the subscription. e.g. webhook or service bus topic.",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "url": {
                    "description": "URL to be called when the WebHook\r\nevent occurs",
                    "type": "string"
                },
                "connectionString": {
                    "description": "Connection string of the target service bus entity.",
                    "maxLength": 8192,
                    "minLength": 0,
                    "type": "string"
                },
                "description": {
                    "description": "Description is information provided to\r\nhelp the consumer identify this \r\nwebhook description",
                    "maxLength": 8192,
                    "minLength": 0,
                    "type": "string"
                },
                "authHeaders": {
                    "description": "Authorization headers that should\r\nbe used when the WebHook is delivered",
                    "maxLength": 8192,
                    "minLength": 0,
                    "type": "string"
                },
                "eventType": {
                    "description": "Event type that this webhook will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "changeType": {
                    "description": "Change type that this webhook will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "geo": {
                    "description": "Geo that this subscription will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "resourceProvider": {
                    "description": "Resource Provider this subscription will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "createdBy": {
                    "description": "The admin/service that created the webhook.",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "eTag": {
                    "description": "ETag.",
                    "maxLength": 8192,
                    "minLength": 0,
                    "type": "string"
                },
                "callerServiceIdentity": {
                    "description": "The caller service the webhook will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "created": {
                    "format": "date-time",
                    "description": "The time stamp of the object creation.",
                    "type": "string"
                },
                "updated": {
                    "format": "date-time",
                    "description": "The time stamp of the last time the object was updated.",
                    "type": "string"
                }
            }
        },
        "Citrix.CloudServices.WebHooks.Api.Models.CreateWebHookSubscriptionModel": {
            "description": "The model used to create a webhook subscription.",
            "required": [
                "customerId",
                "eventType"
            ],
            "type": "object",
            "properties": {
                "subscriptionType": {
                    "description": "Type of the subscription. e.g. webhook or service bus topic.",
                    "enum": [
                        "Webhook",
                        "ServiceBusTopic"
                    ],
                    "type": "string"
                },
                "customerId": {
                    "description": "Customer Identifier this webhook will receive notifications for (or * for all customers).",
                    "pattern": "^[a-zA-Z0-9]{1,12}|\\*$",
                    "type": "string"
                },
                "customerGeo": {
                    "description": "Gets the customer geo filter (or * for all geos)..",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "url": {
                    "description": "URL to be called when the WebHook\r\nevent occurs",
                    "type": "string"
                },
                "connectionString": {
                    "description": "Connection string of the target service bus topic.",
                    "maxLength": 8192,
                    "minLength": 0,
                    "pattern": "^([^=;]+=[^=;]+)(;[^=;]+=[^;]+)*$",
                    "type": "string"
                },
                "description": {
                    "description": "Description is information provided to\r\nhelp the consumer identify this \r\nwebhook description",
                    "maxLength": 8192,
                    "minLength": 0,
                    "pattern": "^[^<|^>]+$",
                    "type": "string"
                },
                "authHeaders": {
                    "description": "Authorization headers that should\r\nbe used when the WebHook is delivered",
                    "maxLength": 8192,
                    "minLength": 0,
                    "type": "string"
                },
                "eventType": {
                    "description": "Event type that this webhook will receive notifications for (or * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "changeType": {
                    "description": "Change type that this webhook will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "geo": {
                    "description": "Geo that this subscription will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "resourceProvider": {
                    "description": "Resource Provider this subscription will receive notifications for (could be * for all).",
                    "maxLength": 256,
                    "minLength": 0,
                    "type": "string"
                },
                "recommendedIdGuid": {
                    "description": "Recommended guid to use as subscription Id",
                    "type": "string"
                }
            }
        }
    }
}