collection.create
Uploads a single PDF document and creates a flipbook with a single item (flipbook).
Note: Requests must be made to https://upload.flipsnack.com/v1.
Once the upload has finished, the flipbook is created and the PDF document starts the conversion process. Converting a PDF document into a flipbook might take up to several minutes, depending on the size of the document.
The API method will return a response as soon as the document is finished uploading. You can check the status of the flipbook item using the collection.getCollection method. It will let you know if the document is still converting, has finished conversion, or if the conversion process has failed.
Once the API call is successful, even if the document fails to convert, the request is counted in the monthly upload counts. If the request fails, the request is not taken into consideration for the monthly upload counts.
You can now customize the player (logo, background image, background audio, appearance, navigation, sharing, interaction, and tracking) in the same collection.create call. When uploading any customization file (logoImage, backgroundImage, or backgroundAudio), send the request as POST with multipart/form-data.
If you use fileUrl without a local file upload, customize asset files cannot be attached in the same request unless you also send multipart file fields. In that case, create the flipbook first and upload customize assets later with collection.update.
Request parameters
Name
Type
Description
apiKey (required)
string
The API key provided for your user. If it is not specified, the request will return the error code "30 - Missing mandatory parameter". If the key is incorrect the request returns the error code "41 - Invalid credentials".
signature (required)
string
The signature must be calculated by you and added to the request. See How to sign a request for more information.If the parameter is missing the request will return the error code "30 - Missing mandatory parameter". If the signature is incorrect the request will return the error code "44 - Invalid signature".
action (required)
string
The API method that should be called. In this case the value should be collection.create. If it is not specified, the request will return the error code "30 - Missing mandatory parameter".
file (required)
file
The PDF document that should be uploaded. Documents can be uploaded either using a local file, through the file parameter, or from an external URL, using the fileUrl parameter. You must specify at least one of them. If both parameters are specified, the API will take into consideration only the file parameter. If neither file or fileUrl are specified the request will return the error code "30 - Missing mandatory parameter".
Also, file uploads are bound to API limitations.
fileUrl (required)
string
The URL of a PDF document. Documents can be uploaded either using a local file, through the file parameter, or from an external URL, using the fileUrl parameter. You must specify at least one of them. If both parameters are specified, the API will take into consideration only the file parameter. If neither file or fileUrl are specified the request will return the error code "30 - Missing mandatory parameter".
Also, file uploads are bound to API limitations.
title
string
The title of the collection. This title will appear on the collection's direct link and in the My Collections page. By default, if a title is not given, Flipsnack will try to extract the title from the uploaded document.
description
string
The description of the collection. By default, during the conversion process, Flipsnack extracts the first few words from the document. You can overwrite that description with yours, using this parameter.
collectionWidth
number
The embed width of the player (measured in pixels). Default: 650.
collectionHeight
number
The embed height of the player (measured in pixels). Default: 385.
collectionStatus
string
The type of collection. Possible values are public, editable, unlisted and private.
Public collections are listed on your public profile and in search results.They are publicly available to other users.
Editable collections are not published. They must be published manually from the Flipsnack editor or have their status updated using the collection.update method.
Unlisted collections are published but not listed on your profile page and in search results. Other users may view them only if they receive a direct link or an embedded player from you.
Published with restricted access. Configure access with collection.setPermissions.
Default: public.
showControls
boolean
If set to true, then the navigation controls will be displayed in normal mode Default: false.
enableDownload
boolean
If set to true, displays the download button in the player menu. The menu is displayed only when the player is in fullscreen. Default: true.
enablePrint
boolean
If set to true, displays the print button in the player menu. The menu is displayed when the player is in fullscreen. Default: true.
enableFullScreen
boolean
If set to true, allows the player to enter fullscreen mode. Default: true.
enableSearch
boolean
If set to true, displays the search button in the player menu. The menu is displayed only when the player is in fullscreen. If there is no text to search within the current collection, the search button is displayed, but disabled. Default: true.
tooltipsLanguage
string
Selects the language for the tooltips displayed in the player. Possible languages are: Basque, Bosanski, Català, Czech, Dansk, Deutsch, English, Español, כשר, Française, ελληνικά, Hrvatski, Indonesian, Italiano, Magyar, Nederlands, Nederlands, Norsk, Polski, Português, Português do Brasil, Română, Pусский, Cрпски, Slovene, Suomi, Slovak, Swedish, Turkish. Default: English.
background
string
The background color of the player. Possible values are color, transparent and image. If set to transparent, the player is displayed with no background. Background color value can be set using the color parameter, explained below. When using the image option, upload the image with the backgroundImage option as multipart/form-data.
Default: color.
color
string
The background color of the player, specified as a hexadecimal value or CSS gradient. Accepted values are 444444, #ff0000 and linear-gradient(...)/radial-gradient(...) expressions.
If the background is set to transparent, the player will ignore the color parameter. Default: 444444.
autoFlip
boolean
If set to true, allows the player to automatically turn the pages of the flipbook. The pages turn after a time specified by the autoFlipDelay parameter. Default false.
autoFlipDelay
number
Specifies the time in seconds for pages to turn automatically. If autoFlip is false, this parameter is ignored. Default: 6.
rightToLeftOrientation
boolean
If set to true, allows the flipbook to be viewed from right to left:the first page is starts from the end, as viewed in normal mode. This option is useful for documents written in right to left languages. Default: false.
singlePageView
boolean
If set to true, allows the flipbook to be viewed a single page at a time. Default: false.
logoUrl
string
URL opened when the viewer clicks the logo. Upload the logo image using the logoImage parameter.
folder
string
The folder path where the collection will be added in your account.
A folder name must contain only english letters, digits and spaces. Also a folder name must start and end with a letter or a digit, not a space.
The folder name is case insensitive. "My Folder" will be the same with "my folder".
If the parameter is not specified or empty string is provided the collection will be displayed on main folder (root).
The path must not include first or last slash character (/).
Eg: folder1
You can specify a folder structure up to 3 levels.
If a deeper folder is specified, it will be ignored.
in a structure, folder names must be separated with a slash character (/).
Eg: folder1/folder2/folder3
If the folder already exists in your account the collection will be added in that folder, otherwise the folder structure will be created and, after that, the collection will be added in that folder.
logoImage
file
Logo image uploaded as multipart/form-data. Replaces a separate collection.setLogo call during create.
logoLink
string
Alias for logoUrl (click-through URL).
backgroundImage
file
Background image uploaded as multipart/form-data. Use with background=image.
backgroundScaleType
string
Background image scaling when using an image background. Values: scaleCrop, center, tile. Default when uploading: scaleCrop.
backgroundAudio
file
Background audio uploaded as multipart/form-data.
backgroundAudioEnabled
boolean
Enables/disables background audio. Default when uploading a new file: true.
backgroundAudioLoop
boolean
If true, audio loops. Default: false.
backgroundAudioAutoplay
boolean
If true, audio starts on open. Default: false.
playerSkin
string
Player skin: classic, default (case-insensitive).
playerAccentColor
string
Accent color, e.g. #ff0000.
pageTransition
string
Desktop transition: flip, slide, scroll (case-insensitive).
mobilePageTransition
string
Mobile transition: flip, slide, scroll (case-insensitive).
layoutStyle
string
Layout: smartView, singlePage, doublePage (case-insensitive). Takes precedence over singlePageView.
showPageShadows
boolean
If true, displays page shadows.
enableThumbView
boolean
Shows the thumbnail navigator.
navigationArrows
boolean
Shows previous/next arrows.
enableRemoteControl
boolean
Enables remote control.
enableToc
boolean
Enables table of contents (PDF TOC when available).
startWithTOCOpen
boolean
Opens the TOC panel on load. Requires enableToc=true and a PDF with TOC.
enableShareOptions
boolean
Enables share options in the player menu. Preferred over deprecated per-network params.
shareLink
boolean
Enables share by link.
Customization assets limits
Player customization uploads are validated before storage. Invalid files return an error and are not applied.
logoImage
JPEG, PNG, GIF, WebP, AVIF, SVG
2 MB raster, 10 MB SVG
Raster logos: max 1000 × 1000 px
backgroundImage
JPEG, PNG, GIF, WebP, AVIF
20 MB
—
backgroundAudio
MP3, MPEG
20 MB
—
MIME type is detected server-side. The file extension must match the detected content type.
Response parameters
If the upload is successful, the API call returns information about the flipbook which was just created.
Name
Type
Description
collectionHash
string
The hash for the newly created flipbook. If the flipbook status is editable the generated hash will be temporary. Once the flipbook is published, a new, final hash will be generated for it.
collectionTitle
string
The title of the flipbook.
collectionDescription
string
The description of the flipbook. It can be specified in the creation parameters or generated by the conversion system.
collectionStatus
string
Possible values are:
public: The flipbook is published and accessible to the public.
editable: The flipbook can be modified by the owner or authorized users.
unlisted: The flipbook is published but not publicly accessible without a direct link.
processing: The flipbook is published but not yet complete.
While in processing:
the collection.update and collection.downloadHTML5 endpoints are unavailable.
the public link for the flipbook may not yet be functional.
Publishing a flipbook may take a few seconds. You can check the collectionStatus at regular intervals (e.g., every few seconds) using the collection.getCollection method. Continue making requests to collection.getCollection until the collectionStatus has a value other than processing.
coverImage
string
The url of the flipbook's thumbnail image. This thumbnail is generated from the first page of the first flipbook item.
collectionPageCount
number
The number of pages in the flipbook, for all the flipbook items.
createdDate
date
The date when the flipbook was created (not necessarily published).
publishDate
date
The date when the flipbook was published.
directLink
string
The public link of the flipbook, which becomes active within a few seconds.
flipbookPageCount
number
The number of pages of the flipbook item. For flipbook created with the API, collectionPageCount and flipbookPageCount should have the same value.
settings
object
An object containing the configuration parameters of the flipbook, as set from the API call. See the list below.
collectionItems
array
The list of flipbook items belonging to the flipbook. In case of flipbooks created using the API, the list contains a single item. The parameters of the collection item are listed below.
Configuration parameters
Name
Type
Description
collectionWidth
number
The embed width of the player (measured in pixels).
collectionHeight
number
The embed height of the player (measured in pixels).
collectionStatus
string
The type of collection. Possible values are public, editable and unlisted. Public collections are listed on your public profile and in search results. They are publicly available to other users. Editable collections are not published. They must be published manually from the Flipsnack editor or updated using the collection.update method. Unlisted collections are published but not listed on your profile page and in search results. Other users may view them only if they receive a direct link or an embedded player from you.
enableDownload
boolean
If set to true, displays the download button in the player menu. The menu is displayed only when the player is in fullscreen.
enableFullScreen
boolean
If set to true, allows the player to enter fullscreen mode.
enableSearch
boolean
If set to true, displays the search button in the player menu. If there is no text to search within the current collection item, the search button is displayed as disabled.
tooltipsLanguage
string
Selects the language for the tooltips displayed in the player. Possible languages are: Basque, Bosanski, Català, Czech, Dansk, Deutsch, English, Español, כשר, Française, ελληνικά, Hrvatski, Indonesian, Italiano, Magyar, Nederlands, Nederlands, Norsk, Polski, Português, Português do Brasil, Română, Pусский, Cрпски, Slovene, Suomi, Slovak, Swedish, Turkish.
transparentBackground
boolean
If set to true, the player is displayed with no background.
backgroundColor
string
The background color of the player, specified as a hexadecimal value. If the transparentBackground is set to true, the player will ignore the backgroundColor parameter.
backgroundScaleType
string
The scale mode of images used as background for the player. Possible values are scaleCrop, center and tile. Background images can be set using the collection.setBackgroundImage method.
autoFlip
boolean
If set to true, allows the player to automatically turn the pages of the flipbook. The pages turn after a time specified by the autoFlipDelay parameter.
autoFlipDelay
number
Specifies the time in seconds for pages to turn automatically. If autoFlip is false, this parameter is ignored.
rightToLeftOrientation
boolean
If set to true, allows the flipbook to be viewed from right to left: the first page is starts from the end as viewed in normal mode. This option is useful for documents written in right to left languages.
singlePageView
boolean
If set to true, allows the flipbook to be viewed a single page at a time.
logoUrl (DEPRECATED)
string
The URL of the logo image. A logo image can be set only by uploading it with the collection.setLogo method.
shareFacebook (DEPRECATED)
boolean
If set to true, the player displays a Facebook sharing option in the player menu, in fullscreen mode.
shareTwitter (DEPRECATED)
boolean
If set to true, the player displays a Twitter sharing option in the player menu, in fullscreen mode.
shareGooglePlus (DEPRECATED)
boolean
If set to true, the player displays a Google+ sharing option in the player menu, in fullscreen mode.
sharePinterest (DEPRECATED)
boolean
If set to true, the player displays a Pinterest sharing option in the player menu, in fullscreen mode.
shareEmail (DEPRECATED)
boolean
If set to true, the player displays an email sharing option in the player menu, in fullscreen mode.
shareLinkText (DEPRECATED)
string
The link opened from the link sharing option, within the player. By default, this link is the direct link of the collection.
playerSkin
string
Player skin.
playerAccentColor
string
Accent color.
pageTransition
string
Desktop page transition.
mobilePageTransition
string
Mobile page transition.
layoutStyle
string
Page layout.
showPageShadows
boolean
Page shadows enabled.
enableThumbView
boolean
Thumbnail navigator.
navigationArrows
boolean
Navigation arrows.
enableRemoteControl
boolean
Remote control.
enableToc
boolean
Table of contents.
startWithTOCOpen
boolean
TOC open on load.
enableShareOptions
boolean
Share menu enabled.
shareLink
boolean
Share by link.
animatedInteractions
boolean
Animated interactions.
highlightsOnLinks
boolean
Link highlights.
textSelection
boolean
Text selection.
autodetectLinks
boolean
Auto-detected links.
googleAnalyticsID
string
GA measurement ID.
allowIPAnonymization
boolean
GA IP anonymization.
googleTagManagerID
string
GTM container ID.
color
string
Background color (hex or gradient).
Flipbook item parameters
Name
Type
Description
flipbookHash
string
The hash generated for the flipbook item.
flipbookPageCount
number
The number of pages of the flipbook item.
flipbookTitle
string
The title of the flipbook.
flipbookDescription
string
The description of the flipbook.
extension
string
The extension of the document that the flipbook is based on. Extensions can be pdf, jpg or png.
convertStatus
string
The status of the flipbook specifies if it has finished converting or if it is still in the process of conversion.
Possible values are:
PROCESSING
FAILED
COMPLETE
Converting a PDF document is a time consuming process. You can check the status of a flipbook at a few seconds intervals by using the collection.getCollection method. The requests to collection.getCollection should be made until the flipbook has completed or failed converting.
Error codes
For a complete list of error codes and messages go to API status codes section.
Examples
Request
Branded create (logo + background + audio)
Gradient background
Tracking settings
Response
Last updated