# Create App
Source: https://docs.vartiq.com/api-reference/apps/create-app
POST /apps
### Body Parameters
Name of the app
Optional description of the app
The unique identifier of the project this app belongs to
### Response
Indicates if the request was successful
A message describing the result of the operation
The created app object
Unique identifier for the app
Name of the app
Description of the app (if provided)
Environment of the app ("development" or "production")
Timestamp when the app was created
Timestamp when the app was last updated
### Response Example
```json theme={null}
{
"success": true,
"message": "App created successfully",
"data": {
"id": "app_01JT3854RQEQC8BXN79H2B1YSV",
"name": "second app",
"description": "",
"environment": "development",
"createdAt": "2025-04-30T11:43:46.469Z",
"updatedAt": "2025-04-30T11:43:46.469Z"
}
}
```
# Delete App
Source: https://docs.vartiq.com/api-reference/apps/delete-app
DELETE /apps/{appId}
### Headers
The unique identifier of your company
### URL Parameters
The unique identifier of the app to delete
### Response
Indicates if the request was successful
A message describing the result of the operation
### Response Example
```json
{
"success": true,
"message": "App deleted successfully"
}
```
# Get App
Source: https://docs.vartiq.com/api-reference/apps/get-app
GET /apps/{appId}
### Headers
The unique identifier of your company
### URL Parameters
The unique identifier of the app
### Response
Indicates if the request was successful
A message describing the result of the operation
The app object
Unique identifier for the app
Name of the app
Description of the app (if provided)
Environment of the app ("development" or "production")
Timestamp when the app was created
Timestamp when the app was last updated
### Response Example
```json
{
"success": true,
"message": "App retrieved successfully",
"data": {
"id": "app_01JT38AK6GH3VXP2PPH5BTF36X",
"name": "second app",
"description": "",
"environment": "development",
"createdAt": "2025-04-30T11:46:45.092Z",
"updatedAt": "2025-04-30T11:46:45.092Z"
}
}
```
# Get Apps
Source: https://docs.vartiq.com/api-reference/apps/get-apps
GET /apps
### Headers
The unique identifier of your company
### Query Parameters
Filter apps by project ID
Filter apps by environment ("development" or "production")
Maximum number of apps to return
Number of apps to skip for pagination
### Response
Indicates if the request was successful
A message describing the result of the operation
Array of app objects
Unique identifier for the app
Name of the app
Description of the app (if provided)
Environment of the app ("development" or "production")
Timestamp when the app was created
Timestamp when the app was last updated
### Response Example
```json
{
"success": true,
"message": "Apps retrieved successfully",
"data": [
{
"id": "app_01JT38AK6GH3VXP2PPH5BTF36X",
"name": "second app",
"description": "",
"environment": "development",
"createdAt": "2025-04-30T11:46:45.092Z",
"updatedAt": "2025-04-30T11:46:45.092Z"
},
{
"id": "app_01JSZ1B53E22QS6TA3441ZTSFS",
"name": "Production App",
"description": "Production app",
"environment": "production",
"createdAt": "2025-04-28T20:27:45.648Z",
"updatedAt": "2025-04-28T20:27:45.648Z"
}
]
}
```
# Update App
Source: https://docs.vartiq.com/api-reference/apps/update-app
PUT /apps/{appId}
### Headers
The unique identifier of your company
### URL Parameters
The unique identifier of the app to update
### Body Parameters
New name for the app
New description for the app
### Response
Indicates if the request was successful
A message describing the result of the operation
The updated app object
Unique identifier for the app
Updated name of the app
Updated description of the app (if provided)
Environment of the app ("development" or "production")
Timestamp when the app was created
Timestamp when the app was last updated
### Response Example
```json
{
"success": true,
"message": "App updated successfully",
"data": {
"id": "app_01JT38PHYK11F3X3M4772HE3TK",
"name": "hello app",
"description": "hello1",
"environment": "development",
"createdAt": "2025-04-30T11:53:17.020Z",
"updatedAt": "2025-04-30T11:53:44.548Z"
}
}
```
# Create Project
Source: https://docs.vartiq.com/api-reference/projects/create-project
POST /projects
### Body Parameters
Name of the project
Optional description of the project
### Response
Indicates if the request was successful
A message describing the result of the operation
The created project object
Unique identifier for the project
Name of the project
Description of the project (if provided)
Timestamp when the project was created
Timestamp when the project was last updated
### Response Example
```json
{
"success": true,
"message": "Project created successfully",
"data": {
"id": "proj_01JTD1G189Y47YNPWNJDYRXW39",
"name": "New Project",
"createdAt": "2025-05-04T06:59:47.599Z",
"updatedAt": "2025-05-04T06:59:47.599Z"
}
}
```
# Delete Project
Source: https://docs.vartiq.com/api-reference/projects/delete-project
DELETE /api/v1/projects/{projectId}
### URL Parameters
The unique identifier of the project to delete
### Response
Indicates if the request was successful
A message describing the result of the operation
### Response Example
```json
{
"success": true,
"message": "Project deleted successfully"
}
```
# Get Project
Source: https://docs.vartiq.com/api-reference/projects/get-project
GET /api/v1/projects/{projectId}
### URL Parameters
The unique identifier of the project
### Response
Indicates if the request was successful
A message describing the result of the operation
The project object
Unique identifier for the project
Name of the project
Description of the project (if provided)
Company ID associated with the project
Environment of the project (e.g., "development")
Timestamp when the project was created
Timestamp when the project was last updated
### Response Example
```json
{
"success": true,
"message": "Project retrieved successfully",
"data": {
"id": "proj_01JWB8YZNBQDJA3VZ3F8Z9C5NX",
"name": "project stage24",
"company": "6836eb8d404feca42c262a86",
"environment": "development",
"createdAt": "2025-05-28T11:03:12.308Z",
"updatedAt": "2025-05-28T11:03:12.308Z"
}
}
```
# Get Projects
Source: https://docs.vartiq.com/api-reference/projects/get-projects
GET /api/v1/projects
### Headers
The unique identifier of your organization
### Response
Indicates if the request was successful
A message describing the result of the operation
Array of project objects
Unique identifier for the project
Name of the project
Description of the project (if provided)
Company ID associated with the project
Environment of the project (e.g., "development")
Timestamp when the project was created
Timestamp when the project was last updated
### Response Example
```json
{
"success": true,
"message": "Projects retrieved successfully",
"data": [
{
"id": "proj_01JWB8YZNBQDJA3VZ3F8Z9C5NX",
"name": "project stage24",
"company": "6836eb8d404feca42c262a86",
"environment": "development",
"createdAt": "2025-05-28T11:03:12.308Z",
"updatedAt": "2025-05-28T11:03:12.308Z"
}
]
}
```
# Update Project
Source: https://docs.vartiq.com/api-reference/projects/update-project
PUT /api/v1/projects/{projectId}
### URL Parameters
The unique identifier of the project to update
### Body Parameters
The new name for the project
The new description for the project
### Response
Indicates if the request was successful
A message describing the result of the operation
The updated project object
Unique identifier for the project
Updated name of the project
Updated description of the project (if provided)
Company ID associated with the project
Environment of the project (e.g., "development")
Timestamp when the project was created
Timestamp when the project was last updated
### Response Example
```json
{
"success": true,
"message": "Project updated successfully",
"data": {
"id": "proj_01JWB8YZNBQDJA3VZ3F8Z9C5NX",
"name": "Updated project",
"company": "6836eb8d404feca42c262a86",
"environment": "development",
"createdAt": "2025-05-28T11:03:12.308Z",
"updatedAt": "2025-06-05T07:56:00.111Z"
}
}
```
# Webhook Message
Source: https://docs.vartiq.com/api-reference/webhook-messages/webhook-message
POST /webhook-messages
### Body Parameters
The unique identifier of the app to send the webhook message to.
Either appId or webhookId must be provided, but not both.
The unique identifier of the webhook to send the message to.
Either appId or webhookId must be provided, but not both.
The payload to be sent in the webhook message
### Response
Indicates if the request was successful
A message describing the result of the operation
The created webhook message details
Details of the created webhook message
Unique identifier for the webhook message
Indicates if the message has been delivered
The stringified payload of the message
HMAC signature of the message
Array of header objects containing key-value pairs
Timestamp when the message was created
Timestamp when the message was last updated
Details of the delivery attempt
Unique identifier for the attempt
Indicates if the attempt has been processed
Indicates if this is a resend attempt
HTTP status code of the attempt
Response received from the webhook endpoint
Array of header objects containing key-value pairs
Timestamp when the attempt was created
Timestamp when the attempt was last updated
### Response Example
# Create Webhook
Source: https://docs.vartiq.com/api-reference/webhooks/create-webhook
POST /webhooks
### Body Parameters
The ID of the app to create the webhook for.
Required for webhooks in an app. Not required for global webhooks.
The ID of the app to create the webhook for.
Required for global webhooks.
The URL where webhook events will be sent
Array of custom headers to be sent with the webhook
Header key
Header value
Authentication method for the webhook. Must be one of: "basic", "hmac", or "apiKey"
Username for basic authentication (required if authMethod is "basic")
Password for basic authentication (required if authMethod is "basic")
API key for apiKey authentication (required if authMethod is "apiKey")
Header name for the API key (required if authMethod is "apiKey")
Header name for the HMAC signature (required if authMethod is "hmac")
Secret for HMAC signature generation (required if authMethod is "hmac")
### Response
Indicates if the request was successful
A message describing the result of the operation
The created webhook object
Unique identifier for the webhook
Name of the webhook
URL where webhook events will be sent
Array of custom headers
Header key
Header value
Array of default headers
Header key
Header value
Authentication method configuration
Authentication method type (hmac, api\_key, or basic)
Custom header name for HMAC signature (if method is hmac)
Secret used for HMAC signature generation (if method is hmac)
API key value (if method is api\_key)
Custom header name for API key (if method is api\_key)
Username for basic authentication (if method is basic)
Password for basic authentication (if method is basic)
Timestamp when the webhook was created
Timestamp when the webhook was last updated
### Response Example
```json theme={null}
{
"success": true,
"message": "Webhook created successfully",
"data": {
"id": "wh_01JT39DVQGKA1RV4QNJ1VFRNW2",
"name": "heelo",
"url": "https://exp.com",
"secret": "01JT39DVQJW3A49TR3XXFVM939",
"customHeaders": [
{
"key": "x-app",
"value": "x-value"
}
],
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"authMethod": {
"hmacHeader": "x-Vartiq-signature",
"hmacSecret": "uPvKnaxMwD1gHs1uFNJh-UEn3D5ha5WZcS3WTMVUExY",
"method": "hmac"
},
"createdAt": "2025-04-30T12:06:00.703Z",
"updatedAt": "2025-04-30T12:06:00.703Z"
}
}
```
# Delete Webhook
Source: https://docs.vartiq.com/api-reference/webhooks/delete-webhook
DELETE /webhooks/{webhookId}
### URL Parameters
The unique identifier of the webhook to delete
### Response
Indicates if the request was successful
A message describing the result of the operation
### Response Example
```json
{
"success": true,
"message": "Webhook deleted successfully"
}
```
# Get Webhook
Source: https://docs.vartiq.com/api-reference/webhooks/get-webhook
GET /webhooks/{webhookId}
### URL Parameters
The unique identifier of the webhook
### Response
Indicates if the request was successful
A message describing the result of the operation
The webhook object
Unique identifier for the webhook
URL where webhook events will be sent
Secret key for webhook verification
Array of custom headers
Header key
Header value
Array of default headers
Header key
Header value
Authentication method configuration
Authentication method type (hmac, api\_key, or basic)
Custom header name for HMAC signature (if method is hmac)
Secret used for HMAC signature generation (if method is hmac)
API key value (if method is api\_key)
Custom header name for API key (if method is api\_key)
Username for basic authentication (if method is basic)
Password for basic authentication (if method is basic)
Timestamp when the webhook was created
Timestamp when the webhook was last updated
### Response Example
```json
{
"success": true,
"message": "Webhook retrieved successfully",
"data": {
"id": "wh_01JT39T79CFY20Z7G0M2KC4HVC",
"name": "heelo",
"url": "https://exp.com",
"secret": "01JT39T79HMJHEYQ9FXZ9VM2XC",
"customHeaders": [
{
"key": "x-app",
"value": "x-value"
}
],
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"authMethod": {
"hmacHeader": "x-Vartiq-signature",
"hmacSecret": "uPvKnaxMwD1gHs1uFNJh-UEn3D5ha5WZcS3WTMVUExY",
"method": "hmac"
},
"createdAt": "2025-04-30T12:12:45.756Z",
"updatedAt": "2025-04-30T12:12:45.756Z"
}
}
```
# Get Webhooks
Source: https://docs.vartiq.com/api-reference/webhooks/get-webhooks
GET /webhooks
### Query Parameters
Filter webhooks by app ID
### Response
Indicates if the request was successful
A message describing the result of the operation
Array of webhook objects
Unique identifier for the webhook
Name of the webhook
URL where webhook events will be sent
Secret key for webhook verification
Array of custom headers
Header key
Header value
Array of default headers
Header key
Header value
Timestamp when the webhook was created
Timestamp when the webhook was last updated
### Response Example
```json
{
"success": true,
"message": "Webhooks retrieved successfully",
"data": [
{
"id": "wh_01JT39DVQGKA1RV4QNJ1VFRNW2",
"name": "heelo",
"url": "https://exp.com",
"secret": "01JT39DVQJW3A49TR3XXFVM939",
"customHeaders": [
{
"key": "x-app",
"value": "x-value"
}
],
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"createdAt": "2025-04-30T12:06:00.703Z",
"updatedAt": "2025-04-30T12:06:00.703Z"
}
]
}
```
# Update Webhook
Source: https://docs.vartiq.com/api-reference/webhooks/update-webhook
PUT /webhooks/{webhookId}
### URL Parameters
The unique identifier of the webhook to update
### Body Parameters
New name for the webhook (2-100 characters)
New URL where webhook events will be sent
### Response
Indicates if the request was successful
A message describing the result of the operation
The updated webhook object
Unique identifier for the webhook
Updated name of the webhook
Updated URL where webhook events will be sent
Secret key for webhook verification
Array of custom headers
Header key
Header value
Array of default headers
Header key
Header value
Timestamp when the webhook was created
Timestamp when the webhook was last updated
### Response Example
```json
{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": "wh_01JT39T79CFY20Z7G0M2KC4HVC",
"name": "heelo111",
"url": "https://exp1.com",
"secret": "01JT39T79HMJHEYQ9FXZ9VM2XC",
"customHeaders": [
{
"key": "x-app",
"value": "x-value"
}
],
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"createdAt": "2025-04-30T12:12:45.756Z",
"updatedAt": "2025-04-30T12:17:10.831Z"
}
}
```
# Webhook Authentication
Source: https://docs.vartiq.com/essentials/authentication
Authenticate your webhooks
You can authenticate your webhooks using the following methods:
## HMAC (Default)
HMAC is the default authentication method for vartiq webhooks. If you don't provide any authentication method, it will be used by default.
The signature is generated using the HMAC SHA-256 algorithm.
You can get the signature from the `X-Vartiq-Signature` header.
If you like to chnage the header name and provide your own secret, you can do so while creating the webhook.
```javascript JavaScript
const webhook = await vartiq.webhook.create({
name: "Webhook name",
url: "https://example.com",
authMethod: "hmac",
hmacHeader: "X-Your-Signature",
hmacSecret: "your-secret",
});
```
```go Go
webhook, err := client.Webhook.Create(ctx, &vartiq.CreateWebhookRequest{
Name: "Webhook name",
URL: "https://example.com",
AuthMethod: "hmac",
HMACHeader: "X-Your-Signature",
HMACSecret: "your-secret",
})
```
```python Python
webhook = vartiq.webhook.create(
name="Webhook name",
url="https://example.com",
auth_method="hmac",
hmac_header="X-Your-Signature",
hmac_secret="your-secret",
)
```
{/* ```php PHP
$webhook = $vartiq->webhook->create([
"name" => "Webhook name",
"url" => "https://example.com",
"auth_method" => "hmac",
"hmac_header" => "X-Your-Signature",
"hmac_secret" => "your-secret",
]);
``` */}
## Basic Auth
Basic Auth is a simple authentication method that uses a username and password to authenticate the webhook.
You can get the value from `Authorization` header. It is a base64 encoded string.
```javascript JavaScript
const webhook = await vartiq.webhook.create({
name: "Webhook name",
url: "https://example.com",
authMethod: "basic",
basicAuthUsername: "username",
basicAuthPassword: "password",
});
```
```go Go
webhook, err := client.Webhook.Create(ctx, &vartiq.CreateWebhookRequest{
Name: "Webhook name",
URL: "https://example.com",
AuthMethod: "basic",
BasicAuthUsername: "username",
BasicAuthPassword: "password",
})
```
```python Python
webhook = vartiq.webhook.create(
name="Webhook name",
url="https://example.com",
auth_method="basic",
basic_auth_username="username",
basic_auth_password="password",
)
```
{/* ```php PHP
$webhook = $vartiq->webhook->create([
"name" => "Webhook name",
"url" => "https://example.com",
"auth_method" => "basic",
"basic_auth_username" => "username",
"basic_auth_password" => "password",
]);
``` */}
## API Key
You can use your own API key to authenticate the webhook.
```javascript JavaScript
const webhook = await vartiq.webhook.create({
name: "Webhook name",
url: "https://example.com",
authMethod: "apiKey",
apiKey: "your-api-key",
apiKeyHeader: "X-Your-API-Key",
});
```
```go Go
webhook, err := client.Webhook.Create(ctx, &vartiq.CreateWebhookRequest{
Name: "Webhook name",
URL: "https://example.com",
AuthMethod: "api_key",
APIKey: "your-api-key",
APIKeyHeader: "X-Your-API-Key",
})
```
```python Python
webhook = vartiq.webhook.create(
name="Webhook name",
url="https://example.com",
auth_method="api_key",
api_key="your-api-key",
api_key_header="X-Your-API-Key",
)
```
{/* ```php PHP
$webhook = $vartiq->webhook->create([
name="Webhook name",
url="https://example.com",
auth_method="api_key",
api_key="your-api-key",
api_key_header="X-Your-API-Key",
]);
``` */}
# Retry Schedules
Source: https://docs.vartiq.com/essentials/retry-schedule
Vartiq uses a exponential backoff strategy to retry webhooks.
Messages are delivered with the following schedule:
* Immediate
* 5 seconds
* 5 minutes
* 30 minutes
* 2 hours
* 5 hours
* 10 hours
## Successful Delivery
`2XX` (`200-299`) HTTP status codes are considered successful deliveries.
Rest are considered failed deliveries.
# Verify Webhook
Source: https://docs.vartiq.com/essentials/verify
Verify your webhook
Webhook verification is optional, but highly recommended.
Upon verification success, the `verify` function will return the payload.
You can get the signature from the `X-Vartiq-Signature` header. If you provided your own signature header name, you can use that instead.
```javascript JavaScript
const verifiedPayload = vartiq.verify(payload, signature, webhookSecret);
```
```go Go
verifiedPayload, err := client.Verify(payload, signature, webhookSecret)
```
```python Python
verified_payload = vartiq.verify(payload, signature, webhook_secret)
```
{/* ```php PHP
$verifiedPayload = $vartiq->verify($payload, $signature, $webhookSecret);
``` */}
## Manual Verification
You can also manually verify the webhook by computing the HMAC signature yourself.
```javascript JavaScript
const signature = crypto.createHmac("sha256", webhookSecret).update(payload).digest("hex");
```
```go Go
signature := hmac.New(sha256.New, []byte(webhookSecret)).Sum(payload)
```
```python Python
signature = hmac.new(webhook_secret.encode(), payload.encode(), hashlib.sha256).hexdigest()
```
```php PHP
$signature = hash_hmac("sha256", $payload, $webhookSecret);
```
# Introduction
Source: https://docs.vartiq.com/index
Vartiq is a comprehensive webhook platform that handles the complexity of event delivery so you don't have to. Whether you're notifying customer systems, triggering integrations, or building event-driven applications, Vartiq provides the infrastructure to deliver webhooks at scale with enterprise-grade reliability.
## Building webhook infrastructure is complex
What starts as a simple HTTP POST quickly becomes a maintenance nightmare. User endpoints go offline without notice, networks experience intermittent failures, and payload formats need constant adjustments for different integrations.
You'll find yourself building retry mechanisms, implementing signature verification, creating monitoring dashboards, handling rate limiting, managing delivery queues, debugging failed deliveries, and maintaining uptime guarantees. These aren't core features of your product—they're just the cost of doing business with webhooks.
Vartiq eliminates this overhead. Deploy webhook functionality in minutes instead of months, with built-in reliability, security, and observability that scales with your business.
# Quickstart
Source: https://docs.vartiq.com/quickstart
Start sending webhooks in under 5 minutes
## Concepts
Vartiq has three main concepts:
* **Apps** represents your customer. Create one app per customer.
* **Webhooks** are the URLs that receive the webhooks. Each app can have multiple webhooks.
* Webhooks can be created without an app as well. Which we call global webhooks.
* **Messages** are the data that is sent to the webhooks.
## Install the SDK
```javascript JavaScript theme={null}
npm i vartiq
// or
bun add vartiq
// or
pnpm add vartiq
```
{/* ```php PHP
composer require vartiq/vartiq
``` */}
## Get the API Key
Get the API key from the Vartiq [dashboard](https://dashboard.vartiq.com/api-keys).
## Get the project ID
You can have multiple projects in your account. Get the project ID from the project settings
## Initialize the SDK
```javascript JavaScript theme={null}
import { Vartiq } from 'vartiq';
const vartiq = new Vartiq("YOUR_API_KEY");
```
// \`\`\`php PHP
// use Vartiq\Vartiq;
// \$vartiq = new Vartiq("YOUR\_API\_KEY");
// \`\`\`
## Creating an App
```javascript JavaScript theme={null}
const app = await vartiq.app.create({
name: "App name", // setting this to the name or id of your customer is recommended
projectId: "PROJECT_ID",
});
```
{/* ```php PHP
$app = $vartiq->app->create([
"name" => "App name", // setting this to the name or id of your customer is recommended
"project_id" => "PROJECT_ID",
]);
``` */}
```bash cURL theme={null}
curl -X POST https://api.us.vartiq.com/apps \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "App name", "project_id": "PROJECT_ID"}'
```
## Creating a webhook within an app
```javascript JavaScript theme={null}
const webhook = await vartiq.webhook.create({
url: "https://example.com",
appId: "APP_ID",
customHeaders: [{ key: "x-key", value: "x-value" }], // optional
});
```
{/* ```php PHP
$webhook = $vartiq->webhook->create([
'name' => 'Webhook',
'url' => 'https://your-webhook-url.com',
'appId' => 'APP_ID',
'customHeaders' => [['key' => 'x-app', 'value' => 'x-value']] // optional
]);
``` */}
```bash cURL theme={null}
curl -X POST https://api.us.vartiq.com/webhooks \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://your-webhook-url.com", "app_id": "APP_ID", "custom_headers": [{"key": "x-app", "value": "x-value"}]}'
```
## Creating a webhook without an app
```javascript JavaScript theme={null}
const webhook = await vartiq.webhook.create({
projectId: "PROJECT_ID",
environmentId: "ENVIRONMENT_ID",
url: "https://example.com",
customHeaders: [{ key: "x-key", value: "x-value" }], // optional
});
```
```bash cURL theme={null}
curl -X POST https://api.us.vartiq.com/webhooks \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"project_id": "PROJECT_ID", "environment_id": "ENVIRONMENT_ID", "url": "https://your-webhook-url.com", "custom_headers": [{"key": "x-key", "value": "x-value"}]}'
```
## Sending a Message
Sending a message to a app(your customer) will send the message to all the webhooks associated with the app.
```javascript JavaScript theme={null}
const message = await vartiq.webhook.message.create({ appId: "APP_ID"}, {
hello: "world"
});
```
{/* ```php PHP
$message = $vartiq->webhook->message->create("APP_ID", [
'hello' => 'world'
]);
``` */}
```bash cURL theme={null}
curl -X POST https://api.us.vartiq.com/webhook-messages \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"app_id": "APP_ID", "payload": {"hello": "world"}}'
```
Schedule a quick call with our team to get personalized support, feature walkthroughs, or technical guidance.
# Apps
Source: https://docs.vartiq.com/usage/apps
Create and manage apps for your customers
## Create App
Create a new app for your customer.
```javascript JavaScript theme={null}
const app = await vartiq.app.create({
name: "App name",
projectId: "PROJECT_ID",
description: "Optional description", // optional
});
```
{/* ```php PHP
$app = $vartiq->app->create([
"name" => "App name",
"project_id" => "PROJECT_ID",
"description" => "Optional description", // optional
"environment" => "development" // optional, defaults to development
]);
``` */}
## Get Apps
Get all apps in a project.
```javascript JavaScript theme={null}
const apps = await vartiq.app.list("PROJECT_ID");
```
{/* ```php PHP
$apps = $vartiq->app->list([
"project_id" => "PROJECT_ID",
"environment" => "development", // optional
"limit" => 10, // optional, defaults to 10
"skip" => 0 // optional, defaults to 0
]);
``` */}
## Get App
Get a specific app by ID.
```javascript JavaScript theme={null}
const app = await vartiq.app.get("APP_ID");
```
{/* ```php PHP
$app = $vartiq->app->get("APP_ID");
``` */}
## Update App
Update an existing app.
```javascript JavaScript theme={null}
const app = await vartiq.app.update("APP_ID", {
name: "New name", // optional
description: "New description" // optional
});
```
{/* ```php PHP
$app = $vartiq->app->update("APP_ID", [
"name" => "New name", // optional
"description" => "New description" // optional
]);
``` */}
## Delete App
Delete an app.
```javascript JavaScript theme={null}
await vartiq.app.delete("APP_ID");
```
{/* ```php PHP
$vartiq->app->delete("APP_ID");
``` */}
# Initialize the SDK
Source: https://docs.vartiq.com/usage/init
Initialize the SDK
## Initialize the SDK
```javascript JavaScript theme={null}
import { Vartiq } from 'vartiq';
const vartiq = new Vartiq("YOUR_API_KEY");
```
{/* ```php PHP
use Vartiq\Vartiq;
$vartiq = new Vartiq("YOUR_API_KEY");
``` */}
# Projects
Source: https://docs.vartiq.com/usage/projects
Create and manage projects
## Create Project
Create a new project.
```javascript JavaScript theme={null}
const project = await vartiq.project.create({
name: "Project name",
description: "Optional description" // optional
});
```
{/* ```php PHP
$project = $vartiq->project->create([
"name" => "Project name",
"description" => "Optional description" // optional
]);
``` */}
## Get Projects
Get all projects.
```javascript JavaScript theme={null}
const projects = await vartiq.project.list();
```
{/* ```php PHP
$projects = $vartiq->project->list();
``` */}
## Get Project
Get a specific project by ID.
```javascript JavaScript theme={null}
const project = await vartiq.project.get("PROJECT_ID");
```
{/*
```php PHP
$project = $vartiq->project->get("PROJECT_ID");
``` */}
## Update Project
Update an existing project.
```javascript JavaScript theme={null}
const project = await vartiq.project.update("PROJECT_ID", {
name: "New name", // optional
description: "New description" // optional
});
```
{/* ```php PHP
$project = $vartiq->project->update("PROJECT_ID", [
"name" => "New name", // optional
"description" => "New description" // optional
]);
``` */}
## Delete Project
Delete a project.
```javascript JavaScript theme={null}
await vartiq.project.delete("PROJECT_ID");
```
{/* ```php PHP
$vartiq->project->delete("PROJECT_ID");
``` */}
# Webhook Messages
Source: https://docs.vartiq.com/usage/webhook-messages
Send messages to your webhooks
## Send Message
Send a message to all webhooks in an app. The message will be delivered to all webhooks associated with the app.
```javascript JavaScript theme={null}
const message = await vartiq.webhook.message.create({ appId: "APP_ID" }, {
event: "user.created",
data: {
user: {
id: 123,
name: "John Doe"
},
action: "user.created"
}
});
```
{/* ```php PHP
$message = $vartiq->webhook->message->create("APP_ID", [
"event" => "user.created",
"data" => [
"user" => [
"id" => 123,
"name" => "John Doe"
],
"event" => "user.created"
]
]);
``` */}
## Send Message to a specific webhook
If you need finer control over which webhooks receive the message, you can send a message to a specific webhook.
```javascript JavaScript theme={null}
const message = await vartiq.webhook.message.create({ webhookId: "WEBHOOK_ID" }, {
event: "user.created",
data: {
user: {
id: 123,
name: "John Doe"
},
action: "user.created"
}
});
```
# Webhooks
Source: https://docs.vartiq.com/usage/webhooks
Create and manage webhooks for your apps
## Create Webhook
Create a new webhook for an app.
```javascript JavaScript theme={null}
const webhook = await vartiq.webhook.create({
name: "Webhook name",
url: "https://your-webhook-url.com",
appId: "APP_ID",
customHeaders: [{ key: "x-app", value: "x-value" }], // optional
authMethod: "basic", // optional: "basic", "hmac", or "apiKey"
userName: "username", // required if authMethod is "basic"
password: "password", // required if authMethod is "basic"
apiKey: "api-key", // required if authMethod is "apiKey"
apiKeyHeader: "x-api-key", // required if authMethod is "apiKey"
hmacHeader: "x-signature", // required if authMethod is "hmac"
hmacSecret: "your-secret" // required if authMethod is "hmac"
});
```
{/* ```php PHP
$webhook = $vartiq->webhook->create([
"name" => "Webhook name",
"url" => "https://your-webhook-url.com",
"appId" => "APP_ID",
"customHeaders" => [["key" => "x-app", "value" => "x-value"]], // optional
"authMethod" => "basic", // optional: "basic", "hmac", or "apiKey"
"userName" => "username", // required if authMethod is "basic"
"password" => "password", // required if authMethod is "basic"
"apiKey" => "api-key", // required if authMethod is "apiKey"
"apiKeyHeader" => "x-api-key", // required if authMethod is "apiKey"
"hmacHeader" => "x-signature", // required if authMethod is "hmac"
"hmacSecret" => "your-secret" // required if authMethod is "hmac"
]);
``` */}
## Create Webhook without an app
Create a new webhook for a project.
```javascript JavaScript theme={null}
const webhook = await vartiq.webhook.create({
projectId: "PROJECT_ID",
environmentId: "ENVIRONMENT_ID",
url: "https://your-webhook-url.com",
customHeaders: [{ key: "x-key", value: "x-value" }], // optional
authMethod: "basic", // optional: "basic", "hmac", or "apiKey"
userName: "username", // required if authMethod is "basic"
password: "password", // required if authMethod is "basic"
apiKey: "api-key", // required if authMethod is "apiKey"
apiKeyHeader: "x-api-key", // required if authMethod is "apiKey"
hmacHeader: "x-signature", // required if authMethod is "hmac"
hmacSecret: "your-secret" // required if authMethod is "hmac"
});
```
## Get Webhooks
Get all webhooks for an app.
```javascript JavaScript theme={null}
const webhooks = await vartiq.webhook.list("APP_ID");
```
{/* ```php PHP
$webhooks = $vartiq->webhook->list([
"appId" => "APP_ID"
]);
``` */}
## Get Webhook
Get a specific webhook by ID.
```javascript JavaScript theme={null}
const webhook = await vartiq.webhook.get("WEBHOOK_ID");
```
{/* ```php PHP
$webhook = $vartiq->webhook->get("WEBHOOK_ID");
``` */}
## Update Webhook
Update an existing webhook.
```javascript JavaScript theme={null}
const webhook = await vartiq.webhook.update("WEBHOOK_ID", {
name: "New name", // optional
url: "https://new-url.com" // optional
});
```
{/* ```php PHP
$webhook = $vartiq->webhook->update("WEBHOOK_ID", [
"name" => "New name", // optional
"url" => "https://new-url.com" // optional
]);
``` */}
## Delete Webhook
Delete a webhook.
```javascript JavaScript theme={null}
await vartiq.webhook.delete("WEBHOOK_ID");
```
{/* ```php PHP
$vartiq->webhook->delete("WEBHOOK_ID");
``` */}