# Create a webhook

Endpoint: POST /webhooks
Version: 1.0.450.36533
Security: OAuth2

## Request fields (application/json):

  - `Name` (string, required)

  - `ID` (string)

  - `Description` (string)

  - `Url` (string)
    URL the webhook will POST data to, likely a route within your middleware. Required unless there is a valid DeliveryConfig.

  - `HashKey` (string)
    Security feature that allows your middleware to verify the digital signature in the request header to ensure you only accept trusted data.

  - `ElevatedRoles` (array)
    If you need additional data not provided by the webhook payload, you can request any elevated roles needed to make additional calls.
    Enum: "ApiClientAdmin", "ApiClientReader", "AddressAdmin", "AddressReader", "AdminAddressAdmin", "AdminAddressReader", "AdminUserAdmin", "AdminUserGroupAdmin", "AdminUserGroupReader", "AdminUserReader", "ApprovalRuleAdmin", "ApprovalRuleReader", "BulkReader", "BundleAdmin", "BundleAssignmentAdmin", "BundleReader", "BuyerAdmin", "BuyerImpersonation", "BuyerReader", "BuyerUserAdmin", "BuyerUserReader", "CatalogAdmin", "CatalogReader", "CategoryAdmin", "CategoryReader", "CostCenterAdmin", "CostCenterReader", "CreditCardAdmin", "CreditCardReader", "EntitySyncConfigAdmin", "FullAccess", "IncrementorAdmin", "IncrementorReader", "LocaleReader", "LocaleAdmin", "MeAddressAdmin", "MeAdmin", "MeCreditCardAdmin", "MessageConfigAssignmentAdmin", "MeSubscriptionAdmin", "MeXpAdmin", "OrderAdmin", "OrderReader", "OverrideShipping", "OverrideTax", "OverrideUnitPrice", "PasswordReset", "PriceScheduleAdmin", "PriceScheduleReader", "ProductAdmin", "ProductAssignmentAdmin", "ProductCollectionReader", "ProductFacetAdmin", "ProductFacetReader", "ProductReader", "ProductSyncConfigAdmin", "PromotionAdmin", "PromotionReader", "SecurityProfileAdmin", "SecurityProfileReader", "SetSecurityProfile", "ShipmentAdmin", "ShipmentReader", "Shopper", "SpendingAccountAdmin", "SpendingAccountReader", "SubscriptionAdmin", "SubscriptionReader", "SupplierAddressAdmin", "SupplierAddressReader", "SupplierAdmin", "SupplierReader", "SupplierUserAdmin", "SupplierUserGroupAdmin", "SupplierUserGroupReader", "SupplierUserReader", "UnsubmittedOrderReader", "UserGroupAdmin", "UserGroupReader", "OpenIDConnectReader", "OpenIDConnectAdmin", "MessageSenderReader", "MessageSenderAdmin", "XpIndexAdmin", "WebhookReader", "WebhookAdmin", "IntegrationEventReader", "IntegrationEventAdmin", "TrackingEventReader", "TrackingEventAdmin", "DeliveryConfigAdmin", "OrderSyncConfigAdmin", "ErrorConfigAdmin"

  - `ConfigData` (object)
    Example: {}

  - `BeforeProcessRequest` (boolean)
    If true, the webhook is processed prior to the call being made and OrderCloud waits for a response before proceeding.

  - `ApiClientIDs` (array)
    List of API client IDs the webhook will be triggered for.
    Example: [""]

  - `WebhookRoutes` (array)
    List of routes the webhook will be triggered for.
    Example: [{"Route":"","Verb":""}]

  - `WebhookRoutes.Route` (string)

  - `WebhookRoutes.Verb` (string)

  - `DeliveryConfigID` (string)

  - `CustomAuthHeaderName` (string)
    The header name that can be passed to your middleware.

  - `CustomAuthHeaderValue` (string)
    The header value that can be passed to your middleware.

