> ## Documentation Index
> Fetch the complete documentation index at: https://developers.parkes.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API requests

> Make authenticated REST requests without writing a separate HTTP client.

`parkes api` uses the same profile and credentials as named commands. Pass the HTTP method explicitly, followed by a relative path beginning with `/rest/v1/` or `/marketplace/v1/`:

```bash theme={null}
parkes api GET /rest/v1/me
parkes api GET '/rest/v1/skills?limit=10' --output json
```

Absolute URLs and redirects are rejected. Raw API requests do not bypass token scopes or resource permissions. Prefer a named command when one supports your task.

## Send JSON

Use `--input` for a JSON file, or `--input -` to read JSON from standard input. Inspect the writable schema before preparing a payload:

```bash theme={null}
parkes schema SkillCreate
```

For example, after preparing `skill.json`:

```bash theme={null}
parkes api POST /rest/v1/skills \
  --input skill.json \
  --idempotency-key "$IDEMPOTENCY_KEY" \
  --yes
```

Set `IDEMPOTENCY_KEY` to a fresh unique value before the first attempt. Every POST requires a key of at most 128 bytes. Preserve the key and body when retrying that same logical request.

`--yes` approves the mutation. Without it, an interactive terminal prompts for confirmation and noninteractive execution fails.

## Protect updates

Where the endpoint requires an ETag, provide the fetched value as `--if-match`. For example, after setting `SKILL_UUID` and `ETAG` and preparing `changes.json`:

```bash theme={null}
parkes api PATCH "/rest/v1/skills/$SKILL_UUID" \
  --input changes.json \
  --if-match "$ETAG" \
  --yes
```

The raw command prints the response body, not its headers. Obtain the ETag from an HTTP read response, or use a named update command that handles its resource's conditional write flow. Knowledge content writes additionally require a version token in the request body.

See [writes and concurrency](https://developers.parkes.ai/WRITES.md) for parent-resource ETags, idempotency, and asynchronous results.

## Follow pagination

For a cursor-paginated GET collection:

```bash theme={null}
parkes api GET /rest/v1/skills --paginate --output jsonl
```

`--paginate` follows the collection's `page.next_cursor` until it is null. It requires GET and the standard collection envelope; it is not a generic streaming or event-feed client.

## Handle failures

The CLI writes diagnostics to stderr and exits nonzero when a request fails. Writes are not automatically retried. After a timeout, check the resource or operation before repeating a mutation. See [scripting](https://developers.parkes.ai/cli/SCRIPTING.md) for exit codes and output guarantees.

## Marketplace management

Publisher requests use `/marketplace/v1` with the same profile and bearer credential. Customer browsing and installations keep using `/rest/v1/marketplace`. See the [Marketplace API guide](https://developers.parkes.ai/marketplace/OVERVIEW.md).

```bash theme={null}
parkes api GET /marketplace/v1/listings
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.