Docs Getting Started

Getting Started

Get AsyncGuard up and running in under 5 minutes. Connect your Salesforce org, send your first API request, and start eliminating async processing failures.

Quick Start

AsyncGuard acts as a proxy layer between your application and Salesforce. Instead of sending writes directly, you route them through AsyncGuard, which handles serialization, queuing, and automatic retry on lock errors.

Here's the three-step process to get started:

1

Sign Up

Create your AsyncGuard account and grab your API key from the dashboard.

2

Connect Salesforce

Authorize AsyncGuard to access your Salesforce org via OAuth. Supports both Production and Sandbox environments.

3

Send API Requests

Replace your direct Salesforce API calls with AsyncGuard proxy endpoints. Same payload format, zero lock errors.

Sign Up

Create your free AsyncGuard account to get started. The free tier includes 10,000 API calls per month.

  1. Navigate to asyncguard.dev/signup and create your account with email or SSO.
  2. Verify your email address via the confirmation link.
  3. Once logged in, go to Dashboard → Settings to find your API key.
Your API key is a secret. Store it securely in environment variables or a secrets manager — never commit it to version control.

Copy your API key and set it as an environment variable:

bash
export ASYNCGUARD_API_KEY="ag_live_your_api_key_here"

Connect Salesforce

AsyncGuard connects to your Salesforce org using OAuth 2.0, so your credentials are never stored on our servers.

  1. In the AsyncGuard dashboard, navigate to Connections → New Connection.
  2. Select Salesforce as the platform.
  3. Choose your environment:
    • Production — connects to login.salesforce.com
    • Sandbox — connects to test.salesforce.com
  4. Click Authorize to launch the Salesforce OAuth flow.
  5. Log in to Salesforce and grant access to AsyncGuard.
Make sure the Salesforce user authorizing the connection has API Enabled permission and sufficient object-level access for the records you plan to write.

Once authorized, the connection will show a green Connected status in your dashboard. AsyncGuard will handle token refresh automatically.

Your First API Call

With your API key and Salesforce connection ready, you can send your first proxied request. The example below inserts two Opportunity records through AsyncGuard's serialization layer.

bash
curl -X POST https://api.asyncguard.dev/api/v1/proxy/salesforce \
  -H "Authorization: Bearer $ASYNCGUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "object": "Opportunity",
    "operation": "insert",
    "entityKey": "AccountId",
    "records": [
      {
        "Name": "Q1 Renewal",
        "AccountId": "001xx000003ABCDEF",
        "StageName": "Prospecting",
        "CloseDate": "2026-06-30",
        "Amount": 48000
      },
      {
        "Name": "Q1 Expansion",
        "AccountId": "001xx000003ABCDEF",
        "StageName": "Qualification",
        "CloseDate": "2026-07-15",
        "Amount": 72000
      }
    ]
  }'

If successful, AsyncGuard returns a batch ID you can use to track processing status:

200 OK json
{
  "batchId": "batch_01HZ3K9V7M...",
  "status": "queued",
  "recordCount": 2,
  "entityKey": "001xx000003ABCDEF",
  "createdAt": "2026-03-17T09:14:22Z"
}

Check Batch Status

Use the batch ID from the previous response to poll the status of your request. AsyncGuard processes batches asynchronously, so you may see queued, processing, or completed states.

bash
curl https://api.asyncguard.dev/api/v1/proxy/salesforce/batch_01HZ3K9V7M.../status \
  -H "Authorization: Bearer $ASYNCGUARD_API_KEY"

Response when processing is complete:

200 OK json
{
  "batchId": "batch_01HZ3K9V7M...",
  "status": "completed",
  "recordCount": 2,
  "successCount": 2,
  "failureCount": 0,
  "retryCount": 1,
  "completedAt": "2026-03-17T09:14:25Z",
  "results": [
    { "id": "006xx000004XYZABC", "success": true },
    { "id": "006xx000004XYZDEF", "success": true }
  ]
}
Notice retryCount: 1 in the response — AsyncGuard automatically retried when it encountered a lock error, and the operation completed successfully without any intervention.

How It Works

When you send records through AsyncGuard's proxy endpoint, the following happens under the hood:

  1. Grouping — Records are grouped by the entityKey field you specify (e.g., AccountId). This ensures that all records sharing the same parent entity are processed sequentially, preventing lock contention.
  2. Queuing — Grouped records are placed into a FIFO queue. Each entity key gets its own queue lane, so independent entities are processed in parallel while related records stay serialized.
  3. Processing — AsyncGuard sends requests to Salesforce on your behalf. If a write succeeds, the next record in the queue is processed immediately.
  4. Automatic Retry — If Salesforce returns an UNABLE_TO_LOCK_ROW error (or similar transient failures), AsyncGuard automatically retries with exponential backoff. After exhausting retries, the record is moved to the Dead Letter Queue for manual review.

This architecture means your application never needs to handle retry logic, lock errors, or rate limiting — AsyncGuard takes care of it all.

Next Steps

Now that you've made your first API call, explore more of what AsyncGuard can do: