Platform CLI
Learn
Developer docs User guide Quickstart CLI and AI agents Blog
Company
Services About Contact Links Get started

Import content items from CSV

Updated

Use a CSV import to create many content items at once, or to update many at once from a spreadsheet. The import runs in the background, so you can leave the page while it works.

What you need

  • Permission to edit the content type. The Import from CSV menu entry is hidden without it.
  • A UTF-8 CSV file with a header row. Save as "CSV UTF-8" from Excel or Google Sheets.
  • The developer names of your fields and of the template each item should use.

Prepare the file

The first row names the columns using developer names, not labels. Columns Raytha does not recognize are ignored. The page's Expected columns card lists what applies to this content type; the main points are:

ColumnNeededValue
TemplateAlwaysThe developer name of a web template in the active theme, for example raytha_html_content_item_detail. A wrong name gives the error "Template was not found with this developer name".
IdTo updateThe id of an existing item, as shown in the Id column of an export. For new items leave it empty or leave the column out.
Each of your fieldsIf the field is required (when publishing)The value, using the rules below.

Built-in columns such as CreationTime, CreatorUser, IsPublished or RoutePath are skipped if present, so you can leave an export's built-in columns in the file.

A small file that creates two items:

Template,title,content,event_date
raytha_html_content_item_detail,Spring open house,<p>Join us in the garden.</p>,2026-04-18
raytha_html_content_item_detail,Summer picnic,<p>Bring a blanket.</p>,2026-07-04

Value formats by field type

  • Date: write YYYY-MM-DD. It is the format least likely to be misread.
  • Number: digits with a decimal point.
  • Checkbox: True or False. Other words, such as Yes, are rejected.
  • Multiple select: choice developer names separated by a semicolon, for example news;events.
  • Dropdown and Radio: the developer name of the choice.
  • Color: a hex value such as #1e293b.
  • Attachment: a web address (URL) of the file. Raytha downloads it into the media library. Addresses on private or internal networks are refused unless the server is set up to allow internal URL imports, and files over the size limit fail.
  • One to one relationship: the Id of the related item.

Run the import

  1. Click the content type in the sidebar.
  2. Open the View menu and choose Import from CSV. The page is titled Import followed by the plural label and from CSV.
  3. Choose a method:
    • Add new records only: every row becomes a new item. A row whose Id already exists is skipped.
    • Update existing records only: every row must carry an Id that exists.
    • Upsert all records: rows with a matching Id update that item; other rows create new items.
  4. Under CSV file, choose your file.
  5. Click Import and publish to make the items live, or Import as drafts to review them first.

Raytha starts a background task and shows its progress. You can leave the page; the task keeps running and stays listed under Background tasks in the sidebar.

Read the result

  • A clean run ends with the message "Finished importing."
  • If some rows had problems, the task finishes with a download link for an error file. Each line has a Row Number and an Error Message. Fix the rows in your spreadsheet and import them again.

Open the content type's list afterwards and spot-check a few items, including the first and last rows.

Warning Rows that report a value error (for example an invalid date) can still be imported, with that one value left empty. Always read the error file, and check the affected items. Use Import as drafts for any import you do not trust yet.

Gotchas

  • Required fields are only checked when you publish. With Import and publish, an empty required value is an error; with Import as drafts it is accepted.
  • Updates overwrite the published content immediately and create no revision. Export the items first so you can restore the old values; see Export content items to CSV.
  • An export does not import back unchanged. An export writes the template's label in the Template column, but import needs the template's developer name. Replace those cells first (for example Content item detail view becomes raytha_html_content_item_detail), and use Export all fields to CSV so the Id column is present.
  • Large files take time. A file with attachments is slower because every file is downloaded.
  • Developer names of fields cannot be guessed from labels. See the Fields page of the content type.

Next steps