ReferenceError Codes

Error Codes

All Datafly Signal API error responses follow a consistent format with an HTTP status code and an application-level error code. This page documents all HTTP status codes and application error codes returned by the platform.

Error Response Format

{
  "error": {
    "code": "INVALID_PIPELINE_KEY",
    "message": "The provided pipeline key is not valid or has been revoked."
  }
}
FieldTypeDescription
error.codestringMachine-readable error code for programmatic handling
error.messagestringHuman-readable description of the error

HTTP Status Codes

StatusMeaningWhen Used
200OKSuccessful request
201CreatedResource successfully created
204No ContentSuccessful delete operation
400Bad RequestInvalid JSON, missing required fields, malformed request
401UnauthorizedMissing, invalid, or expired authentication token
403ForbiddenAuthenticated but insufficient permissions for the requested action
404Not FoundRequested resource does not exist
409ConflictResource already exists (duplicate name, email, etc.)
422Unprocessable EntityRequest is well-formed but fails validation (invalid field values, schema violations)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server-side error

Application Error Codes

Authentication Errors

CodeHTTP StatusDescriptionResolution
INVALID_CREDENTIALS401Email or password is incorrectVerify credentials and retry
EXPIRED_TOKEN401The access token has expiredUse the refresh endpoint to obtain a new access token
INVALID_TOKEN401The token is malformed or has an invalid signatureRe-authenticate to obtain a new token pair
INVALID_REFRESH_TOKEN401The refresh token is invalid, expired, or has been rotated outRe-authenticate with email and password
ACCOUNT_LOCKED401Too many failed login attempts; account temporarily lockedWait for the lockout period to expire (default 15 minutes)

Authorization Errors

CodeHTTP StatusDescriptionResolution
FORBIDDEN403The authenticated user’s role does not have permission for this actionContact an admin to upgrade your role or use an account with sufficient permissions
OWNER_REQUIRED403This action requires the owner roleOnly the organisation owner can perform this action

Pipeline Key Errors

CodeHTTP StatusDescriptionResolution
INVALID_PIPELINE_KEY401The pipeline key is not valid or has been revokedCheck the pipeline key in your source configuration
PIPELINE_KEY_MISSING401No pipeline key provided in the requestInclude the pipeline key in the Authorization header or script tag

Validation Errors

CodeHTTP StatusDescriptionResolution
VALIDATION_ERROR422One or more fields failed validationCheck the error message for specific field errors
INVALID_EVENT_TYPE422The type field is not one of: track, page, identify, groupUse a valid event type
MISSING_REQUIRED_FIELD422A required field is missing from the requestInclude all required fields as documented
INVALID_CONFIG422Integration or transformation config is invalidReview the config format for the specific integration type
PAYLOAD_TOO_LARGE422Single event payload exceeds the 32 KB limitReduce the size of the event properties
BATCH_TOO_LARGE422Batch request exceeds 500 events or 500 KBSplit the batch into smaller batches

Resource Errors

CodeHTTP StatusDescriptionResolution
NOT_FOUND404The requested resource does not existVerify the resource ID and try again
DUPLICATE_RESOURCE409A resource with the same unique identifier already existsUse a different name or identifier
DUPLICATE_EMAIL409A user with this email already exists in the organisationUse a different email address or update the existing user

Rate Limiting Errors

CodeHTTP StatusDescriptionResolution
RATE_LIMITED429Request rate limit exceededWait for the period indicated in the Retry-After header
CodeHTTP StatusDescriptionResolution
CONSENT_DENIEDEvent dropped because required consent was not grantedThis is not returned to the client; it is logged internally. Ensure users have granted the required consent categories

CONSENT_DENIED is an internal status used by Delivery Workers when an event is dropped due to insufficient consent. It does not produce an HTTP error response. You can see consent-denied events in the Management UI under the integration’s delivery logs.

Delivery Errors

CodeHTTP StatusDescriptionResolution
DELIVERY_FAILEDEvent delivery to a vendor failed after all retry attemptsCheck the integration’s dead letter queue in the Management UI. Review the vendor’s API status
VENDOR_API_ERRORThe vendor API returned an error responseCheck vendor API credentials and configuration. Review the vendor’s error message in the delivery logs
TRANSFORMATION_ERRORAn error occurred while applying transformation rulesReview the transformation config. Use the dry-run endpoint to test with a sample event

Delivery errors (DELIVERY_FAILED, VENDOR_API_ERROR, TRANSFORMATION_ERROR) are internal pipeline errors. They do not produce HTTP error responses to API clients. They are recorded in delivery logs and visible in the Management UI.

Error Handling Best Practices

Retry Strategy

  • 4xx errors (except 429): Do not retry. Fix the request and try again.
  • 429 errors: Retry after the duration specified in the Retry-After header.
  • 5xx errors: Retry with exponential backoff (1s, 2s, 4s, 8s, max 30s).

Example Error Handling

async function callAPI(url, options) {
  const response = await fetch(url, options);
 
  if (!response.ok) {
    const body = await response.json();
    const { code, message } = body.error;
 
    if (response.status === 401 && code === 'EXPIRED_TOKEN') {
      // Refresh the token and retry
      await refreshToken();
      return callAPI(url, options);
    }
 
    if (response.status === 429) {
      const retryAfter = response.headers.get('Retry-After');
      await sleep(parseInt(retryAfter, 10) * 1000);
      return callAPI(url, options);
    }
 
    throw new Error(`API error ${code}: ${message}`);
  }
 
  return response.json();
}