Skip to content
Last updated

Complete reference of all error codes returned by the Freddy API. All errors follow a consistent format with machine-readable codes and user-friendly messages.

Error Response Structure

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "User-friendly message",
    "system_message": "Technical message",
    "type": "error_type",
    "status": 400,
    "details": {},
    "trace_id": "uuid",
    "timestamp": "2025-01-15T10:30:00Z"
  }
}

Authentication Errors (401)

CodeMessageDescription
INVALID_CREDENTIALSInvalid email, username, or passwordWrong login credentials
TOKEN_EXPIREDYour session has expiredJWT token expired
TOKEN_INVALIDYour session is invalidMalformed or invalid token
TOKEN_MISSING_SUBJECTYour session is invalidToken missing subject claim
AUTHENTICATION_REQUIREDPlease sign in to continueMissing authentication
INVALID_API_KEYYour API key is invalidInvalid API key format or value
API_KEY_EXPIREDYour API key has expiredAPI key past expiration date
API_KEY_DEACTIVATEDYour API key has been deactivatedAPI key manually deactivated
API_KEY_PAUSEDYour API key is pausedAPI key temporarily paused

Authorization Errors (403)

CodeMessageDescription
INSUFFICIENT_PERMISSIONSYou don't have permission to perform this actionLacks required permissions
ORGANIZATION_ACCESS_DENIEDYou don't have access to this organizationNot a member of organization
DOMAIN_NOT_REGISTEREDYour email domain is not registeredEmail domain not allowed
REGISTRATION_RESTRICTEDRegistration is restrictedRegistration not allowed
OPERATION_NOT_ALLOWEDThis operation is not allowedOperation forbidden
NO_ORGANIZATION_MEMBERSHIPYou are not a member of any organizationNo organization membership
AMBIGUOUS_ORGANIZATIONPlease specify which organization to useMultiple organizations, need to specify
ACCESS_DENIEDYou don't have permission to access this ruleGeneral access denied
CANNOT_REMOVE_LAST_OWNERCannot remove the last owner of a ruleMust have at least one owner
CANNOT_DELETE_OWNERThe organization owner cannot be deletedOwner protection
CANNOT_MODIFY_OWNERThe organization owner's role or status cannot be modifiedOwner protection
SCOPE_RESTRICTEDGlobal scope rules can only be created by system administratorsScope restriction

Validation Errors (422)

CodeMessageDescription
VALIDATION_ERRORPlease check your input and try againGeneral validation failure
INVALID_EMAIL_FORMATPlease enter a valid email addressEmail format invalid
INVALID_PASSWORD_FORMATPassword does not meet requirementsPassword validation failed
MISSING_REQUIRED_FIELDPlease fill out all required fieldsRequired field missing
INVALID_FIELD_VALUEOne or more fields contain invalid valuesField value invalid
INVALID_USERNAME_FORMATUsername contains invalid charactersUsername format invalid
INVALID_INPUTInvalid input providedGeneral input validation
INVALID_MODEL_KEYThe model you specified is not availableModel key invalid
INVALID_LIMIT_VALUEInvalid limit valueLimit value out of range
INVALID_CATEGORYInvalid rule categoryCategory not recognized
INVALID_RULE_TYPEInvalid rule typeRule type not recognized
INVALID_SCOPEInvalid rule scopeScope not recognized
INVALID_APPLY_MODEInvalid apply modeApply mode not recognized
INVALID_ENTITY_TYPEInvalid entity typeEntity type not recognized
INVALID_ACCESS_LEVELInvalid access levelAccess level not recognized
INVALID_SORT_FIELDThe specified sort field is not validSort field invalid
INVALID_PAGINATION_PARAMSInvalid pagination parametersPagination params invalid
INVALID_QUERY_PARAMETERSInvalid query parametersQuery params invalid
INVALID_REQUEST_BODYInvalid request bodyRequest body malformed
INVALID_ID_FORMATInvalid ID formatID format incorrect

Resource Errors (404)

