Skip to main content

Response Format

All API responses use a unified JSON envelope format:

HTTP Status Codes

HTTP status codes and business error codes are two separate dimensions. Profy’s mapping rules:
5-digit business codes (e.g., 40004) are mapped to their corresponding HTTP status code range by the first digit: 4xxxx400, 5xxxx500.

Business Error Code Reference

Authentication & Security

Files & Storage

Credits & Consumption

Recharge

Subscriptions & Plans

Payments

Gift Cards

Invoices

Skills & Applications

Tasks

Infrastructure

Error Handling Recommendations

1

Check the code field

A response code of 0 indicates success. For non-zero values, check the message field for the error description.
2

Handle HTTP status codes

  • 401: Refresh the token or re-authenticate
  • 429: Add backoff-and-retry logic
  • 5xx: Server-side error; retry after a delay
3

Branch on error names

Use error names (e.g., CONSUME_BALANCE_INSUFFICIENT) rather than numeric error codes for conditional branching in your code to improve readability.
Do not rely on the message field for programmatic logic — error messages may be reworded across versions. Always use the numeric code or the error name.