> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/metadata.md).

# metadata

Connection metadata introspection — record types, sObjects, tables, and field/column definitions fetched live from the remote system through a configured Celigo connection.

**REST API**: no dedicated spec — metadata hits adaptor-specific paths under `/v1/netsuite/metadata/…`, `/v1/salesforce/metadata/…`, and the generic `PUT /v1/connections/{_id}/metadata` bridge for RDBMS and JDBC connections. See the specs index and `connection.yml` for the underlying connection shape.

```
celigo metadata <subcommand> <connectionId> [entityType] [flags]
```

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md). Auto-detects the adaptor from the connection's `type` — only `netsuite`, `salesforce`, `rdbms`, and — since celigo-cli 2026.11.2 — `jdbc` connections are supported.

Both subcommands are reads and work in every [permission mode](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes). Since celigo-cli 2026.10.1 that includes `read` mode on an RDBMS connection: its catalog lookup is `PUT /v1/connections/{_id}/metadata` — a PUT by verb, a read by effect — and it is the one PUT the read-mode gate lets through (that exact path, with a lowercase 24-character hex id and no query string). Earlier releases refused it in `read` mode. A JDBC connection's lookup is the same request, so it runs in `read` mode too.

***

## Subcommands

| Subcommand                           | Purpose                                                                                                                |
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `types <connectionId>`               | List entity types on a connection (NetSuite record types + saved searches, Salesforce sObjects, RDBMS or JDBC tables). |
| `fields <connectionId> <entityType>` | List fields/columns for a single entity (NetSuite record type, Salesforce sObject, or RDBMS or JDBC table).            |

***

## `celigo metadata types <connectionId>`

List the entity types available on a live connection. The CLI first `GET`s the connection, reads its `type`, and then dispatches to the correct adaptor endpoint.

**Signature**

```bash
celigo metadata types <connectionId> [--refresh]
```

**Arguments**

| Argument         | Type   | Required | Description                                                                                               |
| ---------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------- |
| `<connectionId>` | string | Yes      | Connection ID. Must resolve to a connection whose `type` is `netsuite`, `salesforce`, `rdbms`, or `jdbc`. |

**Flags**

| Flag        | Type    | Default | Description                                                                                                                                                                                                |
| ----------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--refresh` | boolean | `false` | Bypass the server-side metadata cache and fetch fresh data from the remote system. Applied as `?refreshCache=true` for NetSuite/Salesforce and as `refreshCache: true` in the PUT body for RDBMS and JDBC. |

**Example**

```bash
# NetSuite — record types + saved searches, merged into one list
celigo metadata types 5f83a9b2c7d3e8f1a2b3c4d5

# Salesforce — sObject types
celigo metadata types 5f83a9b2c7d3e8f1a2b3c4d5 --format json

# RDBMS — tables (force a fresh pull)
celigo metadata types 5f83a9b2c7d3e8f1a2b3c4d5 --refresh
```

**Corresponds to** (dispatched by connection `type`):

* NetSuite: `GET /v1/netsuite/metadata/suitescript/connections/{connectionId}/recordTypes` and `GET /v1/netsuite/metadata/suitescript/connections/{connectionId}/savedSearches`
* Salesforce: `GET /v1/salesforce/metadata/connections/{connectionId}/sObjectTypes`
* RDBMS and JDBC: `PUT /v1/connections/{connectionId}/metadata` with body `{ "rdbms": { "type": "tables", "tables": "" }, "refreshCache": <bool> }`

For a NetSuite connection, a record type's `scriptId` (e.g. `salesorder`) is the name [`metadata fields`](#celigo-metadata-fields-less-than-connectionid-greater-than-less-than-entitytype-greater-than) takes; its `id` is NetSuite's internal id. Since celigo-cli 2026.10.2 the NetSuite table shows `scriptId` as its first column, beside `id`, `name` and `_metaType`. JSON output and `--jq` already carried it: each row is the record type or saved search as the platform sends it, with `_metaType` added.

For an RDBMS or JDBC connection, `--format table` prints one row per table (`database`, `schema`, `table`) since celigo-cli 2026.10.1; earlier releases printed the reply as one `results` row of JSON. JSON output and `--jq` get the reply as the platform sends it — for an RDBMS connection, `{"results": [...]}`.

***

## `celigo metadata fields <connectionId> <entityType>`

List fields (or columns) for a single entity. For Salesforce, the response includes related record types alongside the fields.

**Signature**

```bash
celigo metadata fields <connectionId> <entityType> [--refresh]
```

**Arguments**

| Argument         | Type   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<connectionId>` | string | Yes      | Connection ID (`netsuite`, `salesforce`, `rdbms`, or `jdbc`).                                                                                                                                                                                                                                                                                                                                                                                                             |
| `<entityType>`   | string | Yes      | The entity to inspect. NetSuite: the record type's `scriptId` (e.g. `customer`, `salesorder`), as `metadata types` shows it — not its internal `id`. Salesforce: sObject API name (e.g. `Account`, `Contact`). RDBMS and JDBC: fully qualified table name (e.g. `analytics.public.orders`); a name with a space, such as `dbo.Order Details`, works. Since celigo-cli 2026.10.1, a value holding `/`, `?`, `#`, `\`, a tab or a line break is refused before any request. |

