Flags, Output and Exit Codes

linkedin commands share global flags, an output format and exit codes. This page describes all three, with the few commands that differ.

Global flags

Every command that calls Linked API supports these flags. The local commands setup, reset and account … print plain text and take none of them: account list ignores them, and the others reject them as unknown flags.

FlagDescription
--jsonStructured JSON output to stdout
--fields name,url,...Select specific fields in output
--quiet / -qSuppress stderr progress
--no-colorDisable colors
--account "Name"Use a specific account for this command. Admin commands do not take it – they use the current account's Linked API token; switch with linkedin account switch

Output format

JSON mode (--json or non-TTY stdout):

json
{"success": true, "data": {"name": "Vlad Prudnikov", "headline": "CEO at Linked API"}}
json
{"success": false, "error": {"type": "personNotFound", "message": "Person not found"}}

Human mode (TTY stdout): key-value pairs for objects, tables for arrays.

Request errors – invalid tokens, rate limits, a subscription that does not allow the action – are written to stderr as {"error": "…", "message": "…"} and set the exit codes below. linkedin changelog is the one command that prints its response as is, without this envelope and without --fields – see Changelog.

Exit codes

CodeMeaning
0Success (check success field – action may have returned an error like "person not found")
1General/unexpected error
2Missing or invalid tokens, or a usage error caught by the argument parser – a missing required argument or flag, an unknown flag, or a value outside the allowed list; the message is on stderr
3Subscription/plan required
4LinkedIn account issue
5Invalid arguments rejected by the command's own checks, or by the API as invalidRequestPayload or invalidWorkflow
6Rate limited
7Network error
8Workflow timeout (workflowId returned for recovery)