Skip to main content

Conventions

The API uses standard HTTP status codes. The response body is JSON with message and optionally code / errors:
{
  "message": "Validation failed",
  "errors": {
    "email": "Invalid email",
    "password": "Minimum 8 characters"
  }
}

Most common codes

StatusWhen it occurs
200Success
201Resource created
204Success with no content (e.g. delete)
400Bad request — malformed payload or invalid data
401Not authenticated (missing, invalid or expired token)
402Payment required — subscription expired
403No permission for this endpoint
404Resource not found
422Validation failed — body has errors per field
429Rate limit — slow down
500Internal error — retry; if it persists, contact support
async function callApi(path, options) {
  const res = await fetch(`https://app.tarefy.com/nodeapi${path}`, options);

  if (res.status === 401) {
    // token expired → refresh and retry
    await refreshToken();
    return callApi(path, options);
  }

  if (res.status === 402) {
    throw new Error('Subscription expired — check billing');
  }

  if (!res.ok) {
    const body = await res.json();
    throw new Error(body.message || `HTTP ${res.status}`);
  }

  return res.json();
}
import requests

def call_api(path, **kwargs):
    res = requests.request(
        url=f"https://app.tarefy.com/nodeapi{path}",
        **kwargs
    )
    if res.status_code == 401:
        # token expired
        refresh_token()
        return call_api(path, **kwargs)
    res.raise_for_status()
    return res.json()