Naar inhoud springen
API-referentie
API-referentie

Een bestand verwijderen

Een bestand logisch verwijderen en de opgeslagen inhoud inplannen voor opschoning.

Een bestand logisch verwijderen en de opgeslagen inhoud inplannen voor opschoning.

Eindpunt

DELETE /v1/files/:file_id
Basis-URL
https://runapi.ai
API-versie
v1
Authenticatie
Authorization: Bearer YOUR_API_KEY
02

Verzoek

JSON-body

Stuur waarden alleen op de vermelde verzoeklocatie.

Padparameters1 veld
file_idstring
Verplicht

RunAPI File ID.

03

Succesvol antwoord

HTTP 200

DELETE /v1/files/:file_id

JSON
{
  "deleted": true,
  "id": "file_abc123",
  "object": "file"
}
04

Foutrespons (401)

HTTP 401
Responsschema
JSON
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}

Responsvoorbeeld

JSON
{
  "error": {
    "code": "authentication_error",
    "message": "Missing API key",
    "param": null,
    "type": "authentication_error"
  }
}
05

Foutrespons (404)

HTTP 404
Responsschema
JSON
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}

Responsvoorbeeld

JSON
{
  "error": {
    "code": "not_found",
    "message": "File not found",
    "param": null,
    "type": "invalid_request_error"
  }
}
06

Foutrespons (502)

HTTP 502
Responsschema
JSON
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}

Responsvoorbeeld

JSON
{
  "error": {
    "code": "storage_write_failed",
    "message": "File storage failed",
    "param": null,
    "type": "server_error"
  }
}
07

cURL-voorbeeld

CURL
curl -X DELETE https://runapi.ai/v1/files/file_abc123 \
  -H 'Authorization: Bearer YOUR_API_KEY'