factor technologies
Reference

Errors and exit codes

Every error has a stable code, a message and a request ID. The CLI prints errors to stderr and exits with a code that tells scripts what went wrong.

Error format#

json
{
  "error": {
    "code": "CONTRACT_INVALID",
    "message": "request validation failed",
    "retryable": false,
    "request_id": "req_...",
    "details": {}
  }
}
FieldMeaning
codeStable error code. Use it in code, not the message.
messageA human-readable description.
retryabletrue if the same request may succeed later.
request_idInclude it when you contact support.
detailsExtra structured context, when available.

Error codes#

CodeWhat to do
UNAUTHORIZEDThe key is missing, invalid or expired. Sign in again.
FORBIDDENThe key lacks a scope or a permission. Check scopes.
NOT_FOUNDCheck the ID or slug.
BUDGET_EXCEEDEDAdd credit, or raise the spending limit.
CAPACITY_REACHEDWait and retry, or ask for less capacity.
CONFLICTThe resource changed state. Refresh it and retry.
IDEMPOTENCY_PAYLOAD_CONFLICTA request ID was reused with different settings. Use a new ID, or the original settings.
CONTRACT_INVALIDThe request failed validation. See details.
PLATFORM_FAILUREGFT had an internal problem. Retry if retryable is true.
CONNECTION_ERRORThe CLI could not reach the API. Check GFT_API_URL and your network.

CLI exit codes#

Exit codeMeaning
0Success.
1Any other error, a declined confirmation, or a followed run that did not complete.
2Not found, or invalid command-line arguments.
3Authentication or permission error.
4Budget exceeded.
5Capacity reached.
6Platform or connection error.

Use gft --json ... to get results as JSON in scripts. Errors stay on stderr as CODE: message request_id=....