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

# Subscribe

> Create a new subscription on a webhook.
            
The payload contains the following fields:
- `eventSource`: the name of the webhook to subscribe for. Refer to the Events section to find the list of all available webhooks.
- `targetUrl`: the HTTP callback that will receive the webhook payloads.
            
The response contains the HTTP header `Kiflo-Webhook-SigningKey`. This is a randomly generated signing key used to sign webhook payloads.
            
You must store it securely on your end as it will not be returned again.



## OpenAPI

````yaml /openapi.json post /v3/subscriptions
openapi: 3.0.1
info:
  title: Kiflo Public API v3
  description: "The Kiflo API allows you to have control over your integration and create the best experiences.\r\n\r\n***\r\n\r\n## Format\r\n\r\nThe API follows the REST standard using JSON to format requests and responses.  \r\nDecimals are formatted using invariant culture, ie: using \".\" (dot) as a decimal sperator and no thousands separator.  \r\nDates are formatted using ISO standards, in UTC format, including the timezone. Ex:  2015-03-25T12:00:00Z\r\n\r\n***\r\n\r\n## Security\r\n\r\nThe API is secured using an API token.\r\n\r\n**How to generate an API Access Token**  \r\n 1. Open your [account settings page](https://app.kiflo.com/account/integration)\r\n 2. Go to the \"API Access Token\" section\r\n 3. Click \"Add\" button\r\n 4. Choose a name that will be used to identify the token and click \"Add\"\r\n 4. Copy the generate token\r\n   \r\n> **Note:** For security reason, the generated API Access Token won't be visible after you close the settings page. Be sure to copy the generated token otherwise you won't be able to get it later.\r\n  \r\n**How to authenticate on the API**  \r\n  \r\nTo authenticate on the API, send the generated token in the Authorization header using the Bearer scheme:  \r\n`Authorization: Bearer #YOUR_GENERATED_TOKEN_HERE#`\r\n"
  version: v3
servers: []
security: []
paths:
  /v3/subscriptions:
    post:
      tags:
        - Subscriptions
      summary: Subscribe
      description: "Create a new subscription on a webhook.\r\n            \r\nThe payload contains the following fields:\r\n- `eventSource`: the name of the webhook to subscribe for. Refer to the Events section to find the list of all available webhooks.\r\n- `targetUrl`: the HTTP callback that will receive the webhook payloads.\r\n            \r\nThe response contains the HTTP header `Kiflo-Webhook-SigningKey`. This is a randomly generated signing key used to sign webhook payloads.\r\n            \r\nYou must store it securely on your end as it will not be returned again."
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/SubscriptionCreateRequestDto'
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionCreateRequestDto'
          text/json:
            schema:
              $ref: '#/components/schemas/SubscriptionCreateRequestDto'
          application/*+json:
            schema:
              $ref: '#/components/schemas/SubscriptionCreateRequestDto'
      responses:
        '200':
          description: >-
            Subscription created. Check the `Kiflo-Webhook-SigningKey` response
            header for your signing key.
          content:
            application/json:
              schema:
                type: integer
                format: int32
      security:
        - oauth2:
            - Api
components:
  schemas:
    SubscriptionCreateRequestDto:
      type: object
      properties:
        eventSource:
          $ref: '#/components/schemas/EventSource'
        targetUrl:
          type: string
          description: "The HTTP endpoint that will receive the webhook payloads.\r\nMust be a publicly accessible HTTPS URL."
          nullable: true
          example: https://your-app.com/webhooks/kiflo
      additionalProperties: false
      description: Request body for creating a webhook subscription.
    EventSource:
      enum:
        - Unknown
        - ContactNew
        - ContactUpdate
        - PartnerNew
        - PartnerUpdate
        - PartnerNote
        - PartnerOnboardingStageUpdate
        - PartnerApplicationNew
        - PartnerApplicationAccepted
        - PartnerApplicationRejected
        - PartnerOwnerChanged
        - TeamMemberAdded
        - TeamMemberDeleted
        - DealNew
        - DealUpdate
        - DealApprovalRequire
        - DealAccept
        - DealRefuse
        - DealNote
        - DealScheduledRewardValidation
        - DealAssign
        - DealStageChange
        - LeadNew
        - LeadShare
        - LeadAccept
        - LeadRefuse
        - LeadUpdate
        - LeadNote
        - LeadAssign
        - LeadAbandon
        - LeadOwnerChanged
        - LeadNewFromPartnerDirectory
        - DealExpiration
        - DealExpirationReminder
        - RewardNew
        - CustomerNew
        - CustomerUpdate
        - CustomerNote
        - TransactionNew
        - TransactionUpdate
        - ProgramNewPartnerInLevel
        - PayoutNote
        - PayoutValidated
        - PayoutAccepted
        - PayoutPaid
        - PayoutNew
        - PayoutStatusChange
        - PayoutInvoiceUploaded
        - TaskDueToday
        - TaskAssigned
        - DealQuoteRequested
        - DealClosedWon
        - DealOwnerChanged
        - AssetNew
        - NewsNew
        - OnboardingNewPartnerInStage
        - OnboardingActionWaitingForApproval
        - OnboardingActionValidated
        - OnboardingActionInvalidated
        - TeamMemberCertificationExpired
        - TeamMemberCertificationExpirationReminder
        - CommentNew
        - MentionNew
        - PartnerStatusUpdated
        - PartnerProspectionStageUpdated
        - OnboardingStatusChanged
        - OnboardingStageStatusChanged
        - BusinessPlanObjectiveUpdated
        - PartnerAttachment
        - LeadAttachment
        - DealAttachment
        - CustomerAttachment
        - TransactionAttachment
        - PayoutAttachment
        - CollaborationAttachment
        - AccountMappingOverlap
      type: string

````