Skip to main content

Create Content

Add new content items to your catalog. Supports all content types: PDF, EPUB, audiobooks, physical products, and external links.


Endpoint

POST /api/v3/content

Request Body

Required Fields

FieldTypeDescription
namestringContent title (max 255 chars)
file_typestringContent type: pdf, epub, audio, physical
langstringISO 639-1 language code. See Supported Content Languages

Optional Fields

FieldTypeDescription
external_idstringYour unique ID (ISBN, SKU, etc., max 64 chars)
descriptionstringFull content description (HTML allowed)
published_atstringPublication date (YYYY-MM-DD only)
audiencestringTarget audience

File Upload (digital content only)

FieldTypeDescription
filestringStorage path to uploaded file (mutually exclusive with file_url)
file_urlstringExternal URL to download file from (mutually exclusive with file)
coverstringStorage path to uploaded cover image (mutually exclusive with cover_url)
cover_urlstringExternal URL for cover image (mutually exclusive with cover)
File Upload Options
  • file_url / cover_url: Provide a publicly accessible URL. The platform will download the file automatically.
  • file / cover: Provide a storage path from SFTP upload. Contact support to enable SFTP access for your account.
File Processing

Files are processed asynchronously. The content is created immediately with conversion_status: awaiting. Use Get Content to poll for processing completion.

Pricing

FieldTypeDescription
pricesarrayPrice array: [{currency_id, amount}]
Scheduled Pricing

Prices support starts_at and ends_at fields for scheduled pricing: [{currency_id, amount, starts_at, ends_at}]. Dates should be in YYYY-MM-DD format.

Access Settings

FieldTypeDescription
freebooleanEnable free access
free_untilstringFree access expiration (YYYY-MM-DD)
require_loginbooleanRequire login for free access
previewbooleanEnable content preview
preview_require_loginbooleanRequire login for preview

Metadata

FieldTypeDescription
authorarrayAuthor names (max 200 chars each)
publisherarrayPublisher names (max 200 chars each)
keywordsarrayKeywords/tags (max 200 chars each)
bisacarrayBISAC codes: [{code: "FIC000000"}] (max 4 codes)
categoryarrayCategory names (max 200 chars each)
collectionarrayCollection names (max 200 chars each)
countryarrayCountry names (max 200 chars each)
editionarrayEdition names (max 200 chars each)
narratorarrayNarrator names for audiobooks (max 200 chars each)
publishing_grouparrayPublishing group names (max 200 chars each)
custom_metadataobjectCustom taxonomy groups: {"group_slug": ["value1", "value2"]}
share_with_tenants_idsarrayTenant IDs (strings) to share this content with. See Content Sharing
format_group_idsarrayFormat group IDs (strings) to associate this content with

Geographic Restrictions

FieldTypeDescription
geographic_restrictionsobject{included: [...], excluded: [...]}

Physical Product Fields

FieldTypeDescription
binding_typestringBinding type (hardcover, paperback, etc.)
pagesintegerNumber of pages (min: 0)
heightfloatHeight in cm (min: 0)
widthfloatWidth in cm (min: 0)
weightfloatWeight in grams (min: 0)
stockbooleanIn stock status
editing_locationstringEditing/printing location
thicknessfloatThickness in cm (min: 0)

Request Examples

Basic PDF Content

curl -X POST "https://yourstore.publica.la/api/v3/content" \
-H "X-User-Token: your-api-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Introduction to Machine Learning",
"file_type": "pdf",
"lang": "en",
"external_id": "9781234567890",
"file_url": "https://example.com/files/ml-intro.pdf"
}'

EPUB with Full Metadata

curl -X POST "https://yourstore.publica.la/api/v3/content" \
-H "X-User-Token: your-api-token" \
-H "Content-Type: application/json" \
-d '{
"name": "The Complete Guide to Digital Publishing",
"file_type": "epub",
"lang": "en",
"external_id": "9780987654321",
"description": "<p>A comprehensive guide to digital publishing...</p>",
"published_at": "2025-01-15",
"file_url": "https://example.com/files/publishing-guide.epub",
"cover_url": "https://example.com/covers/publishing-guide.jpg",
"prices": [
{ "currency_id": "USD", "amount": 19.99 },
{ "currency_id": "EUR", "amount": 17.99 }
],
"author": ["Jane Smith", "John Doe"],
"publisher": ["Tech Publishing House"],
"keywords": ["publishing", "digital", "ebooks"],
"bisac": [
{ "code": "COM000000" }
]
}'

Free Content with Expiration

curl -X POST "https://yourstore.publica.la/api/v3/content" \
-H "X-User-Token: your-api-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Sample Chapter - Preview Edition",
"file_type": "pdf",
"lang": "en",
"external_id": "SAMPLE-001",
"file_url": "https://example.com/samples/chapter1.pdf",
"free": true,
"free_until": "2025-06-30",
"require_login": true
}'

Audiobook

curl -X POST "https://yourstore.publica.la/api/v3/content" \
-H "X-User-Token: your-api-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Mystery Novel - Narrated Edition",
"file_type": "audio",
"lang": "en",
"external_id": "AUDIO-001",
"description": "Award-winning mystery novel, professionally narrated",
"prices": [
{ "currency_id": "USD", "amount": 14.99 }
],
"author": ["Mystery Author"],
"publisher": ["Audiobook Productions"]
}'
Audiobook Tracks

After creating an audiobook, use the Audiobook Tracks API to add individual audio tracks.

Physical Product

curl -X POST "https://yourstore.publica.la/api/v3/content" \
-H "X-User-Token: your-api-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Collector Edition Hardcover",
"file_type": "physical",
"lang": "en",
"external_id": "PHYSICAL-001",
"cover_url": "https://example.com/covers/collector.jpg",
"prices": [
{ "currency_id": "USD", "amount": 49.99 }
],
"binding_type": "hardcover",
"pages": 450,
"height": 24.5,
"width": 16.0,
"weight": 650,
"stock": true
}'

Content with Geographic Restrictions

curl -X POST "https://yourstore.publica.la/api/v3/content" \
-H "X-User-Token: your-api-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Regional Edition",
"file_type": "epub",
"lang": "es",
"external_id": "REGIONAL-001",
"file_url": "https://example.com/files/regional.epub",
"prices": [
{ "currency_id": "USD", "amount": 9.99 }
],
"geographic_restrictions": {
"included": ["AR", "CL", "UY", "MX"],
"excluded": []
}
}'

Response

Success Response (201 Created)

{
"data": {
"id": "468170",
"external_id": "9781234567890",
"name": "Introduction to Machine Learning",
"slug": "introduction-to-machine-learning",
"lang": "en",
"file_type": "pdf",
"audience": null,
"cover_url": null,
"reader_url": "https://yourstore.publica.la/reader/introduction-to-machine-learning",
"product_url": "https://yourstore.publica.la/library/publication/introduction-to-machine-learning",
"created_at": "2025-12-23T10:30:00.000000Z",
"updated_at": "2025-12-23T10:30:00.000000Z",
"published_at": "2025-12-23T00:00:00.000000Z",
"license": "retail",
"free": {
"enabled": false,
"until": null,
"require_login": false
},
"preview": {
"enabled": false,
"require_login": false
},
"conversion_status": "awaiting",
"prices": [],
"description": null,
"publisher": [],
"author": [],
"bisac": [],
"keywords": [],
"country": [],
"edition": [],
"narrator": [],
"publishing_group": [],
"category": [],
"collection": [],
"metrics": {
"total_pages": 0,
"total_words": 0,
"total_seconds": 0
},
"custom_metadata": {},
"geographic_restrictions": null
}
}
Always Included

The create response always includes prices, description, metadata, and geographic_restrictions data regardless of the include parameter.


Conversion Status

Digital content undergoes asynchronous processing. Track the status via the conversion_status field returned in the content response.

StatusDescription
awaiting_*Content is queued or waiting for processing to begin
started_*Processing in progress (varies by file type)
doneProcessing complete, content available
deferredAwaiting first user access to trigger processing (bulk imports)
error_*Processing failed (varies by file type)
Intermediate statuses may change

Do not couple your logic to specific intermediate status values (awaiting_*, started_*, error_*) as they may change without notice. If you need to check whether content is ready, use done as the only stable status to rely on.

Polling for Completion

curl -X GET "https://yourstore.publica.la/api/v3/content/468170" \
-H "X-User-Token: your-api-token"

Error Handling

Validation Errors (422)

{
"message": "The given data was invalid.",
"errors": {
"name": ["The name field is required."],
"file_type": ["The selected file type is invalid."]
}
}

Duplicate External ID (422)

{
"message": "The given data was invalid.",
"errors": {
"external_id": ["The external id has already been taken."]
}
}

File Processing Error (422)

{
"message": "The given data was invalid.",
"errors": {
"file_url": ["Unable to download file from the provided URL."]
}
}

Authentication Error (401)

{
"message": "Unauthenticated."
}

Common Validation Rules

FieldRules
nameRequired, max 255 chars
file_typeRequired, one of: pdf, epub, audio, physical
langRequired, valid language code
external_idOptional, max 64 chars, unique per tenant
descriptionOptional, max 20,000 chars, HTML allowed
prices[].currency_idValid ISO 4217 currency code
prices[].amountNumber, min: 0 (zero allowed for free pricing)
file_urlValid URL, accessible for download
published_atValid date (YYYY-MM-DD only)
bisac[].codeValid BISAC code
geographic_restrictions.includedArray of ISO 3166-1 alpha-2 country codes
geographic_restrictions.excludedArray of ISO 3166-1 alpha-2 country codes

Best Practices

  1. Use external IDs - Always set a unique external_id for cross-system synchronization
  2. Poll for completion - Check conversion_status before assuming content is available
  3. Include complete metadata - Better discoverability with author, publisher, and BISAC codes
  4. Set prices upfront - Configure pricing at creation to avoid separate update calls

See Also


X

Graph View