Skip to content

JSON Envelope Schema

All commands emit a standard JSON envelope when invoked with --json. The current schema version is 2026-06-02.

Success Envelope

json
{
  "ok": true,
  "data": { ... },
  "meta": {
    "command": "albums.list",
    "profile": "default",
    "duration_ms": 234,
    "schema_version": "2026-06-02",
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "warnings": []
  }
}

Fields

  • ok — always true on success.
  • data — command-specific payload. May be an object, array, or null.
  • meta — request metadata (always present).
  • meta.command — dot-separated command name (e.g. albums.list, photos.upload).
  • meta.profile — profile used for the request.
  • meta.duration_ms — wall-clock duration in milliseconds.
  • meta.schema_version — JSON schema version string.
  • meta.request_id — UUID for correlation and audit log lookup.
  • meta.warnings — optional array of non-fatal warning strings.

Error Envelope

json
{
  "ok": false,
  "error": {
    "code": "AUTH_REQUIRED",
    "message": "Authentication required. Run 'flickr auth login' to authenticate.",
    "category": "auth",
    "retryable": false,
    "details": {
      "profile": "default"
    }
  },
  "meta": {
    "command": "albums.list",
    "profile": "default",
    "duration_ms": 12,
    "schema_version": "2026-06-02",
    "request_id": "550e8400-e29b-41d4-a716-446655440001"
  }
}

Error Fields

  • ok — always false on error.
  • error.code — machine-readable error code (see table below).
  • error.message — human-readable description.
  • error.category — broad classification (e.g. auth, api, validation).
  • error.retryabletrue if retrying with the same parameters may succeed.
  • error.details — optional object with additional context (varies by error).

Error Codes

CodeCategoryRetryableMeaning
VALIDATION_FAILEDvalidationNoInput validation or argument error
AUTH_REQUIREDauthNoNo credentials configured; run auth login
AUTH_FAILEDauthNoOAuth exchange or test-login failed
FLICKR_API_ERRORapiDependsFlickr API returned a non-zero stat or error
NETWORK_UNREACHABLEnetworkYesDNS or TCP connection failed
PARTIAL_SUCCESSbatchNoSome items in a batch operation failed
READ_ONLY_VIOLATIONsafetyNo--read-only flag blocked a mutation
CONFIRMATION_REQUIREDsafetyNo--confirm flag missing for a high-risk op
FILESYSTEM_ERRORfilesystemNoLocal file/directory read or write failed
CONFIG_ERRORconfigNoConfiguration file is missing or invalid
CACHE_ERRORcacheNoLocal cache read or write failed
UNSUPPORTED_MEDIAvalidationNoFile type not supported for upload
INTERRUPTEDsystemNoProcess received SIGINT/SIGTERM
RESOURCE_NOT_FOUNDapiNoRequested photo, album, or user does not exist

Exit Code Mapping

The process exit code is derived from the error code:

Error Code(s)Exit Code
VALIDATION_FAILED1
AUTH_REQUIRED, AUTH_FAILED2
FLICKR_API_ERROR3
NETWORK_UNREACHABLE4
PARTIAL_SUCCESS5
READ_ONLY_VIOLATION, CONFIRMATION_REQUIRED6
FILESYSTEM_ERROR7
CONFIG_ERROR8
CACHE_ERROR9
UNSUPPORTED_MEDIA10
INTERRUPTED (SIGINT/SIGTERM)130
(unknown)1

Schema Version History

VersionDateChanges
2026-06-022026-06-02Initial schema version

Built with VitePress