CodeMessageDescription
USER_NOT_FOUNDWe couldn't find an account with that informationUser doesn't exist
ORGANIZATION_NOT_FOUNDOrganization not foundOrganization doesn't exist
RESOURCE_NOT_FOUNDThe requested resource could not be foundGeneric resource not found
THREAD_NOT_FOUNDThread not foundThread doesn't exist
MESSAGE_NOT_FOUNDMessage not foundMessage doesn't exist
RULE_NOT_FOUNDThe requested rule could not be foundRule doesn't exist
MEMBER_NOT_FOUNDThe specified member could not be foundMember doesn't exist
ROLE_NOT_FOUNDThe specified role could not be foundRole doesn't exist
STATUS_NOT_FOUNDThe specified status could not be foundStatus doesn't exist
INVITATION_NOT_FOUNDThe invitation could not be foundInvitation doesn't exist
ATTACHMENT_NOT_FOUNDThe requested attachment could not be foundAttachment doesn't exist
ACCESS_RIGHT_NOT_FOUNDThe requested access right could not be foundAccess right doesn't exist
ICON_NOT_FOUNDThe requested icon could not be foundIcon doesn't exist
API_KEY_NOT_FOUNDAPI key not foundAPI key doesn't exist
VECTOR_STORE_NOT_FOUNDVector store not foundVector store doesn't exist
VECTOR_STORE_FILE_NOT_FOUNDVector store file not foundFile not found in vector store
FILE_NOT_FOUNDFile not foundFile doesn't exist
JOB_NOT_FOUNDJob not foundScraping job doesn't exist
BATCH_NOT_FOUNDBatch not foundBatch doesn't exist
VERIFICATION_NOT_FOUNDVerification not foundVerification record doesn't exist

Conflict Errors (409)

CodeMessageDescription
USER_ALREADY_EXISTSAn account with this email already existsEmail already registered
USERNAME_TAKENThis username is already takenUsername not available
RESOURCE_ALREADY_EXISTSThis resource already existsGeneric conflict
EMAIL_ALREADY_REGISTEREDEmail already registeredEmail in use
RULE_NAME_DUPLICATEA rule with this name already exists in your organizationRule name must be unique
ATTACHMENT_ALREADY_EXISTSThis entity is already attached to this ruleAttachment exists
ACCESS_RIGHT_ALREADY_EXISTSThis user already has access to this ruleAccess right exists
INVITATION_ALREADY_ACCEPTEDThis invitation has already been acceptedInvitation used
MEMBER_ALREADY_DELETEDThis member has already been deletedMember deleted
VECTOR_STORE_FILE_ALREADY_EXISTSFile already exists in vector storeDuplicate file
CONFLICTThis action conflicts with existing dataGeneric conflict

Rate Limit Errors (429)

CodeMessageDescription
RATE_LIMIT_EXCEEDEDToo many requests. Please wait a moment and try againGeneral rate limit
TOO_MANY_LOGIN_ATTEMPTSToo many login attempts. Please try again laterLogin rate limit
TOO_MANY_VERIFICATION_ATTEMPTSToo many verification attempts. Please try again laterVerification rate limit
SPENDING_LIMIT_EXCEEDEDYour monthly spending limit has been reachedSpending limit hit

Server Errors (500)

CodeMessageDescription
INTERNAL_ERRORSomething went wrong. Please try again laterUnexpected server error
DATABASE_ERRORService temporarily unavailable. Please try again laterDatabase operation failed
DATABASE_CONNECTION_ERRORService temporarily unavailable. Please try again laterDatabase connection failed
EMAIL_SEND_FAILEDFailed to send email. Please try again laterEmail service failure
CONFIGURATION_ERRORService configuration error. Please contact supportConfiguration issue
STORAGE_SERVICE_UNAVAILABLEImage upload service is temporarily unavailableStorage service down
STORAGE_UPLOAD_FAILEDFailed to upload image. Please try again laterUpload failed
STORAGE_ERRORStorage error occurredStorage operation failed
PROVIDER_UNAVAILABLEExternal service is temporarily unavailableProvider down
PROVIDER_TIMEOUTRequest timed out. Please try againProvider timeout
PROVIDER_ERRORExternal service error. Please try again laterProvider error
PROVIDER_NOT_CONFIGUREDProvider not configuredProvider setup missing

Rule Management Errors

CodeStatusMessage
RULE_CONTENT_TOO_LARGE422Rule content exceeds the maximum allowed size of 50,000 characters
RULE_CONTENT_EMPTY422Rule content cannot be empty
RULE_HAS_ATTACHMENTS409This rule cannot be deleted because it is attached to one or more entities
ATTACHMENT_INVALID_ENTITY422The specified entity is invalid or does not exist
ATTACHMENT_PRIORITY_INVALID422Priority must be between 1 and 100
ATTACHMENT_CHAR_LIMIT_INVALID422Character limit must be between 100 and 50,000

