تخطَّ إلى المحتوى
مرجع API
مرجع API

سرد الملفات

سرد الملفات النشطة وفق ترتيب مؤشر حتمي.

سرد الملفات النشطة وفق ترتيب مؤشر حتمي.

نقطة النهاية

GET /v1/files
عنوان URL الأساسي
https://runapi.ai
إصدار API
v1
المصادقة
Authorization: Bearer YOUR_API_KEY
02

الطلب

نص JSON

أرسل القيم فقط في موقع الطلب المُدرج.

معاملات الاستعلام4 حقل
afterstring
اختياري

إرجاع الملفات بعد مؤشر معرّف الملف هذا.

limitinteger
اختياري

الحد الأقصى للملفات المُعادة.

القيمة الافتراضية: 10000 نطاق: 1 - 10000
orderstring
اختياري

الترتيب حسب وقت الإنشاء.

القيم المسموح بها: asc, desc القيمة الافتراضية: desc
purposestring
اختياري

تصفية حسب غرض الملف.

القيم المسموح بها: user_data, batch, batch_output
03

استجابة النجاح

HTTP 200

GET /v1/files

JSON
{
  "data": [
    {
      "bytes": 1048576,
      "created_at": 1785196800,
      "filename": "knowledge.pdf",
      "id": "file_abc123",
      "object": "file",
      "purpose": "user_data"
    }
  ],
  "first_id": "file_abc123",
  "has_more": false,
  "last_id": "file_abc123",
  "object": "list"
}
04

استجابة الخطأ (401)

HTTP 401
مخطط الاستجابة
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"
}

مثال على الاستجابة

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

استجابة الخطأ (400)

HTTP 400
مخطط الاستجابة
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"
}

مثال على الاستجابة

JSON
{
  "error": {
    "code": "invalid_request_error",
    "message": "Malformed request",
    "param": null,
    "type": "invalid_request_error"
  }
}
06

استجابة الخطأ (404)

HTTP 404
مخطط الاستجابة
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"
}

مثال على الاستجابة

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

استجابة الخطأ (409)

HTTP 409
مخطط الاستجابة
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"
}

مثال على الاستجابة

JSON
{
  "error": {
    "code": "upload_state_conflict",
    "message": "Upload state conflict",
    "param": null,
    "type": "invalid_request_error"
  }
}
08

استجابة الخطأ (413)

HTTP 413
مخطط الاستجابة
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"
}

مثال على الاستجابة

JSON
{
  "error": {
    "code": "file_too_large",
    "message": "File size exceeds the maximum allowed size",
    "param": "file",
    "type": "invalid_request_error"
  }
}
09

استجابة الخطأ (422)

HTTP 422
مخطط الاستجابة
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"
}

مثال على الاستجابة

JSON
{
  "error": {
    "code": "invalid_upload",
    "message": "Upload request rejected",
    "param": null,
    "type": "invalid_request_error"
  }
}
10

استجابة الخطأ (502)

HTTP 502
مخطط الاستجابة
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"
}

مثال على الاستجابة

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

مثال cURL

CURL
curl -X GET https://runapi.ai/v1/files?order=desc&purpose=user_data \
  -H 'Authorization: Bearer YOUR_API_KEY'