How to make a post with prismic

hello, I want to use PRISMIC to save LEADS from a website. but I'm having trouble doing the POST. Can anyone who has done this help?

import React, { useState } from 'react'
import axios from 'axios'

const PrismicPostExample = () => {
  const [title, setTitle] = useState('')
  const [content, setContent] = useState('')

  const handlePostSubmit = async e => {

    const apiUrl = ''
    const accessToken =
    const endpoint = 'contato'

    const postData = {
      type: 'contato',
      lang: 'pt-br',
      fields: {
        title: [{ type: 'heading1', text: title }],
        content: [{ type: 'paragraph', text: content }]

    try {
      const response = await`${apiUrl}/${endpoint}`, postData, {
        headers: {
          'Content-Type': 'application/json',
          Authorization: `Bearer ${accessToken}`

      console.log('Documento criado:',
    } catch (error) {
      console.error('Erro ao criar o documento:', error)

  return (
      <h2>Criar novo documento</h2>
      <form onSubmit={handlePostSubmit}>
            onChange={e => setTitle(}
        <br />

        <br />
        <button type="submit">Enviar</button>

export default PrismicPostExample

in this test component, I am having CORS error

the component in question has a very simple structure, because I want to make the post work to later scale in other components.

Hi Fabricio,

Thanks for reaching out. Prismic does not currently support a write API, but it's something that we are investigating and we will update the following thread when there are any changes.