Mar 16, 2024 07:59 AM
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,
Solved! Go to Solution.
Mar 16, 2024 09:11 AM - edited Mar 16, 2024 09:37 AM
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.
Mar 16, 2024 08:08 AM
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?
Mar 16, 2024 08:46 AM
The connected account is set as an owner.
Yes, the personal access token has the "schema-bases-write" scope set for the workspace.
Mar 16, 2024 09:11 AM - edited Mar 16, 2024 09:37 AM
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.
Mar 16, 2024 09:21 AM
Thank you, Scottworld, for resolving my issue! Indeed, there was an error with the Workspace ID. Your help is greatly appreciated!
Mar 16, 2024 09:43 AM
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