Skip to content
StudyFetch API

PDF Generator

Generate a new PDF presentation

OpenAPI specification
POST/api/v1/pdf-generator/create

Authentication

x-api-key

Request

curl --globoff --request POST \
  --url 'https://api.example.com/api/v1/pdf-generator/create' \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "topic": "<topic>",
  "numberOfSlides": 1,
  "locale": "<locale>"
}'

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": {
    "topic": {
      "type": "string",
      "description": "The topic for the PDF presentation"
    },
    "numberOfSlides": {
      "type": "number",
      "description": "Number of slides to generate",
      "minimum": 1,
      "maximum": 50
    },
    "locale": {
      "type": "string",
      "description": "Locale/language for the presentation (e.g., en-US, es-ES, fr-FR)"
    },
    "imageMode": {
      "type": "string",
      "description": "Image handling mode: search (auto-search), generate (AI-generated images), provide-own (use custom images), none (no images, use icons)",
      "enum": [
        "search",
        "generate",
        "provide-own",
        "none"
      ],
      "default": "search"
    },
    "customImages": {
      "description": "Custom images to use (required when imageMode is \"provide-own\")",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Image URL to download and use (provide either url or base64)"
          },
          "base64": {
            "type": "string",
            "description": "Base64-encoded image data (provide either url or base64)"
          },
          "description": {
            "type": "string",
            "description": "Description of what this image shows"
          }
        },
        "required": [
          "description"
        ]
      }
    },
    "logoUrl": {
      "type": "string",
      "description": "Custom logo URL to use (optional, falls back to default StudyFetch logo)"
    }
  },
  "required": [
    "topic",
    "numberOfSlides",
    "locale"
  ]
}

Responses

201PDF presentation generated successfully
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "example": true
    },
    "presentation": {
      "type": "object",
      "properties": {
        "_id": {
          "type": "string",
          "description": "PDF presentation ID"
        },
        "topic": {
          "type": "string",
          "description": "Topic of the presentation"
        },
        "numberOfSlides": {
          "type": "number",
          "description": "Number of slides"
        },
        "locale": {
          "type": "string",
          "description": "Locale of the presentation"
        },
        "url": {
          "type": "string",
          "description": "URL to the generated PDF on S3"
        },
        "pptxUrl": {
          "type": "string",
          "description": "URL to the generated PowerPoint (PPTX) on S3"
        },
        "transcript": {
          "description": "Transcript of each slide",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "pageNum": {
                "type": "number",
                "description": "Page number of the slide"
              },
              "descriptionOfPage": {
                "type": "string",
                "description": "Description of the slide content and OCR text"
              }
            },
            "required": [
              "pageNum",
              "descriptionOfPage"
            ]
          }
        },
        "organizationId": {
          "type": "string",
          "description": "Organization ID"
        },
        "userId": {
          "type": "string",
          "description": "User ID"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string",
          "description": "Creation timestamp"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string",
          "description": "Update timestamp"
        }
      },
      "required": [
        "_id",
        "topic",
        "numberOfSlides",
        "locale",
        "url",
        "transcript",
        "organizationId",
        "createdAt",
        "updatedAt"
      ]
    }
  }
}