Indexes

Create an index on a ledger

Changed on

Registers a new index on the ledger. An existing canonical index on this ledger is rejected with INDEX_ALREADY_EXISTS (HTTP 409), even while building or retyping, without changing its definition or progress. Replaying an identical batch with its retained Idempotency-Key returns the original result. The indexbuilder processes the accepted creation. The request body carries the target IndexID in canonical form (see DELETE /v3/{ledgerName}/indexes/{canonicalId} for the format). Requires ledger:WriteLedger scope.

post/v3/{ledgerName}/indexes

Request

  • Base URL
    http://localhost:9000
  • URL
    http://localhost:9000/v3/{ledgerName}/indexes
  • Auth
    • HTTP bearer
    • or none

Path parameters

ledgerNamestring required

Name of the ledger

Headers

Idempotency-Keystring

Request body

idstring required

Canonical form of the target IndexID. One of: tx_builtin:<TX_BUILTIN_INDEX_*> log_builtin:<LOG_BUILTIN_INDEX_*> account_builtin:<ACCT_BUILTIN_INDEX_*> metadata:<TARGET_TYPE_*>:<key>

Example request

{
  "id": "metadata:TARGET_TYPE_ACCOUNT:color"
}

Response

Index creation queued. The body carries the canonical id of the created index (round-trip normalized), usable directly on the follow-up GET/DELETE /v3/{ledgerName}/indexes/{canonicalId} routes.

Example response

{
  "data": {
    "id": "metadata:TARGET_TYPE_ACCOUNT:color"
  }
}

Changes

    • info

      api operation id createIndex removed and replaced with v3CreateIndex

    • info

      added the media type text/plain for the response with the status

    • info

      added the media type text/plain for the response with the status

    • info

      added the non-success response with the status