---
updatedAt: 2026-08-25T23:06:23.000Z
agentTools:
  projectIndex: https://developer.intellistack.com/llms.txt
---

# Create or update a dataset substitution

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "DataSetSubstitution": {
        "properties": {
          "createdAt": {
            "format": "date-time",
            "readOnly": true,
            "type": "string"
          },
          "datasetId": {
            "format": "uuid",
            "type": "string"
          },
          "objectType": {
            "$ref": "#/components/schemas/DatasetSubstitutionObjectType"
          },
          "originalId": {
            "format": "uuid",
            "type": "string"
          },
          "substituteId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "datasetId",
          "objectType",
          "originalId",
          "substituteId"
        ],
        "type": "object"
      },
      "DataSetSubstitutionRequest": {
        "properties": {
          "objectType": {
            "$ref": "#/components/schemas/DatasetSubstitutionObjectType"
          },
          "originalId": {
            "format": "uuid",
            "type": "string"
          },
          "substituteId": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "objectType",
          "originalId",
          "substituteId"
        ],
        "type": "object"
      },
      "DatasetSubstitutionObjectType": {
        "enum": [
          "ENTITY",
          "FIELD",
          "RELATIONSHIP"
        ],
        "type": "string"
      },
      "ErrorDetails": {
        "description": "Details of an error",
        "properties": {
          "code": {
            "description": "Internal error code",
            "type": "string"
          },
          "detail": {
            "description": "Error details",
            "type": "string"
          },
          "sourceError": {
            "$ref": "#/components/schemas/ErrorDetails"
          },
          "title": {
            "description": "Error title",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorEnvelope": {
        "description": "Contains a list of errors",
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ErrorDetails"
            },
            "type": "array"
          },
          "message": {
            "description": "Top level message to describe the error",
            "type": "string"
          },
          "traceId": {
            "description": "Internal traceId",
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "Data Activation",
    "version": "0.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/activation/dataset/{dataSetId}/substitutions": {
      "post": {
        "operationId": "createDataSetSubstitutionV2",
        "parameters": [
          {
            "description": "The ID of the dataset",
            "in": "path",
            "name": "dataSetId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataSetSubstitutionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataSetSubstitution"
                }
              }
            },
            "description": "The created or updated substitution. When an entity remap would strand field mappings parented through the entity's current substitute, those field rows are removed automatically (see DELETE for the same cascade on entity removal)."
          },
          "400": {
            "description": "Invalid substitution request"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "The substitute is already held by another substitution this request does not rewrite."
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Create or update a dataset substitution",
        "tags": [
          "Dataset"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "US Production Server",
      "url": "https://api-us.streamline.intellistack.ai"
    },
    {
      "description": "Canada Production Server",
      "url": "https://api-ca.streamline.intellistack.ai"
    }
  ],
  "tags": [
    {
      "description": "v2 Data set related endpoints",
      "name": "Dataset"
    }
  ]
}
```