API Reference

An overview of all available API endpoints

Not sure where to start? Check out the quickstart section to get up and running with the API in minutes.

Prefer using Postman? Check out our Postman collection.

Generate a Presentation

POST https://api.slidespeak.co/api/v1/presentation/generate

Generate a presentation from plain text.

Headers

Name
Value

Content-Type

application/json

X-API-Key

<your api token>

Body

Name
Type
Description

plain_text

string

What to generate a presentation about.

length

number

The amount of slides.

template

string

The name of the template or the id of a custom template. See the custom templates section for more information. For options, see the Get All Templates endpoint.

language

string

The language to use in the presentation.

fetch_images

boolean

Whether to include stock images.

tone

string

The tone to use for the text. Options: default

casual

professional

funny

educational

sales_pitch

verbosity

string

how verbose, or long, the text should be. Options: consise

standard

text-heavy

custom_user_instructions

string

A custom instruction that should be followed when generating the presentation.

include_cover

boolean

Whether to include the 'cover' slide.

default: true

include_table_of_contents

boolean

Whether to include the 'table of contents' slides.

default: true

Code Examples

fetch('https://api.slidespeak.co/api/v1/presentation/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    "plain_text": "Key moments in the French Revolution",
    "length": 6,
    "template": "default",
    "language": "ORIGINAL",
    "fetch_images": true,
    "tone": "default",
    "verbosity": "standard",
    "custom_user_instructions": "Make sure to mention the storming of the Bastille"
  }),
})
  .then(response => response.json())
  .then(data => {
    console.log('Response:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

Example body

{
    "plain_text": "Key moments in the French Revolution",
    "length": 6,
    "template": "default",
    "language": "ORIGINAL",
    "fetch_images": true,
    "tone": "default",
    "verbosity": "standard",
    "custom_user_instructions": "Make sure to mention the storming of the Bastille"
}

Response

{
    "task_id": "353509d6-8efe-401c-a8a9-53ca64b520a3"
}

Generate a Presentation defined Slide by Slide

POST https://api.slidespeak.co/api/v1/presentation/generate/slide-by-slide

Generate a presentation slide by slide. This way, you can define the structure and content of each presentation slide directly.

Headers

Name
Value

Content-Type

application/json

X-API-Key

<your api token>

Body

Name
Type
Description

slides

list[dict]

A list of slides, each defined as a dictionary. The keys are: title, layout, item_amount and content_description. See the sample body below for further reference about the contents of each key.

template

string

language

string

The language to use in the presentation.

fetch_images

boolean

Whether to include stock images.

Example body

{
    "slides": [
        {
            "title": "Introduction to African Wildlife",
            "layout": "items",
            "item_amount": "1",
            "content_description": "Diversity of Species Over 1,100 mammal species, including iconic animals like elephants, lions, and rhinoceroses. Approximately 2,600 bird species, making Africa a birdwatcher's paradise. Ecosystems and Habitats Savannas: Home to large herbivores and predators, characterized by grasslands and scattered trees."
        },
        {
            "title": "Savannah Ecosystem: Flora and Fauna",
            "layout": "items",
            "item_amount": "4",
            "content_description": "Acacia Trees Key species: Acacia tortilis and Acacia senegal Adaptations: Deep roots and thorny branches for protection Zebras Species: Plains zebra (Equus quagga) Social structure: Live in herds, providing safety in numbers Giraffes Height: Can reach up to 18 feet (5.5 meters) Feeding habits: Primarily browse on leaves from tall trees Cheetahs Speed: Capable of running up to 60 mph (97 km/h) Hunting strategy: Use bursts of speed and keen eyesight to catch prey"
        }
    ]
}

Response

{
    "task_id": "353509d6-8efe-401c-a8a9-53ca64b520a3"
}

Get Task Status

GET https://api.slidespeak.co/api/v1/task_status/{{task_id}}

Get the status of a task.

Headers

Name
Value

Content-Type

application/json

X-API-Key

<your api token>

Get parameters

Name
Type
Description

task_id

string

The ID you got after starting tasks.

Examples

fetch('https://api.slidespeak.co/api/v1/task_status/9649d202-03ac-437a-80e8-ff91ff4ace67', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  }
})
  .then(response => response.json())
  .then(data => {
    console.log('Task status:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

Response

{
    "task_id": "9649d202-03ac-437a-80e8-ff91ff4ace67",
    "task_status": "SUCCESS",
    "task_result": {
        "url": "https://slidespeak-files.s3.us-east-2.amazonaws.com/24d89111-71a1-4c05-a909-2d84123c9ba9.pptx"
    },
    "task_info": {
        "url": "https://slidespeak-files.s3.us-east-2.amazonaws.com/24d89111-71a1-4c05-a909-2d84123c9ba9.pptx"
    }
}

Get All Templates

GET https://api.slidespeak.co/api/v1/presentation/templates

Headers

Name
Value

Content-Type

application/json

X-API-Key

<your api token>

Examples

fetch('https://api.slidespeak.co/api/v1/presentation/templates', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  }
})
  .then(response => response.json())
  .then(data => {
    console.log('Templates:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

Response

[
    {
        "name": "default",
        "images": {
            "cover": "https://app.slidespeak.co/images/themes/default-cover.jpg",
            "content": "https://app.slidespeak.co/images/themes/default-content.jpg"
        }
    },
    {
        "name": "gradient",
        "images": {
            "cover": "https://app.slidespeak.co/images/themes/gradient-cover.jpg",
            "content": "https://app.slidespeak.co/images/themes/gradient-content.jpg"
        }
    },
    ...
]

Edit Powerpoint

POST https://api.slidespeak.co/api/v1/presentation/edit

Headers

Name
Value

Content-Type

multipart/form-data

X-API-Key

<your api token>

Body (form-data)

Name
Type
Description

pptx_file

file

The PowerPoint you wish to edit.

config

json

A json object containing the values to change.

Examples

const pptxFile = /* your PPTX file (Blob or File) */;
const configObject = {
  replacements: [
    {
      shape_name: "TARGET_TITLE",
      content: "Your new title"
    },
    {
      shape_name: "TARGET_SUBTITLE",
      content: "A new fancy subtitle"
    },
    {
      shape_name: "TARGET_CONTENT",
      content: "Some new content"
    }
  ]
};

const formData = new FormData();
formData.append('pptx_file', pptxFile);
formData.append('config', JSON.stringify(configObject));

fetch('https://api.slidespeak.co/api/v1/presentation/edit', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY'
    // Note: Do not set 'Content-Type' manually here; 
    // Fetch will set it to multipart/form-data automatically
  },
  body: formData
})
  .then(response => response.json())
  .then(data => {
    console.log('Edit response:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

Example config

{
  "replacements": [
    {
      "shape_name": "TARGET_TITLE",
      "content": "Your new title"
    },
    {
      "shape_name": "TARGET_SUBTITLE",
      "content": "A new fancy subtitle"
    },
    {
      "shape_name": "TARGET_CONTENT",
      "content": "Some new content"
    }
  ]
}

Response

{
    "url": "https://slidespeak-pptx-writer.s3.amazonaws.com/02776182-b4d2-46d9-90c4-f40dbcbb3cfe.pptx"
}

Last updated