curl --request DELETE \
--url https://api.orion.file.ai/prod/v1/file-type \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"blueprintIds": [
"649e2d2d2d2d2d2d2d2d2d2d",
"649e2d2d2d2d2d2d2d2d2d2e"
]
}
'import requests
url = "https://api.orion.file.ai/prod/v1/file-type"
payload = { "blueprintIds": ["649e2d2d2d2d2d2d2d2d2d2d", "649e2d2d2d2d2d2d2d2d2d2e"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({blueprintIds: ['649e2d2d2d2d2d2d2d2d2d2d', '649e2d2d2d2d2d2d2d2d2d2e']})
};
fetch('https://api.orion.file.ai/prod/v1/file-type', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orion.file.ai/prod/v1/file-type",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'blueprintIds' => [
'649e2d2d2d2d2d2d2d2d2d2d',
'649e2d2d2d2d2d2d2d2d2d2e'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orion.file.ai/prod/v1/file-type"
payload := strings.NewReader("{\n \"blueprintIds\": [\n \"649e2d2d2d2d2d2d2d2d2d2d\",\n \"649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.orion.file.ai/prod/v1/file-type")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"blueprintIds\": [\n \"649e2d2d2d2d2d2d2d2d2d2d\",\n \"649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orion.file.ai/prod/v1/file-type")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"blueprintIds\": [\n \"649e2d2d2d2d2d2d2d2d2d2d\",\n \"649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"deletedCount": 1,
"failedCount": 2,
"errors": [
{
"blueprintId": "649e2d2d2d2d2d2d2d2d2d2e",
"message": "Schema is not found or already deleted"
},
{
"blueprintId": "bad-id",
"message": "Invalid schema ID format"
}
]
}{
"type": "https://errors.file.ai/bad-request",
"title": "Bad request",
"status": 400,
"detail": "Invalid input",
"instance": "/v1/{route}",
"code": "BAD_REQUEST",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [],
"message": "Invalid input",
"error": "Bad Request",
"statusCode": 400
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}Delete file types
This endpoint is used to bulk delete file types.
Each id is processed independently. The endpoint returns HTTP 200 whenever the request is authorized and the body is valid, even when some or all ids fail — per-id failures are reported in errors[], and success is false only when nothing was deleted and at least one id failed.
Deleting an id that was already deleted yields a per-item “Schema is not found or already deleted” error rather than a request-level failure, so retries are safe.
Malformed ids are reported as per-item Invalid schema ID format errors, not as a validation failure for the whole request. Duplicate ids are processed once.
An id that fails for an unexpected reason reports the generic message Schema could not be deleted; the underlying cause is recorded server-side.
At most 50 ids may be sent per request; a larger batch is rejected with 422 VALIDATION_FAILED before any deletion runs. Deletion is performed inline and one id at a time, so split larger sets across requests.
The Idempotency-Key header is optional. When supplied, a repeated request with the same key replays the original response for 24 hours.
curl --request DELETE \
--url https://api.orion.file.ai/prod/v1/file-type \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"blueprintIds": [
"649e2d2d2d2d2d2d2d2d2d2d",
"649e2d2d2d2d2d2d2d2d2d2e"
]
}
'import requests
url = "https://api.orion.file.ai/prod/v1/file-type"
payload = { "blueprintIds": ["649e2d2d2d2d2d2d2d2d2d2d", "649e2d2d2d2d2d2d2d2d2d2e"] }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({blueprintIds: ['649e2d2d2d2d2d2d2d2d2d2d', '649e2d2d2d2d2d2d2d2d2d2e']})
};
fetch('https://api.orion.file.ai/prod/v1/file-type', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orion.file.ai/prod/v1/file-type",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'blueprintIds' => [
'649e2d2d2d2d2d2d2d2d2d2d',
'649e2d2d2d2d2d2d2d2d2d2e'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orion.file.ai/prod/v1/file-type"
payload := strings.NewReader("{\n \"blueprintIds\": [\n \"649e2d2d2d2d2d2d2d2d2d2d\",\n \"649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.orion.file.ai/prod/v1/file-type")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"blueprintIds\": [\n \"649e2d2d2d2d2d2d2d2d2d2d\",\n \"649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orion.file.ai/prod/v1/file-type")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"blueprintIds\": [\n \"649e2d2d2d2d2d2d2d2d2d2d\",\n \"649e2d2d2d2d2d2d2d2d2d2e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"deletedCount": 1,
"failedCount": 2,
"errors": [
{
"blueprintId": "649e2d2d2d2d2d2d2d2d2d2e",
"message": "Schema is not found or already deleted"
},
{
"blueprintId": "bad-id",
"message": "Invalid schema ID format"
}
]
}{
"type": "https://errors.file.ai/bad-request",
"title": "Bad request",
"status": 400,
"detail": "Invalid input",
"instance": "/v1/{route}",
"code": "BAD_REQUEST",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [],
"message": "Invalid input",
"error": "Bad Request",
"statusCode": 400
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}Overview
Permanently deletes one or more blueprint schemas. This is a bulk operation: eachblueprintId is deleted independently, one at a time, so it is possible for some IDs to succeed while others fail in the same request.
blueprintId is deleted, the endpoint returns 200 OK with success: true. Always check failedCount and errors rather than relying on success alone to detect partial failures — see Response below.Request
Request Body
The request body must contain a JSON object with the following structure:| Property | Type | Required | Description |
|---|---|---|---|
| blueprintIds | string[] | Yes | One or more blueprint schema IDs to delete. Minimum 1, maximum 50 per request. Repeated IDs are collapsed and processed once. A malformed ID is reported in errors rather than failing the whole request. |
Request Examples
Single blueprint schema
{
"blueprintIds": ["649e2d2d2d2d2d2d2d2d2d2d"]
}
Multiple blueprint schemas
{
"blueprintIds": ["649e2d2d2d2d2d2d2d2d2d2d", "649e2d2d2d2d2d2d2d2d2d2e"]
}
blueprintIds is rejected with 422 VALIDATION_FAILED before any deletion runs.Response
A200 OK is returned whenever the request is authorized and the body is valid, even when some or all IDs fail — inspect the payload for per-ID outcomes.
| Field | Type | Description |
|---|---|---|
| success | boolean | false only when nothing was deleted and at least one ID failed. A partial failure (some succeeded, some failed) still returns true — this is the intended contract, so check failedCount/errors to detect partial failures. |
| deletedCount | number | Number of blueprintIds successfully deleted. |
| failedCount | number | Number of blueprintIds that failed to delete. |
| errors | array | Present when failedCount > 0. One entry per failed blueprintId. |
| errors[].blueprintId | string | The blueprintId that failed to delete. |
| errors[].message | string | Human-readable reason the deletion failed. One of a small, fixed set — see Per-item error messages below. |
All succeeded
{
"success": true,
"deletedCount": 2,
"failedCount": 0
}
Partial failure
Mixed valid/invalid IDs in the same request are handled independently — the valid ones are deleted and the rest are reported inerrors, without failing the whole request:
{
"success": true,
"deletedCount": 1,
"failedCount": 2,
"errors": [
{ "blueprintId": "649e2d2d2d2d2d2d2d2d2d2e", "message": "Schema is not found or already deleted" },
{ "blueprintId": "bad-id", "message": "Invalid schema ID format" }
]
}
Every ID failed
If none of the requested IDs could be deleted — for example, re-deleting IDs that were already deleted by a prior request —success is false:
{
"success": false,
"deletedCount": 0,
"failedCount": 2,
"errors": [
{ "blueprintId": "649e2d2d2d2d2d2d2d2d2d2d", "message": "Schema is not found or already deleted" },
{ "blueprintId": "649e2d2d2d2d2d2d2d2d2d2e", "message": "Schema is not found or already deleted" }
]
}
Per-item error messages
errors[].message is always one of the following:
| Message | Meaning |
|---|---|
Schema is not found or already deleted | The ID doesn’t resolve to a blueprint in this workspace — including a repeat delete of an ID a previous request already removed. Safe to retry/ignore. |
Invalid schema ID format | The ID isn’t a validly formatted schema ID. |
Schema is locked and cannot be deleted | The blueprint is locked and must be unlocked before it can be deleted. |
Unauthorized access | The caller’s org/workspace doesn’t have access to this blueprint. |
Schema could not be deleted | A generic fallback for any other, unexpected failure. The underlying cause is recorded server-side. |
Error Responses
All error responses use the standard RFC 9457 problem envelope (application/problem+json).
401 Unauthorized
Returned when thex-api-key header is missing or invalid.
403 Forbidden
Returned when the API key is inactive, or when the key is a read-only key (READONLY_KEY) — delete is a write operation and is rejected for read-only keys regardless of whether any of the IDs exist.
422 Unprocessable Entity
Returned for request-level validation failures — distinct from an individual ID that doesn’t resolve to a blueprint, which is reported per-item inerrors (see above), not as a 422:
blueprintIdsis missing or empty.blueprintIdscontains more than 50 IDs.blueprintIdsis not an array of strings.
Important Notes
- Irreversible action: deleted blueprint schemas cannot be recovered.
- Independent, sequential processing: each
blueprintIdin the array is attempted separately, one at a time. One failing ID never blocks the others from being deleted. - Malformed IDs: an entry that isn’t a valid ID format is reported as a failed item in
errors(not a request-level 422), alongside any other per-ID failure. - Duplicate IDs: duplicate
blueprintIds in the same request are de-duplicated before processing. - Re-delete (not found): deleting a
blueprintIdthat doesn’t exist — including one already deleted by a prior request — fails that item with"Schema is not found or already deleted"inerrorsrather than raising a request-level 404. This makes retries safe. - Batch size: at most 50
blueprintIdsper request. - Permission checks: a read-only API key cannot delete anything and receives a 403 for the whole request, regardless of whether the IDs are valid.
Use Cases
- Cleaning up unused or duplicate blueprint schemas.
- Bulk removal of blueprint schemas as part of a workspace reset or migration.
- Automated cleanup of temporary or test file types.
Best Practices
- Check
failedCountand inspecterrorson every response, even whensuccessistrue, to detect partial failures. - Treat re-deleting an already-deleted
blueprintIdas a safe no-op ("Schema is not found or already deleted") rather than an unexpected error. - Split batches larger than 50 IDs across multiple requests.
- Avoid using a read-only API key for this endpoint — it will always return 403.
Idempotency-Key request header so a retry
cannot apply the change twice. See
Idempotent requests.Authorizations
API key for authentication
Headers
Optional opaque key (max 255 chars, UUIDv4 recommended) making this request idempotent for 24h: a retry with the same key and body replays the original response with Idempotent-Replayed: true.
Body
File type ids to delete, at most 50 per request. Repeated ids are collapsed and processed once. A malformed id is reported in errors rather than failing the request.
1 - 50 elements[
"649e2d2d2d2d2d2d2d2d2d2d",
"649e2d2d2d2d2d2d2d2d2d2e"
]