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

# atlanai api

> Make an authenticated request to any Gateway endpoint.

`api` is the escape hatch for Gateway operations without a dedicated CLI
command. The CLI resolves the Gateway and credential before sending the request.

## Usage

```text theme={null}
atlanai api <method> <path> [flags]
```

| Argument   | Required | Description                                                                    |
| ---------- | -------- | ------------------------------------------------------------------------------ |
| `<method>` | yes      | HTTP method, such as `get`, `post`, `patch`, or `delete`.                      |
| `<path>`   | yes      | Absolute path (`/registry/v1/...`) or service-relative path (`registry:/...`). |

Use `--list-ops` without a request to inspect known operations.

## Options

| Option              | Type                     | Default | Description                                                        |
| ------------------- | ------------------------ | ------- | ------------------------------------------------------------------ |
| `--field`, `-f`     | `key=value`, repeatable  | none    | Add a string body or query field.                                  |
| `--raw-field`, `-F` | `key=value`, repeatable  | none    | Add a typed number, Boolean, `null`, `@file`, or `@-` stdin value. |
| `--header`, `-H`    | `name:value`, repeatable | none    | Add a request header. Do not pass credentials here.                |
| `--input`           | path or `-`              | none    | Read the request body from a file or stdin.                        |
| `--paginate`        | Boolean                  | `false` | Follow response pages until complete.                              |
| `--slurp`           | Boolean                  | `false` | With `--paginate`, merge pages into one JSON array.                |
| `--jq`, `-q`        | string                   | none    | Filter the JSON response with jq.                                  |
| `--template`, `-t`  | string                   | none    | Render response JSON with a Go template.                           |
| `--list-ops`        | Boolean                  | `false` | List known Gateway operations and exit.                            |
| `--dry-run`         | Boolean                  | `false` | Print the request without sending it.                              |
| `--confirm`         | Boolean                  | `false` | Skip the prompt for destructive methods.                           |

`--field` always sends strings. `--raw-field` converts integers, `true`,
`false`, and `null`; values starting with `@` read a file, and `@-` reads stdin.

## Examples

Read identity:

```bash theme={null}
atlanai api get registry:/auth/whoami
```

Create a workspace with a string field:

```bash theme={null}
atlanai api post registry:/workspaces -f display_name=Team
```

Send typed fields:

```bash theme={null}
atlanai api post registry:/search \
  -F limit=10 \
  -F is_system_included=false
```

Fetch every page:

```bash theme={null}
atlanai api get registry:/artifacts/skill --paginate --slurp
```

Preview a destructive request:

```bash theme={null}
atlanai api delete registry:/artifacts/skill/skill_123 --dry-run
```

## Output and behavior

* Response data goes to stdout; progress and diagnostics go to stderr.
* `--jq` and `--template` operate on JSON responses.
* Pagination stops when the response has no next page. `--slurp` requires
  `--paginate`.
* Destructive methods prompt unless `--confirm` is supplied. Prefer
  `--dry-run` before skipping confirmation.
* Authentication failures exit with code `4`; other HTTP or decoding failures
  exit with code `1`.

## Related

* [Automate with the CLI](/cli/api-automation)
* [Public API overview](/developers/api-reference)
* [`atlanai auth`](/cli/reference/auth)
