Skip to content
Docs menu

Delete an upload

Deletes the uploaded file right away. Conversions already created from it are not affected.

DELETEhttps://api.switchfile.io/v1/uploads/{id}

Needs an API key: Authorization: Bearer YOUR_API_KEY. See Authentication.

Example

curl -X DELETE "https://api.switchfile.io/v1/uploads/7d1f0f7e-0b55-4a8e-8c5b-9d8e3f1a2b3c" \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY"

Parameters

Path parameters

  • idstring (uuid)required

    upload_id from POST /v1/uploads

Headers

  • X-End-Userstring

    Service keys only: an ID for the visitor you act for (1 to 128 characters: letters, digits and . _ : @ -). Quotas and rate limits then count per visitor.

  • X-End-User-Ipstring

    Required with X-End-User: the IP address of the visitor.

Responses

  • 204Deleted
  • 401The API key is missing or not valid
    401 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-unauthenticated",
      "title": "Unauthenticated",
      "status": 401,
      "code": "UNAUTHENTICATED",
      "detail": "Missing or invalid API key."
    }
  • 403Not allowed: a signed URL is wrong or expired, or X-End-User was sent without a service key
    403 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-end-user-not-allowed",
      "title": "End user not allowed",
      "status": 403,
      "code": "END_USER_NOT_ALLOWED",
      "detail": "The X-End-User header is only allowed with a service key."
    }
  • 404Does not exist for this account
    404 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-not-found",
      "title": "Not found",
      "status": 404,
      "code": "NOT_FOUND",
      "detail": "Upload not found."
    }
  • 422Invalid data. errors names the fields
    422 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-invalid-data",
      "title": "Invalid data",
      "status": 422,
      "code": "INVALID_DATA",
      "detail": "The request contains invalid data.",
      "errors": {
        "to": [
          "Expected string"
        ]
      }
    }
  • 429Too many requests or a daily quota is used up. See Retry-After
    429 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-rate-limit-exceeded",
      "title": "Rate limit exceeded",
      "status": 429,
      "code": "RATE_LIMIT_EXCEEDED",
      "detail": "Too many requests. Try again in 12 seconds."
    }

Error bodies and codes are explained in Errors.