コンテンツにスキップ

bee api

Make an authenticated API request

The endpoint is a Backlog API path (e.g. users/myself). A leading /api/v2/ prefix is stripped automatically.

-f infers types (number, boolean, string); -F always sends strings. A value is only inferred as a number when the number prints back identically, so 1.0, 0042 and 0x10 stay strings. Repeated keys become arrays. Append [] for a single-element array (e.g. -f projectId[]=12345).

If a -f value starts with @, the rest of the value is interpreted as a filename to read the value from. Pass - to read from standard input (e.g. -f 'key=@-'). File and stdin content is always sent as a string, without type inference.

For GET, fields are query parameters. For POST/PUT/PATCH/DELETE, fields are the request body.

Terminal window
bee api [flags] <ENDPOINT>
ENDPOINT
API endpoint path
-X, --method <method>
HTTP method (default: GET)
-f, --field <key=value>
Add a typed parameter (use "@<path>" or "@-" to read value from file or stdin)
-F, --raw-field <key=value>
Add a string parameter (key=value, repeatable)
--json <fields>
Output as JSON (optionally filter by field names, comma-separated)
--silent
Do not print the response body
-s, --space <hostname>
Space hostname (e.g. xxx.backlog.com, or your own domain)
-y, --yes
Skip confirmation prompt

Get your user profile

Terminal window
bee api users/myself

List issues in a project

Terminal window
bee api issues -f 'projectId[]=12345' -f count=5

Filter by multiple statuses

Terminal window
bee api issues -f 'projectId[]=12345' -f statusId=1 -f statusId=2

Create an issue

Terminal window
bee api issues -X POST -f projectId=12345 -f summary="Test issue" -f issueTypeId=1 -f priorityId=3

Set a field value from a file

Terminal window
bee api issues/PROJECT-1 -X PATCH -f 'description=@desc.md'

Pipe content from stdin

Terminal window
echo 'Hello' | bee api issues/PROJECT-1/comments -X POST -f 'content=@-'

Select specific fields

Terminal window
bee api users/myself --json id,name,mailAddress
BACKLOG_SPACE
Space hostname (e.g. xxx.backlog.com, or your own domain)
BACKLOG_API_KEY
Authenticate with an API key
BACKLOG_SPACE
Space hostname