Delete multiple entities
POST/v1/blueprints/:blueprint_identifier/bulk/entities/delete
This route allows you to delete multiple entities (up to 100 entities per request) from a specific blueprint in your software catalog. All entities must belong to the same blueprint.
If any identifier is missing, the entire operation fails with 404 and nothing is deleted. If any entity has required dependents and delete_dependents is false, the entire operation fails with 403 and nothing is deleted.
Pass allow_partial_success=true to skip missing identifiers and entities with required dependents, delete the rest, and return 207 Multi-Status with errors for the skipped identifiers. If nothing could be deleted, the request still fails with 404 (all missing) or 403 (all have required dependents).
Pass delete_dependents=true to delete required dependents together with the requested entities.
To learn more about entities, check out the documentation.
Request
Parameters (JSON)
{
"parameters": [
{
"schema": {
"type": "boolean",
"default": false
},
"in": "query",
"name": "delete_dependents",
"required": true,
"description": "If `true`, this call will also delete all entities with a relation to the deleted entity."
},
{
"schema": {
"type": "boolean",
"default": false
},
"in": "query",
"name": "allow_partial_success",
"required": false,
"description": "If `true`, missing identifiers and entities with required dependents are skipped and the rest are deleted (`207`). Default fails the whole batch (`404` / `403`)."
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "run_id",
"required": false,
"description": "You can provide a `run_id` to associate the created entities with a specific [action run](https://docs.port.io/workflows/actions-and-automations/reflect-action-progress/#tie-entities-to-action-run) or with a workflow run (`wfr_...`)."
},
{
"schema": {
"type": "string",
"pattern": "^wfnr_"
},
"in": "query",
"name": "node_run_identifier",
"required": false,
"description": "The identifier of the workflow node run (`wfnr_...`) that is changing the entities. Only used together with a workflow run `run_id`."
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "ocean_info_resync_id",
"required": false,
"description": "Resync run identifier. Only valid when `ocean_info_event_type` is `resync`."
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "ocean_info_event_type",
"required": false,
"description": "How the operation was triggered."
},
{
"schema": {
"type": "string",
"minLength": 1
},
"in": "path",
"name": "blueprint_identifier",
"required": true,
"description": "The identifier of the blueprint to operate on."
}
]
}Request body schema (JSON)
{
"title": "Body",
"body": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"entities": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of entity identifiers to delete",
"minItems": 1,
"maxItems": 100
}
},
"required": [
"entities"
],
"additionalProperties": false
}
}
},
"required": true
}
}Responses
- 200
- 207
- 401
- 404
- 413
- 422
Entities deleted successfully.
Partially deleted successfully. Some entities were deleted while others failed.
Default Response
A resource with the provided identifier was not found
Request body is too large (limit is 1MiB)
The json provided does not match the route's schema
Responses (JSON)
{
"responses": {
"200": {
"description": "Entities deleted successfully.",
"content": {
"application/json": {
"schema": {
"description": "Entities deleted successfully.",
"type": "object",
"properties": {
"ok": {
"enum": [
true
]
},
"deletedEntities": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of deleted entity IDs"
},
"maxBulkSize": {
"type": "number"
}
},
"required": [
"deletedEntities",
"ok"
],
"additionalProperties": false
}
}
}
},
"207": {
"description": "Partially deleted successfully. Some entities were deleted while others failed.",
"content": {
"application/json": {
"schema": {
"description": "Partially deleted successfully. Some entities were deleted while others failed.",
"type": "object",
"properties": {
"ok": {
"enum": [
true
]
},
"deletedEntities": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of deleted entity IDs"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"identifier": {
"type": "string"
},
"index": {
"type": "number"
},
"statusCode": {
"type": "number"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"identifier",
"index",
"statusCode",
"error",
"message"
]
},
"description": "Failed entity identifiers with error details"
},
"maxBulkSize": {
"type": "number"
}
},
"required": [
"deletedEntities",
"errors",
"ok"
],
"additionalProperties": false
}
}
}
},
"401": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"404": {
"description": "A resource with the provided identifier was not found",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "A resource with the provided identifier was not found"
}
}
}
},
"413": {
"description": "Request body is too large (limit is 1MiB)",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false,
"description": "Request body is too large (limit is 1MiB)"
}
}
}
},
"422": {
"description": "The json provided does not match the route's schema",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "The json provided does not match the route's schema"
}
}
}
}
}
}