QANATIX
API Reference

Portal Records & Collections

JWT-authenticated endpoints for managing records and collections from the portal.

Portal Records & Collections

These endpoints let you manage individual records and collections from the developer portal. Unlike the main Records API (which uses API keys), these use JWT tokens from portal sign-in.

All endpoints are under /api/v1/portal/.

GET /portal/records/{id}

Get a single record with all fields.

curl https://api.qanatix.com/api/v1/portal/records/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Response (200)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Stainless Steel Bolt M8x40",
  "collection": "manufacturing",
  "record_type": "fastener",
  "collection_data": {
    "part_number": "SS-M8-40-A2",
    "material": "Stainless Steel A2",
    "price_eur": 0.12,
    "in_stock": true
  },
  "indexing_status": "indexed",
  "visibility": "private",
  "generation": 1,
  "source_name": "catalog-2026",
  "created_at": "2026-03-07T10:00:00Z",
  "updated_at": "2026-03-07T10:05:00Z"
}

Returns the full record including collection_data and timestamps.

PATCH /portal/records/{id}

Update an record. Only include fields you want to change. You can update top-level fields like name as well as domain-specific fields inside collection_data.

curl -X PATCH https://api.qanatix.com/api/v1/portal/records/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{
    "collection_data": {
      "price_eur": 0.15,
      "in_stock": false
    }
  }'

Updatable fields

FieldTypeDescription
namestringRecord display name
collection_dataobjectDomain-specific fields (merged with existing data)
visibilitystring"private" or "public" — controls QANATIX Open visibility
source_namestringSource label

Re-indexing behavior

After a successful update, the record's search_text tsvector is automatically rebuilt. The search index stays in sync with the latest data instantly. You do not need to call the reindex endpoint separately after an update.

Response (200)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Stainless Steel Bolt M8x40",
  "collection": "manufacturing",
  "record_type": "fastener",
  "collection_data": {
    "part_number": "SS-M8-40-A2",
    "material": "Stainless Steel A2",
    "price_eur": 0.15,
    "in_stock": false
  },
  "indexing_status": "indexed",
  "generation": 1,
  "source_name": "catalog-2026",
  "created_at": "2026-03-07T10:00:00Z",
  "updated_at": "2026-03-09T14:30:00Z"
}

Returns the full updated record, including the updated collection_data.

DELETE /portal/records/{id}

Soft-delete (archive) an record. Removes it from search results.

curl -X DELETE https://api.qanatix.com/api/v1/portal/records/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Response

204 No Content

DELETE /portal/collections/{name}

Delete an entire collection. Archives all records and removes their search indexes.

curl -X DELETE https://api.qanatix.com/api/v1/portal/collections/manufacturing \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Response (200)

{
  "collection": "manufacturing",
  "records_archived": 1250
}

POST /portal/collections/{name}/reindex

Reindex all records in a collection. Rebuilds the search_text tsvector for every record.

curl -X POST https://api.qanatix.com/api/v1/portal/collections/manufacturing/reindex \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Response (200)

{
  "collection": "manufacturing",
  "records_queued": 1250
}

POST /portal/records/{id}/reindex

Reindex a single record. Rebuilds its search_text tsvector. Use this when an record's search representation is stale.

curl -X POST https://api.qanatix.com/api/v1/portal/records/550e8400-e29b-41d4-a716-446655440000/reindex \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Response (200)

{
  "record_id": "550e8400-e29b-41d4-a716-446655440000",
  "jobs": 1
}

Response fields

FieldTypeDescription
record_idstring (UUID)The record that was reindexed
jobsintegerNumber of reindex jobs completed (always 1)

PATCH /portal/records/{id}/visibility

Toggle record visibility between private and public. Public records appear in QANATIX Open — searchable by any AI agent without authentication.

curl -X PATCH https://api.qanatix.com/api/v1/portal/records/550e8400-.../visibility \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{"visibility": "public"}'

Response (200)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "visibility": "public",
  "updated_at": "2026-03-11T14:30:00Z"
}

Setting to public indexes the record in the shared Open collection. Setting back to private removes it instantly.

PATCH /portal/collections/{name}/default-visibility

Set the default visibility for a collection and bulk-update all existing records. Unlike the API-key endpoint (/api/v1/collections/{name}/default-visibility) which only sets the default for future records, this portal endpoint updates every active record in the collection to match.

curl -X PATCH https://api.qanatix.com/api/v1/portal/collections/manufacturing/default-visibility \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{"default_visibility": "public"}'

Request body

FieldTypeDescription
default_visibilitystring"private" or "public"

Response (200)

{
  "collection": "manufacturing",
  "default_visibility": "public",
  "records_updated": 1250
}
FieldTypeDescription
collectionstringThe collection name
default_visibilitystringNew default visibility
records_updatedintegerNumber of records whose visibility was changed

Behavior

  • Sets the default visibility for all future records created in this collection
  • Bulk-updates all existing active (non-archived) records to match
  • Propagates visibility changes to the Open search index on a best-effort basis
  • Creates the collection metadata record if it doesn't exist

Error responses

StatusMeaning
401Missing or invalid JWT token
403Token valid but insufficient permissions
404Record or collection not found
422Validation error (invalid request body)

On this page