JSON output schema reference
All -O json output from Ping CLI uses a consistent envelope structure.
Every response (success or failure) always contains six top-level fields (schemaVersion, status, message, data, errors, meta), making it straightforward to parse reliably without checking the shape of the output first.
A warnings field is included only when the command completes with non-fatal warnings.
NDJSON output has two modes:
-
-O ndjson(default) — each line is a raw record with no envelope. -
-O ndjson-wrapped— each line is the full envelope wrapping a single record.
Errors are always envelope-wrapped regardless of output format.
Envelope fields
Field |
Type |
Present |
Description |
|
string |
Always |
Schema version for the envelope. Currently |
|
string |
Always |
Result status. One of |
|
string |
Always |
Human-readable status message. Empty string when not applicable. |
|
any | null |
Always |
The command result payload. An array for list commands; a single object for get, create, and update commands; |
|
array |
Always |
Array of error objects on failure; empty array |
|
object |
Always |
Metadata about the command invocation. Refer to meta object. |
|
array |
When applicable |
Array of warning objects. Present only when the command completes with warnings. Absent when there are no warnings. Refer to warnings[] object. |
status values
Value |
When set |
|
Command completed successfully; result is in |
|
Command completed but with non-fatal warnings; result is in |
|
Command failed; |
|
The earlier |
errors[] object
Field |
Type |
Present |
Description |
|
string |
Always |
Machine-readable error code, for example |
|
string |
Always |
Error category. Refer to errors[].category values. |
|
boolean |
Always |
Whether the request can be retried automatically. |
|
string |
Always |
Human-readable description of the error. |
|
string |
When applicable |
A suggestion to help resolve the error. |
|
object |
API errors only |
Raw API response body for HTTP errors from |
meta object
Field |
Type |
Present |
Description |
|
string |
Always |
The full command that was invoked, reconstructed from |
|
integer |
Array results only |
The number of records in |
|
integer |
|
The HTTP status code returned by the upstream API. Absent on connector commands. |
warnings[] object
Field |
Type |
Description |
|
string |
Machine-readable warning code. |
|
string |
Human-readable description of the warning. |
NDJSON envelope behaviour
Format |
Envelope behaviour |
|
Each line is a raw record (the contents of |
|
Each line is the full envelope wrapping a single record. |
JSONSchema
The following JSON Schema (draft-07) can be used to validate -O json output or to generate client code.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Ping CLI JSON output envelope",
"type": "object",
"required": ["schemaVersion", "status", "message", "data", "errors", "meta"],
"properties": {
"schemaVersion": {
"type": "string",
"enum": ["1.0"]
},
"status": {
"type": "string",
"enum": ["success", "warning", "error"]
},
"message": {
"type": "string"
},
"data": {},
"errors": {
"type": "array",
"items": {
"type": "object",
"required": ["code", "category", "retryable", "message"],
"properties": {
"code": { "type": "string" },
"category": {
"type": "string",
"enum": [
"validation",
"unauthorized",
"forbidden",
"not_found",
"conflict",
"rate_limited",
"internal",
"network"
]
},
"retryable": { "type": "boolean" },
"message": { "type": "string" },
"suggestion": { "type": "string" },
"details": { "type": "object" }
}
}
},
"meta": {
"type": "object",
"required": ["command"],
"properties": {
"command": { "type": "string" },
"count": {
"type": "integer",
"description": "Present only when data is an array"
},
"api": {
"type": "object",
"properties": {
"httpStatus": { "type": "integer" }
}
}
}
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": ["code", "message"],
"properties": {
"code": { "type": "string" },
"message": { "type": "string" }
}
}
}
}
}