403 Forbidden using MigrationAPI

Describe your question/issue in detail

Hi all!
I have an issue with the usage of the migration api for my project dindi.
The error that I always receive is:

403

{
    "message": "Forbidden"
}

No matter what the input is.

Impacted feature

Creation of a document using Migration API.

What steps have you taken to resolve this issue already?

I followed the steps described both in the documentation and in the "Try migration API" popup that appears in my prismic dashboard and tried the procedure both from postman and from cli. I also downloaded the postman collection that i found here: Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.

In particular:

I did a POST request to

https://migration.prismic.io/documents

With these headers

--header 'repository: dindi' \ 
--header 'Authorization: Bearer {{token}}' \
--header 'x-api-key: {{apiKey}}'
  • the apiKey is the one stated in the popup (and documentation) as demo key (starting with cSaZlfk)
  • i tried both with a a user session token (get from the /login route) and a permanent token generated in the dashboard. They both seems ok because if I change them i get this error instead: User is not authorized to access this resource with an explicit deny which is not my error.

As for the payload, I tried with

  • dummy payload
  • empty payload
  • {} payload
  • payload identical to one of the articles retrieved here prismic.io - API Browser

Always the same error.

Errors

403

{
    "message": "Forbidden"
}

Could you please help me understand what I am doing wrong?
Thank you very much!

Hi @hello_dindi,

That 403 error could be several things. You're correct about the user session token not being the culprit here. Assuming you've triple checked your token is still valid in your repository and your environment variables are also all good, for the x-api-key, every line in the popup/documentation is an individual key. Have you tried a different one, such as the one starting with pZCex?

Let me know how that goes :slight_smile: