# 403 Forbidden using MigrationAPI

**URL:** <https://community.prismic.io/t/403-forbidden-using-migrationapi/17842>\
**Category:** Developing with Prismic\
**Created:** [October 18, 2024, 1:24pm UTC](https://community.prismic.io/t/403-forbidden-using-migrationapi/17842 "2024-10-18T13:24:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hello\_dindi](https://avatars.discourse-cdn.com/v4/letter/h/22d042/32.png) [@hello\_dindi](https://community.prismic.io/u/hello_dindi)\
**Post date:** [October 18, 2024, 1:24pm UTC](https://community.prismic.io/t/403-forbidden-using-migrationapi/17842/1 "2024-10-18T13:24:24Z")

</div>

## 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

```auto
{
    "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](https://prismic.notion.site/Setup-for-Migration-API-Beta-4f5700f385384365a806c71635afc002)

In particular:

I did a POST request to

```auto
https://migration.prismic.io/documents

```

With these headers

```auto
--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](https://dindi.prismic.io/api/v2)

Always the same error.

### Errors

403

```auto
{
    "message": "Forbidden"
}

```

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

---

<div class="post-metadata">

**Author:** ![Ezekiel](https://avatars.discourse-cdn.com/v4/letter/e/848f3c/32.png) [@Ezekiel](https://community.prismic.io/u/Ezekiel)\
**Post date:** [October 23, 2024, 3:28pm UTC](https://community.prismic.io/t/403-forbidden-using-migrationapi/17842/3 "2024-10-23T15:28:06Z")

</div>

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 🙂
