Skip to content
StudyFetch API

Materials

Create batch upload URLs for multiple materials

OpenAPI specification
POST/api/v1/materials/batch

Authentication

x-api-key

Request

curl --globoff --request POST \
  --url 'https://api.example.com/api/v1/materials/batch' \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "materials": [
    {
      "name": "Chapter 1",
      "filename": "document.pdf",
      "contentType": "application/pdf"
    }
  ]
}'

Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.

Replace https://api.example.com with the API server URL.

Use the sample JSON body as your starting point, and enter values that match the endpoint's schema.

Request body schema or example

{
  "type": "object",
  "properties": {
    "materials": {
      "description": "Array of materials to create",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Chapter 1",
            "description": "Material name"
          },
          "filename": {
            "type": "string",
            "example": "document.pdf",
            "description": "Filename"
          },
          "contentType": {
            "type": "string",
            "example": "application/pdf",
            "description": "MIME type"
          },
          "folderId": {
            "type": "string",
            "description": "Folder ID"
          }
        },
        "required": [
          "name",
          "filename",
          "contentType"
        ]
      }
    }
  },
  "required": [
    "materials"
  ]
}

Responses

201Batch upload URLs created successfully
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "Material name"
      },
      "uploadUrl": {
        "type": "string",
        "description": "Presigned upload URL"
      },
      "s3Key": {
        "type": "string",
        "description": "S3 key"
      },
      "materialId": {
        "type": "string",
        "description": "Material ID"
      }
    },
    "required": [
      "name",
      "uploadUrl",
      "s3Key",
      "materialId"
    ]
  }
}
400Invalid parameters
403Insufficient permissions