**Flags**

| Flag        | Type    | Default | Description                                      |
| ----------- | ------- | ------- | ------------------------------------------------ |
| `--refresh` | boolean | `false` | Bypass the cache and fetch fresh field metadata. |

**Example**

```bash
# NetSuite record type
celigo metadata fields 5f83a9b2c7d3e8f1a2b3c4d5 customer

# Salesforce sObject
celigo metadata fields 5f83a9b2c7d3e8f1a2b3c4d5 Account --format json

# RDBMS (Snowflake) — must be fully qualified
celigo metadata fields 5f83a9b2c7d3e8f1a2b3c4d5 analytics.public.orders --refresh
```

**Corresponds to** (dispatched by connection `type`):

* NetSuite: `GET /v1/netsuite/metadata/suitescript/connections/{connectionId}/recordTypes/{entityType}`
* Salesforce: `GET /v1/salesforce/metadata/connections/{connectionId}/sObjectTypes/{entityType}`
* RDBMS and JDBC: `PUT /v1/connections/{connectionId}/metadata` with body `{ "rdbms": { "type": "columns", "tables": "<entityType>" }, "refreshCache": <bool> }`

For an RDBMS or JDBC connection, `--format table` prints one row per column (`column`, `dataType`, `isNull`, `comment`, and `table` when the reply describes several tables) since celigo-cli 2026.10.1. JSON output and `--jq` get the reply as the platform sends it.

***

## Gotchas

* **Only four connection types are supported.** The CLI pre-flights with `GET /v1/connections/{id}` and rejects anything that isn't `netsuite`, `salesforce`, `rdbms`, or `jdbc` with: `Connection <id> has type "<type>" — metadata is only supported for netsuite, salesforce, rdbms, jdbc connections.` Since celigo-cli 2026.11.2, a JDBC connection's tables and columns are read with the same catalog request an RDBMS connection uses; earlier releases refused a `jdbc` connection as an unsupported type.
* **`--refresh` invalidates the cached metadata.** Without it you get whatever the server cached on the last introspection. Pass it after a schema change in the remote system (new NetSuite custom field, new Salesforce custom object, new RDBMS column) to avoid stale pickers.
* **NetSuite `types` merges two endpoints.** Record types and saved searches come back as a single list with a synthesized `_metaType` column (`recordType` or `savedSearch`) so you can tell them apart. Default table columns: `scriptId`, `id`, `name`, `_metaType` — pass a record type's `scriptId` to `metadata fields`.
* **Salesforce `fields` returns fields and record types together.** The response is an object with both — don't expect a flat array.
* **RDBMS and JDBC go through the generic connection metadata bridge.** NetSuite and Salesforce have dedicated `GET` endpoints; RDBMS and JDBC use `PUT /v1/connections/{id}/metadata` with a `rdbms.type` of `tables` or `columns`. The verb is `PUT` by design, not a typo. It describes the tables or columns the body names and changes nothing, so since celigo-cli 2026.10.1 a `read`-mode profile can run it; every other PUT stays blocked in `read` mode.
* **RDBMS tables must be fully qualified.** For Snowflake/BigQuery/Postgres the entity name must be `database.schema.table` (or whatever the connection's default schema expects). If the call returns an empty column list, the CLI prints a yellow hint pointing at qualification and column-metadata permissions (e.g. BigQuery `bigquery.tables.get` on the dataset).
* **The connection must be reachable.** Metadata is fetched live — an offline or failing connection will return an error from the remote system, not an empty list. Run `celigo connections ping <id>` first when in doubt.

## Related

* [connections](https://developer.celigo.com/cli/commands/connections.md) — the `<connectionId>` argument; also where you configure the credentials the metadata calls ride on.
* [imports](https://developer.celigo.com/cli/commands/imports.md) — field pickers in import mappings consume the same metadata.
* [exports](https://developer.celigo.com/cli/commands/exports.md) — export field selection (NetSuite record-type fields, Salesforce sObject columns, RDBMS table columns) mirrors what `metadata fields` returns.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/metadata.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
