> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Test Webhook

> Pings a webhook with a 'test' event, returns SUCCESS(true) or FAILURE(false) + the response from the webhook target.

NsApiSlow threshold: 2000 ms.
<para />## Online Restricted: ## The Webhook agent is not available in Online by default. Access must be requested specifically when app is registered.



## OpenAPI

````yaml /openapi/agent/openapi-v3-WebhookAgent.json post /api/v1/Agents/Webhook/TestWebhook
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - WebhookAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/Webhook/TestWebhook:
    post:
      tags:
        - Webhook_Agent
      summary: Test Webhook
      description: "Pings a webhook with a 'test' event, returns SUCCESS(true) or FAILURE(false) + the response from the webhook target.\n\nNsApiSlow threshold: 2000 ms.\r\n<para />## Online Restricted: ## The Webhook agent is not available in Online by default. Access must be requested specifically when app is registered."
      operationId: v1WebhookAgent_TestWebhook
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest
        description: Webhook
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.WebhookResult'
            text/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.WebhookResult'
            application/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.WebhookResult'
            text/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.WebhookResult'
            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.WebhookResult'
            application/merge-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.WebhookResult'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.WebhookCarriers.TestWebhookRequest:
      description: >-
        TestWebhook: Pings a webhook with a 'test' event, returns SUCCESS(true)
        or FAILURE(false) + the response from the webhook target.
      type: object
      properties:
        Webhook:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.Webhook'
    SuperOffice.CRM.Services.WebhookResult:
      description: "Result of calling a webhook\r\n<para />\r\nCarrier object for WebhookResult.\r\nServices for the WebhookResult Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IWebhookAgent\">Webhook Agent</see>."
      type: object
      properties:
        Success:
          description: Was call to webhook successful? (200 OK)
          type: boolean
        Message:
          description: Headers and body of response from webhook
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.Webhook:
      description: "Webhook definitions. Webhooks broadcast events from NetServer to remote servers.\r\n<para />\r\nCarrier object for Webhook.\r\nServices for the Webhook Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IWebhookAgent\">Webhook Agent</see>."
      type: object
      properties:
        WebhookId:
          format: int32
          description: Primary Key. Unique id for this webhook.
          type: integer
        Name:
          description: Name to identify this webhook. Does not have to be unique.
          type: string
        Events:
          description: >-
            Array of event names that trigger this webhook: ['contact.created',
            'sale.changed']
          type: array
          items:
            type: string
        TargetUrl:
          description: >-
            Destination to POST event info to. URL for webhooks. Id for CRM
            scripts
          type: string
        Secret:
          description: >-
            Shared secret key used for generating SHA256 HMAC signature, so that
            receiver can verify that call came from this server
          type: string
        State:
          description: >-
            Webhook status - should we post events to the URL? 1=Active,
            2=Stopped or 3=TooManyErrors
          enum:
            - Unknown
            - Active
            - Stopped
            - TooManyErrors
          type: string
        Type:
          description: >-
            Name of plugin that handles this webhook. 'webhook' for HTTP POST
            notifications, 'crmscript' for script invocations.
          type: string
        Headers:
          description: Custom HTTP Headers to add to webhook requests.
          type: object
          additionalProperties:
            type: string
        Properties:
          description: Custom values to inject into JSON body of webhook call.
          type: object
          additionalProperties:
            type: object
        Registered:
          format: date-time
          description: Registered when  in UTC.
          type: string
        RegisteredAssociate:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.Associate'
        Updated:
          format: date-time
          description: Last updated when  in UTC.
          type: string
        UpdatedAssociate:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.Associate'
        ErrorsEmail:
          description: Obsolete, use ErrorEmails instead
          type: string
        ErrorEmails:
          description: Email addresses to notify when this webhook is disabled.
          type: array
          items:
            type: string
        ErrorAssociates:
          description: Associates to notify when this webhook is disabled.
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.MDOListItem'
        Description:
          description: Human-readable description of what this webhook does.
          type: string
        NotifyVia:
          description: >-
            How to notify recipients when this webhook changes state. 1=Email,
            2=InApp.
          enum:
            - None
            - Email
            - InApp
          type: string
        NotifyWhen:
          description: 'When to notify recipients. Bitflag: 1=FirstFailure, 2=Disabling.'
          enum:
            - None
            - FirstFailure
            - Disabling
          type: string
        TotalCalls:
          format: int32
          description: >-
            Number of times webhook has been invoked since registered. For
            statistical purposes.
          type: integer
        TotalErrors:
          format: int32
          description: >-
            Number of times webhook has returned error since registered. For
            statistical purposes.
          type: integer
        ConsecutiveErrors:
          format: int32
          description: >-
            Number of consecutive errors. Reset to 0 when an non-error is
            received. If too many errors, webhook.state is changed to
            TooManyErrors(3) to deactivate webhook.
          type: integer
        LastError:
          description: >-
            Most recent error message received from target. HTTP Headers + body.
            To help with debugging webhooks.
          type: string
    SuperOffice.CRM.Security.TableRight:
      description: "Wraps a table right together with an explanatory reason.\r\nCode can indicate why access is restricted."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string
    SuperOffice.CRM.Security.FieldProperty:
      description: >-
        Class holding properties like field length, field type about a field in
        the carrier.
      type: object
      properties:
        FieldRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldRight'
        FieldType:
          type: string
        FieldLength:
          format: int32
          description: ''
          type: integer
    SuperOffice.CRM.Services.Associate:
      description: "Carrier object for Associate.\r\nServices for the Associate Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IAssociateAgent\">Associate Agent</see>."
      type: object
      properties:
        AssociateId:
          format: int32
          description: Primary key
          type: integer
        Name:
          description: Initials, also login name, possibly database user name
          type: string
        PersonId:
          format: int32
          description: "Owning person record \r\n<para>Use MDO List name \"person\" to get list items.</para>"
          type: integer
        Rank:
          format: int32
          description: Rank order
          type: integer
        Tooltip:
          description: Tooltip or other description
          type: string
        Type:
          description: >-
            User type - 1 = internal user, 2 = resource, 3 = external user, 4 =
            anonymous, 5 = system
          enum:
            - Unknown
            - InternalAssociate
            - ResourceAssociate
            - ExternalAssociate
            - AnonymousAssociate
            - SystemAssociate
          type: string
        GroupIdx:
          format: int32
          description: >-
            Primary group membership, see UserGroupLink for secondary
            memberships
          type: integer
        FullName:
          description: >-
            The associate's culture formatted fullname (firstname, middleName
            and lastname)
          type: string
        FormalName:
          description: >-
            The associate's culture formatted formalname (firstname, middleName
            and lastname, title, mrmrs)
          type: string
        Deleted:
          description: >-
            If true, the user is retired and should have no rights, not appear
            in lists, etc.
          type: boolean
        EjUserId:
          format: int32
          description: >-
            ID of the ej user record corresponding to this associate; 0 for
            associates that are not ej users
          type: integer
        UserName:
          description: User name
          type: string
        ExtraFields:
          description: "Deprecated: Use {SuperOffice.CRM.Services.Associate.CustomFields} instead.\r\nExtra fields added to the carrier. This could be data from Plug-ins, the foreign key system, external applications, etc."
          type: object
          additionalProperties:
            type: string
        CustomFields:
          description: "Udef + Extra fields added to the carrier. Extra fields as defined by changes to database schema + user-defined fields as defined by admin.\r\nCustom fields combines user defined fields and extra fields into one bucket. \r\nThe individual {SuperOffice.CRM.Services.Associate.ExtraFields} and <see cref=\"!:UserDefinedFields\">UserDefinedFields</see> properties are deprecated in favor of this\r\ncombined collection."
          type: object
          additionalProperties:
            type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.MDOListItem:
      description: "Carrier object for MDOListItem.\r\nServices for the MDOListItem Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IMDOAgent\">MDO Agent</see>."
      type: object
      properties:
        Id:
          format: int32
          description: The Id of the ListItem
          type: integer
        Name:
          description: The name of the ListItem
          type: string
        ToolTip:
          description: The tooltip of the ListItem
          type: string
        Deleted:
          description: The deleted status of the ListItem
          type: boolean
        Rank:
          format: int32
          description: The rank of the ListItem
          type: integer
        Type:
          description: The type of the ListItem. Custom field.
          type: string
        ChildItems:
          description: The child items of the MDOListItem
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.MDOListItem'
        IconHint:
          description: The Icon hint of the ListItem. Custom field.
          type: string
        ColorBlock:
          format: int32
          description: The color indicator of the ListItem color block
          type: integer
        ExtraInfo:
          description: >-
            Extra information added to the ListItem. Could be information such
            as sort order etc or other meta data. Custom field.
          type: string
        StyleHint:
          description: >-
            Style hint indicating, information such as background color etc.
            Custom field.
          type: string
        FullName:
          description: The name of the ListItem in its context
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.FieldRight:
      description: "Wraps the field right together with an explanatory reason.\r\nAlso adds logical operators to the field rights so that they can be easily combined."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string

````

## Related topics

- [Test Webhook](/en/api/reference/restful/rest/webhook/test-webhook.md)
- [Webhook subscription](/en/automation/webhook/dev/subscription.md)
- [NSWebhookAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSWebhookAgent.md)
- [SuperOffice.WebApi.Data.Webhook TestWebhookRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Webhook_TestWebhookRequest.md)
- [SuperOffice.WebApi.Agents.WebhookAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.WebhookAgent.md)
- [SuperOffice.WebApi.Agents.IWebhookAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IWebhookAgent.md)
