---
title: "Create a webhook"
method: POST
path: "/api/v1/webhooks"
tags: ["Webhooks"]
---

# Create a webhook

`POST /api/v1/webhooks`

Create a webhook.

## Request body

- union
  - object
    - `request_url` string, required — The url to associate with the webhook.
    - `name` string — This field will be sent back to you in the notify_url to help match the added account with your user.
    - `format` 'json' | 'form' — The format of data you recieve from the webhook. Accepted values: json | form
    - `account_ids` string[] — An optional list of account ids to be targeted by the webhook. If not set, the webhook will apply to all current and future accounts connected to Unipile.
    - `enabled` boolean — A boolean to activate or disable the webhook.
    - `headers` object[] — An optional field to add some headers to the webhook.
      - `key` string, required
      - `value` string, required
    - `source` 'messaging', required — A literal to pick the kind of data you expect to receive from the webhook.
    - `events` string[] — An array of events on which the webhook should be triggered. Default value include "message_received".
    - `data` object[]
      - `name` string, required — The name of the property you want to receive. It will replace the original name of the property.
      - `key` 'account_id' | 'account_type' | 'account_info' | 'chat_id' | 'timestamp' | 'webhook_name' | 'message_id' | 'message' | 'mentions' | 'reaction' | 'reaction_sender' | 'read_by' | 'sender' | 'is_sender' | 'attendees' | 'attachments' | 'subject' | 'provider_chat_id' | 'provider_message_id' | 'is_event' | 'chat_pinned' | 'quoted' | 'reply_to' | 'is_forwarded' | 'chat_content_type' | 'message_type' | 'is_group' | 'folder' | 'event_type', required
  - object
    - `request_url` string, required — The url to associate with the webhook.
    - `name` string — This field will be sent back to you in the notify_url to help match the added account with your user.
    - `format` 'json' | 'form' — The format of data you recieve from the webhook. Accepted values: json | form
    - `account_ids` string[] — An optional list of account ids to be targeted by the webhook. If not set, the webhook will apply to all current and future accounts connected to Unipile.
    - `enabled` boolean — A boolean to activate or disable the webhook.
    - `headers` object[] — An optional field to add some headers to the webhook.
      - `key` string, required
      - `value` string, required
    - `source` 'users', required — A literal to pick the kind of data you expect to receive from the webhook.
    - `events` string[] — An array of events on which the webhook should be triggered. Default value include "new_relation".
    - `data` object[]
      - `name` string, required — The name of the property you want to receive. It will replace the original name of the property.
      - `key` 'account_id' | 'account_type' | 'webhook_name' | 'timestamp' | 'user_provider_id' | 'user_full_name' | 'user_public_identifier' | 'user_profile_url' | 'user_picture_url', required
  - object
    - `request_url` string, required — The url to associate with the webhook.
    - `name` string — This field will be sent back to you in the notify_url to help match the added account with your user.
    - `format` 'json' | 'form' — The format of data you recieve from the webhook. Accepted values: json | form
    - `account_ids` string[] — An optional list of account ids to be targeted by the webhook. If not set, the webhook will apply to all current and future accounts connected to Unipile.
    - `enabled` boolean — A boolean to activate or disable the webhook.
    - `headers` object[] — An optional field to add some headers to the webhook.
      - `key` string, required
      - `value` string, required
    - `source` 'account_status', required — A literal to pick the kind of data you expect to receive from the webhook.
    - `events` string[] — An array of events on which the webhook should be triggered. Default settings cover the usual statuses, except for CONNECTING, OK and STOPPED.
  - object
    - `request_url` string, required — The url to associate with the webhook.
    - `name` string — This field will be sent back to you in the notify_url to help match the added account with your user.
    - `format` 'json' | 'form' — The format of data you recieve from the webhook. Accepted values: json | form
    - `account_ids` string[] — An optional list of account ids to be targeted by the webhook. If not set, the webhook will apply to all current and future accounts connected to Unipile.
    - `enabled` boolean — A boolean to activate or disable the webhook.
    - `headers` object[] — An optional field to add some headers to the webhook.
      - `key` string, required
      - `value` string, required
    - `source` 'email', required — A literal to pick the kind of data you expect to receive from the webhook.
    - `events` string[] — An array of events on which the webhook should be triggered. Default value include "mail_received".
    - `data` object[]
      - `name` string, required — The name of the property you want to receive. It will replace the original name of the property.
      - `key` 'email_id' | 'account_id' | 'webhook_name' | 'date' | 'from_attendee' | 'to_attendees' | 'cc_attendees' | 'bcc_attendees' | 'reply_to_attendees' | 'subject' | 'body' | 'body_plain' | 'message_id' | 'provider_id' | 'tracking_id' | 'read_date' | 'is_complete' | 'in_reply_to' | 'has_attachments' | 'attachments' | 'folders' | 'role' | 'origin' | 'thread_id' | 'deprecated_id', required
  - object
    - `request_url` string, required — The url to associate with the webhook.
    - `name` string — This field will be sent back to you in the notify_url to help match the added account with your user.
    - `format` 'json' | 'form' — The format of data you recieve from the webhook. Accepted values: json | form
    - `account_ids` string[] — An optional list of account ids to be targeted by the webhook. If not set, the webhook will apply to all current and future accounts connected to Unipile.
    - `enabled` boolean — A boolean to activate or disable the webhook.
    - `headers` object[] — An optional field to add some headers to the webhook.
      - `key` string, required
      - `value` string, required
    - `source` 'email_tracking', required — A literal to pick the kind of data you expect to receive from the webhook.
    - `events` string[] — An array of events on which the webhook should be triggered. Default value include "mail_opened".
    - `data` object[]
      - `name` string, required — The name of the property you want to receive. It will replace the original name of the property.
      - `key` 'event_id' | 'tracking_id' | 'type' | 'date' | 'email_id' | 'account_id' | 'ip' | 'user_agent' | 'url' | 'label' | 'custom_domain', required
  - object
    - `request_url` string, required — The url to associate with the webhook.
    - `name` string — This field will be sent back to you in the notify_url to help match the added account with your user.
    - `format` 'json' | 'form' — The format of data you recieve from the webhook. Accepted values: json | form
    - `account_ids` string[] — An optional list of account ids to be targeted by the webhook. If not set, the webhook will apply to all current and future accounts connected to Unipile.
    - `enabled` boolean — A boolean to activate or disable the webhook.
    - `headers` object[] — An optional field to add some headers to the webhook.
      - `key` string, required
      - `value` string, required
    - `source` 'calendar_event', required — A literal to pick the kind of data you expect to receive from the webhook.
    - `events` string[] — An array of events on which the webhook should be triggered. Default value include "calendar_event_created".
    - `data` object[]
      - `name` string, required — The name of the property you want to receive. It will replace the original name of the property.
      - `key` 'account_id' | 'account_type' | 'id' | 'ical_uid' | 'master_event_id' | 'calendar_id' | 'created_at' | 'updated_at' | 'title' | 'body' | 'location' | 'is_cancelled' | 'is_all_day' | 'is_attendees_list_hidden' | 'attendees' | 'start' | 'end' | 'recurrence' | 'organizer' | 'conference_id' | 'conference' | 'visibility' | 'transparency' | 'event_type' | 'color', required

