younifyd
Menu

Create (PUT)

Create

PUT/{index}/_create/{id}

Use it in a workflow

  1. Add a step and choose the OpenSearch connector.
  2. Pick the Create (PUT) action (under core).
  3. Fill in the fields below, then reference the result from later steps as {{createPut.response.data}}.

Request

Path parameters

idstringrequired

The unique identifier for the document.

indexstringrequired

Name of the data stream or index to target. If the target doesn't exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream. If the target doesn't exist and doesn't match a data stream template, this request creates the index.

Query parameters

pipelinestring

ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.

refreshoneOf

If `true`, OpenSearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. Valid values: `true`, `false`, `wait_for`.

routingoneOf

A custom value used to route operations to a specific shard.

timeoutstring

Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.

versioninteger (int64)

Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.

version_typeoneOf

The specific version type: `external`, `external_gte`.

wait_for_active_shardsoneOf

The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).

prettyboolean

Whether to pretty-format the returned JSON response.

Default false

humanboolean

Whether to return human-readable values for statistics.

Default false

error_traceboolean

Whether to include the stack trace of returned errors.

Default false

sourcestring

The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

filter_pathoneOf

A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.

Response

Returns 201 with an object. Read it in later steps with {{createPut.response.data.<field>}}.

_typestring

The type of document or resource.

_idstring

The unique identifier for a resource.

_indexstring
_primary_terminteger (int64)

The primary term of the document.

resultoneOf
_seq_nointeger (int64)

The sequence number of the document.

_shardsobject
failedintegerrequired
successfulintegerrequired
totalintegerrequired
failuresarray<object>4 fields
skippedinteger
_versioninteger (int64)
forced_refreshboolean
json
{
  "_id": "string",
  "_index": "string",
  "_primary_term": 0,
  "result": null,
  "_seq_no": 0,
  "_shards": {
    "failed": 0,
    "successful": 0,
    "total": 0,
    "failures": [
      {
        "shard": 0,
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ],
          "header": {}
        },
        "index": "string",
        "node": "string"
      }
    ],
    "skipped": 0
  },
  "_version": 0,
  "_type": "string",
  "forced_refresh": false
}

Need more? See the OpenSearch guide for connection setup and behaviour shared by every action.

Was this page helpful?