File & Vector Store Errors

CodeStatusMessage
FILE_TOO_LARGE422File exceeds maximum size limit
FILE_SIZE_MISMATCH422File size doesn't match expected size
INVALID_FILE_TYPE422File type not supported
INVALID_FILE_FORMAT422File format invalid
FILE_PARSING_ERROR500Failed to parse file
FILE_NOT_PROCESSED400File has not been processed yet
FILE_CONTEXT_RETRIEVAL_FAILED500Failed to retrieve context from files
TOO_MANY_FILES422Too many files attached (max 10)
CORRUPTED_DOCUMENT422Document is corrupted or unreadable
FILE_PROCESSING_FAILED500File processing failed
VECTOR_STORE_ACCESS_DENIED403Access denied to vector store
VECTOR_STORE_INVALID_ACCESS_MODE422Invalid access mode
INVALID_STATUS422Invalid status value
INVALID_STATUS_TRANSITION422Invalid status transition

Verification Errors

CodeStatusMessage
VERIFICATION_CODE_INVALID422Invalid verification code. Please try again
VERIFICATION_CODE_EXPIRED422Verification code has expired. Please request a new one
VERIFICATION_ALREADY_USED409This verification code has already been used
VERIFICATION_ATTEMPTS_EXCEEDED429Too many verification attempts. Please request a new code
INVALID_VERIFICATION_TYPE422This verification code cannot be used for this purpose

Crew Management Errors

CodeStatusMessage
MEMBER_NOT_DELETED400This member is not deleted and cannot be restored
EXPORT_LIMIT_EXCEEDED422Export exceeds the maximum limit
BULK_OPERATION_LIMIT_EXCEEDED422Bulk operation exceeds the maximum limit

Image & Icon Errors

CodeStatusMessage
ICON_UPLOAD_FAILED500Failed to upload icon
ICON_FILE_NOT_FOUND404Icon file not found
ICON_INVALID_FORMAT422Invalid icon format (must be SVG, PNG, or JPG)
ICON_FILE_TOO_LARGE422Icon file is too large (max 5MB)
ICON_INVALID_SVG422Invalid SVG file (contains unsafe content)
IMAGE_DOWNLOAD_FAILED500Failed to download image from URL
UNSUPPORTED_OPERATION422Operation not supported
INVALID_IMAGE_FORMAT422Invalid image format
IMAGE_TOO_LARGE422Image exceeds maximum size

Web Scraping Errors

CodeStatusMessage
SCRAPING_FAILED500Web scraping operation failed
BATCH_SCRAPING_FAILED500Batch scraping failed
INVALID_URL422Invalid URL provided
TIMEOUT_EXCEEDED500Operation timed out
SITE_BLOCKED403Site blocked scraping
JOB_LIST_FAILED500Failed to list jobs
JOB_CANCELLATION_FAILED500Failed to cancel job

Best Practices

Error Handling

  1. Always check the success field - It's false for all errors
  2. Use the code field - Machine-readable, consistent across versions
  3. Display the message field - User-friendly, safe for UI
  4. Log the system_message - Technical details for debugging
  5. Include trace_id in support requests - Helps track issues
  6. Check details for context - Additional error-specific information

Retry Logic

  • 401/403: Don't retry, fix authentication/authorization
  • 404: Don't retry, resource doesn't exist
  • 422: Don't retry, fix validation errors
  • 429: Retry after details.retry_after seconds
  • 500/502/503: Retry with exponential backoff
  • 504: Retry with longer timeout

Example Error Handler

def handle_api_error(response):
    if response.status_code >= 400:
        error_data = response.json()
        error = error_data.get("error", {})
        
        code = error.get("code")
        message = error.get("message")
        trace_id = error.get("trace_id")
        
        # Log for debugging
        print(f"Error {code}: {error.get('system_message')}")
        print(f"Trace ID: {trace_id}")
        
        # Display to user
        print(f"User message: {message}")
        
        # Handle specific errors
        if code == "TOKEN_EXPIRED":
            # Refresh token
            pass
        elif code == "RATE_LIMIT_EXCEEDED":
            # Wait and retry
            retry_after = error.get("details", {}).get("retry_after", 60)
            time.sleep(retry_after)
        
        return error