## Response 201 fields (application/json):

  - `ID` (string)

  - `Name` (string)

  - `Description` (string)

  - `Url` (string)
    URL the webhook will POST data to, likely a route within your middleware. Required unless there is a valid DeliveryConfig.

  - `HashKey` (string)
    Security feature that allows your middleware to verify the digital signature in the request header to ensure you only accept trusted data.

  - `ElevatedRoles` (array)
    If you need additional data not provided by the webhook payload, you can request any elevated roles needed to make additional calls.
    Enum: "ApiClientAdmin", "ApiClientReader", "AddressAdmin", "AddressReader", "AdminAddressAdmin", "AdminAddressReader", "AdminUserAdmin", "AdminUserGroupAdmin", "AdminUserGroupReader", "AdminUserReader", "ApprovalRuleAdmin", "ApprovalRuleReader", "BulkReader", "BundleAdmin", "BundleAssignmentAdmin", "BundleReader", "BuyerAdmin", "BuyerImpersonation", "BuyerReader", "BuyerUserAdmin", "BuyerUserReader", "CatalogAdmin", "CatalogReader", "CategoryAdmin", "CategoryReader", "CostCenterAdmin", "CostCenterReader", "CreditCardAdmin", "CreditCardReader", "EntitySyncConfigAdmin", "FullAccess", "IncrementorAdmin", "IncrementorReader", "LocaleReader", "LocaleAdmin", "MeAddressAdmin", "MeAdmin", "MeCreditCardAdmin", "MessageConfigAssignmentAdmin", "MeSubscriptionAdmin", "MeXpAdmin", "OrderAdmin", "OrderReader", "OverrideShipping", "OverrideTax", "OverrideUnitPrice", "PasswordReset", "PriceScheduleAdmin", "PriceScheduleReader", "ProductAdmin", "ProductAssignmentAdmin", "ProductCollectionReader", "ProductFacetAdmin", "ProductFacetReader", "ProductReader", "ProductSyncConfigAdmin", "PromotionAdmin", "PromotionReader", "SecurityProfileAdmin", "SecurityProfileReader", "SetSecurityProfile", "ShipmentAdmin", "ShipmentReader", "Shopper", "SpendingAccountAdmin", "SpendingAccountReader", "SubscriptionAdmin", "SubscriptionReader", "SupplierAddressAdmin", "SupplierAddressReader", "SupplierAdmin", "SupplierReader", "SupplierUserAdmin", "SupplierUserGroupAdmin", "SupplierUserGroupReader", "SupplierUserReader", "UnsubmittedOrderReader", "UserGroupAdmin", "UserGroupReader", "OpenIDConnectReader", "OpenIDConnectAdmin", "MessageSenderReader", "MessageSenderAdmin", "XpIndexAdmin", "WebhookReader", "WebhookAdmin", "IntegrationEventReader", "IntegrationEventAdmin", "TrackingEventReader", "TrackingEventAdmin", "DeliveryConfigAdmin", "OrderSyncConfigAdmin", "ErrorConfigAdmin"

  - `ConfigData` (object)
    Example: {}

  - `BeforeProcessRequest` (boolean)
    If true, the webhook is processed prior to the call being made and OrderCloud waits for a response before proceeding.

  - `ApiClientIDs` (array)
    List of API client IDs the webhook will be triggered for.
    Example: [""]

  - `WebhookRoutes` (array)
    List of routes the webhook will be triggered for.
    Example: [{"Route":"","Verb":""}]

  - `DeliveryConfigID` (string)

  - `CustomAuthHeaderName` (string)
    The header name that can be passed to your middleware.

  - `CustomAuthHeaderValue` (string)
    The header value that can be passed to your middleware.

## Response 4XX fields (application/json):

  - `StatusCode` (integer)
    Example: "404"

  - `ErrorCode` (string)
    Example: "NotFoundError"

  - `Message` (string)
    Example: "Object not found"

  - `Data` (object)
    Example: {"ObjectType":"","ObjectID":""}


