---
title: "Set Selection Endpoint"
method: POST
path: "/v1/connectors/{connector_id}/selection"
tags: ["v1-connectors"]
---

# Set Selection Endpoint

`POST /v1/connectors/{connector_id}/selection`

## Request

- Base URL: `https://api.tryardent.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tryardent.com/v1/connectors/{connector_id}/selection`
- Auth: none declared

Set entity selection for indexing.

This determines which entities (databases, schemas, tables) from the discovered
schema will be indexed and available for querying.

Special Selection Mode:
- Use "*" in selected_paths to select ALL entities (wildcard selection)
- Example: {"selected_paths": ["*"]} will index the entire discovered schema

Flow:
1. Load current connector and schema_structure
2. Prune schema tree to only include selected paths (or use full schema if "*")
3. Update DB with:
   - selected_entity_paths (user's input)
   - selected_schema_structure (pruned tree or full schema)
   - selection_schema_version (snapshot of current schema_version)
   - selected_schema_version (incremented counter)
4. Return pruned schema

After selection, user must call POST /{connector_id}/index to apply changes.

Requirements:
- User must have admin access to connector's org
- Connector must exist with schema_structure (discovery completed)

WARNING: This does NOT auto-include FK targets! If you select tables with
foreign key relationships, you must manually select the referenced tables
or risk dangling references in the indexed schema.

## Path parameters

- `connector_id` string, required

## Request body

- SelectionRequest
  - `selected_paths` string[], required: Discovered paths to replicate. Use `["*"]` to select everything.

## Response `200`

The connector row with the applied selection fields.

- ConnectorRow: Loose core of a connector response. The connector row is the most dynamic shape in the system; extra="allow" is the contract — responses carry many more columns and clients must tolerate fields not listed here. can_update/can_delete are added by the permission projection on create/get/update/list responses.
  - `id` string, required: Connector ID.
  - `org_id` string, required: Organization the connector belongs to.
  - `project_id` string, nullable: Project the connector belongs to.
  - `name` string, required: Connector name.
  - `service_name` string, required: Service type. `postgresql` today.
  - `status` string, nullable: Current connector status.
  - `created_at` string, nullable: When the connector was created.
  - `can_update` boolean, nullable: Whether the caller may update this connector.
  - `can_delete` boolean, nullable: Whether the caller may delete this connector.

## Other responses

- `400`: No discovered schema to select from, or an invalid selection.
- `404`: Connector not found (or not visible to the caller).
- `422`: Validation Error

---

[API](https://skmtc.dev/tryardent/apis/tryardent-api.md) - [All operations](https://skmtc.dev/tryardent/apis/tryardent-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tryardent/apis/tryardent-api/revisions/a0512915b997?raw)
