Skip to main content

Build on Weav

The Weav Developer Platform helps you integrate AI-powered customer support directly into your product stack. Use the API to manage agents, conversations, messages, customers, companies, and training data in your workspace, with predictable, organization-scoped behavior that’s built for production integrations. Authentication is token-based and ability-scoped. Endpoints are versioned under /v1, return consistent JSON structures, and include clear error signaling—making it easier to handle retries, validation issues, and long-term maintenance as your integration grows. Webhooks complement the API by delivering real-time events to your systems when conversations, customers, agents, or training data change. Together, the API and webhooks give you the complete integration loop: send commands into Weav and react to updates from Weav in near real time.

What you can build

  • Sync conversations and customer records with your CRM
  • Trigger automations from live support events
  • Manage AI agents and training data programmatically
  • Build internal tooling for support operations and analytics
  1. Your app calls the Weav API to create or update resources.
  2. Weav emits webhook events as those resources change.
  3. Your backend processes events and updates your downstream systems.
  • Use idempotent handlers for webhook processing
  • Retry safely on transient failures
  • Log request IDs and event IDs for traceability

Authentication

The Weav External API uses Bearer token authentication with workspace-scoped API keys. All external endpoints are versioned under /v1 and require a valid token in the Authorization header.
Your API key inherits your workspace context. Requests can only access resources within that workspace.

Get an API Key

You can create API keys in the Weav dashboard:
  1. Go to Settings → API Tokens
  2. Click Create API token
  3. Enter a name (and optional expiration)
  4. Create the token
  5. Copy the token immediately and store it securely
⚠️ Important
The plain-text token is shown only once at creation time.
If you lose it, delete the token and create a new one.

Use the Key in Requests

Example using curl:

Common Authentication Failures

401 — Unauthenticated

Usually means the token is missing, malformed, or invalid.

403 — Insufficient Token Ability

The token is valid but does not include the ability required for the HTTP method.

Authentication Best Practices

  • Store API keys in a secure secrets manager (never in frontend code)
  • Set expirations where possible
  • Rotate keys regularly
  • Delete unused keys immediately
  • Send requests server-to-server over HTTPS only

Error handling

The Weav External API uses predictable HTTP status codes and machine-readable error codes for most authorization and business-rule failures. For client integrations, treat all non-2xx responses as failures, branch first on HTTP status, then on the error code when available. Most endpoint failures use a standard JSON envelope with error and optional code. Validation failures use Laravel’s validation shape (message + errors). A small number of endpoint-specific business-state responses may return custom payloads, so clients should handle both patterns safely.

Error response formats

Standard API error envelope

  • error (string): human-readable message
  • code (string, optional): machine-readable identifier
  • errors (object, optional): additional context/details

Validation errors (422)

Use this format when payload/query/path validation fails.

Endpoint-specific business-state error example (422)

Some flows can return a custom shape such as:
Treat this as a non-retryable business-state error unless your app changes input/state before retrying.

HTTP status codes to handle

Common error codes

Best practices

  • Log status, code, and response body for all non-2xx responses.
  • Treat 4xx as request/integration issues, 5xx as transient/system issues.
  • Only retry idempotent operations, with exponential backoff and jitter.
  • Surface validation details from errors directly in developer tooling.