---
updatedAt: 2025-05-15T21:03:13.000Z
agentTools:
  projectIndex: https://docs.youlend.com/llms.txt
---

# Creates a subscription to the provided list of events. Notifications will be sent to the provided WebhookURL

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "YouLend Third Party Notification API",
    "description": "Through this API you can subscribe to events and get notified of these events via webhook",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://partners.staging-youlendapi.com/notification"
    }
  ],
  "paths": {
    "/WebhookSubscription": {
      "post": {
        "tags": [
          "WebhookSubscription"
        ],
        "summary": "Creates a subscription to the provided list of events. Notifications will be sent to the provided WebhookURL",
        "parameters": [
          {
            "name": "api-version",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "A YL.Web.Api.ThirdParty.Notification.Models.WebhookSubscriptionModel containing the data required to create a webhook subscription",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSubscriptionModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns a WebhookNotificationSubscriptionResultModel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookNotificationSubscriptionResultModel"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookNotificationSubscriptionResultModel"
                }
              }
            }
          },
          "400": {
            "description": "Something went wrong!"
          },
          "401": {
            "description": "Unauthorized request"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "WebhookNotificationSubscriptionResultModel": {
        "type": "object",
        "properties": {
          "subscriptionId": {
            "type": "string",
            "description": "Gets or sets the SubscriptionId",
            "format": "uuid"
          },
          "webhookUrl": {
            "type": "string",
            "description": "Gets or sets the WebhookUrl",
            "nullable": true
          },
          "webhookSecretKey": {
            "type": "string",
            "description": "Gets or sets the SecretKey",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The result of creating a webhook subscription"
      },
      "WebhookSubscriptionModel": {
        "required": [
          "eventCodes",
          "webhookUrl"
        ],
        "type": "object",
        "properties": {
          "eventCodes": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Gets or sets the Events Codes"
          },
          "webhookUrl": {
            "maxLength": 1000,
            "minLength": 1,
            "type": "string",
            "description": "Gets or sets the webhook URL"
          }
        },
        "additionalProperties": false,
        "description": "A model representing the webhook subscription for list of events"
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://youlend-stag.eu.auth0.com/oauth/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```