Error Handling

All error responses use JSON with an "error" or "message" field and the appropriate HTTP status code.

Common HTTP Status Codes

Status Code
Meaning

400

Bad Request – missing or malformed input.

401

Unauthorized – missing or invalid API key.

402

Payment Required – insufficient credits.

404

Not Found – resource or endpoint does not exist.

422

Unprocessable Entity – validation failed.

500

Internal Server Error – unexpected server exception.

Error Response Format

{
  "error": "Descriptive error message here."
}

Or for validation failures:

{
  "status": "unprocessable",
  "message": "Unable to extract name or domain.",
  "profile": { /* partial profile data */ }
}

Examples

400 Bad Request

bashCopyEditcurl -X POST https://smtpghost.com/api/v1/linkedin_finder \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "error": "Please provide a LinkedIn URL."
}

401 Unauthorized

curl -X POST https://smtpghost.com/api/v1/linkedin_finder \
  -H "Content-Type: application/json" \
  -H "X-KEY: WRONG_KEY" \
  -d '{ "linkedin_url": "…" }'
{
  "error": "Unauthorized: Invalid API Key or Organization not found"
}

402 Payment Required

{
  "error": "Insufficient credits. You need 1 credits to perform LinkedIn email finder."
}

422 Unprocessable Entity

{
  "status": "unprocessable",
  "message": "Unable to extract name or domain.",
  "profile": { /* partial profile data */ }
}

500 Internal Server Error

{
  "error": "An internal error occurred: Connection timed out"
}

Last updated