Skip to main content
Solved

Issue with API Request - Error Message "INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND"

  • March 16, 2024
  • 5 replies
  • 782 views

Forum|alt.badge.img+3

Hello,

I'm reaching out for assistance with an issue I've encountered while trying to interact with the Airtable API. Despite following the documentation provided by Airtable and ensuring that I've granted the necessary permissions, I'm consistently receiving an error message.

Here's the API request I'm making:

curl -X POST "https://api.airtable.com/v0/meta/bases" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"name": "Apartment Hunting",
"tables": [
{
"description": "A to-do list of places to visit",
"fields": [
{
"description": "Name of the apartment",
"name": "Name",
"type": "singleLineText"
},
{
"name": "Address",
"type": "singleLineText"
},
{
"name": "Visited",
"options": {
"color": "greenBright",
"icon": "check"
},
"type": "checkbox"
}
],
"name": "Apartments"
}
],
"workspaceId": "wspmhESAta6clCCwF"
}'

However, I'm consistently receiving the following error message:

{
"error": {
"type": "INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND",
"message": "Invalid permissions, or the requested model was not found. Check that both your user and your token have the required permissions, and that the model names and/or ids are correct."
}
}

I've double-checked my user permissions and token, and everything seems to be in order. I've also ensured that the model names and IDs are correct. Despite this, I'm still encountering the error.

If anyone has encountered a similar issue or has any insights into what might be causing this error, I would greatly appreciate your assistance.

Thank you in advance for your help!

Best regards,

Best answer by ScottWorld

The code you pasted above (which is the example used in Airtable's API documentation) worked 100% perfectly for me on the very first try in Postman.

I just copied and pasted it into Postman and it worked (once I changed it to a valid Workspace ID and a valid Personal Access Token).

You didn't use the Workspace ID from the documentation, did you? That is just an example Workspace ID, not a real Workspace ID.

5 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • March 16, 2024

Is the connected account a creator in the workspace? Also, does your personal access token have the scope "schema-bases-write" set for the workspace?


Forum|alt.badge.img+3
  • Author
  • New Participant
  • March 16, 2024

The connected account is set as an owner.

Yes, the personal access token has the "schema-bases-write" scope set for the workspace.

 


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • Answer
  • March 16, 2024

The code you pasted above (which is the example used in Airtable's API documentation) worked 100% perfectly for me on the very first try in Postman.

I just copied and pasted it into Postman and it worked (once I changed it to a valid Workspace ID and a valid Personal Access Token).

You didn't use the Workspace ID from the documentation, did you? That is just an example Workspace ID, not a real Workspace ID.


Forum|alt.badge.img+3
  • Author
  • New Participant
  • March 16, 2024

Thank you, Scottworld, for resolving my issue! Indeed, there was an error with the Workspace ID. Your help is greatly appreciated!


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • March 16, 2024

You're welcome!

p.s. For anybody else reading this thread in the future who may need advanced Airtable API help, I am available for hire as an expert Airtable consultant through my website: Airtable Consulting — ScottWorld