## Response `201`

Created. Webhook sucessfully added.

- object
  - `object` 'WebhookCreated', required
  - `webhook_id` string, required

## Other responses

- `400` — ## Bad Request ### Invalid parameters - Type: "errors/invalid_parameters" One or more request parameters are invalid or missing. ### Missing parameters - Type: "errors/missing_parameters" One or more request parameters are missing. ### Invalid parameters - Type: "errors/invalid_request" One or a combination of request parameters are invalid. ### Malformed request - Type: "errors/malformed_request" The given request has been rejected by the provider. ### Content too large - Type: "errors/content_too_large" The request payload or filter query is too large and has been rejected by the provider. ### Too many characters - Type: "errors/too_many_characters" The provided content exceeds the character limit. ### Unescaped characters - Type: "errors/unescaped_characters" The request path contains unescaped characters. ### Limit too high - Type: "errors/limit_too_high" Provider cannot accept such high pagination limit. See API reference for details. ### Invalid action - Type: "errors/invalid_action" This action is invalid. ### Invalid label - Type: "errors/invalid_label" This label is invalid.
- `401` — ## Unauthorized ### Missing credentials - Type: "errors/missing_credentials" Some credentials are necessary to perform the request. ### Multiple sessions - Type: "errors/multiple_sessions" LinkedIn limits the use of multiple sessions on certain Recruiter accounts. This error restricts access to this route only, but causing a popup to appear in the user's browser, prompting them to choose a session, which can disconnect the current account. To avoid this error, use the cookie connection method. ### Wrong account - Type: "errors/wrong_account" The provided credentials do not match the correct account. ### Invalid credentials - Type: "errors/invalid_credentials" The provided credentials are invalid. ### Invalid proxy credentials - Type: "errors/invalid_proxy_credentials" The provided proxy credentials are invalid. ### Invalid IMAP configuration - Type: "errors/invalid_imap_configuration" The provided IMAP configuration is invalid. ### Invalid SMTP configuration - Type: "errors/invalid_smtp_configuration" The provided SMTP configuration is invalid. ### Invalid checkpoint solution - Type: "errors/invalid_checkpoint_solution" The checkpoint resolution did not pass successfully. Please retry. ### Checkpoint error - Type: "errors/checkpoint_error" The checkpoint does not appear to be resolvable. Please try again and contact support if the problem persists. ### Expired credentials - Type: "errors/expired_credentials" Invalid credentials. Please check your username and password and try again. ### Expired link - Type: "errors/expired_link" This link has expired. Please return to the application and generate a new one. ### Insufficient privileges - Type: "errors/insufficient_privileges" This resource seems to be out of your scopes. ### Disconnected account - Type: "errors/disconnected_account" The account appears to be disconnected from the provider service. ### Disconnected feature - Type: "errors/disconnected_feature" The service you're trying to reach appears to be disconnected.
- `403` — ## Forbidden ### Insufficient permissions - Type: "errors/insufficient_permissions" Valid authentication but insufficient permissions to perform the request. ### Account restricted - Type: "errors/account_restricted" Access to this account has been restricted by the provider. ### Account mismatch - Type: "errors/account_mismatch" This action cannot be done with your account. ### Unknown authentication context - Type: "errors/unknown_authentication_context" An additional step seems necessary to complete login. Please connect to provider with your browser to find out more, then retry authentication. ### Session mismatch - Type: "errors/session_mismatch" Token User id does not match client session id. ### Feature not subscribed - Type: "errors/feature_not_subscribed" The requested feature has either not been subscribed or not been authenticated properly. ### Subscription required - Type: "errors/subscription_required" The action you're trying to achieve requires a subscription to provider's services. ### Resource access restricted - Type: "errors/resource_access_restricted" You don't have access to this resource. ### Action required - Type: "errors/action_required" An additional step seems necessary. Complete authentication on the provider's native application and try again.
- `404` — ## Not Found ### Resource not found. The requested resource were not found. Account not found
- `500` — ## Internal Server Error ### Unexpected error - Type: "errors/unexpected_error" Something went wrong. {{moreDetails}} ### Provider error - Type: "errors/provider_error" The provider is experiencing operational problems. Please try again later. ### Authentication intent error - Type: "errors/authentication_intent_error" The current authentication intent was killed after failure. Please start the process again from the beginning.
- `503` — ## Service Unavailable ### No client session - Type: "errors/no_client_session" No client session is currently running. ### No channel - Type: "errors/no_channel" No channel to client session. ### Handler missing - Type: "errors/no_handler" Handler missing for that request. ### Network down - Type: "errors/network_down" Network is down on server side. Please wait a moment and retry. ### Service unavailable - Type: "errors/service_unavailable" Please try again later.
- `504` — ## Gateway Timeout ### Request timed out - Type: "errors/request_timeout" Request Timeout. Please try again, and if the issue persists, contact support.

---

[API](https://skmtc.net/unipile/apis/unipile-api-reference.md) · [All operations](https://skmtc.net/unipile/apis/unipile-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unipile/unipile-api-reference/revisions/3483a34061f6/schema)
