Create Tables and Fields via API on Baserow Hosted?

I’m on the Baserow hosted plan. I am able to do all the regular API operations, but now we wanted to actually use the API to update certain table fields, so we can easily duplicate tables and values, without having to manually re-enter all the settings. So I took a look at this API: Baserow API spec - I followed the directions to simply get the values for Baserow API spec but I can’t get the authorization to work. I am usin the database token from the admin dashboard on the hosted baserow, and I’m assuming this is not the correct token to use. I think you need some sort of user JWT. How do you create this? Where is this? thanks.

Hello @ddsgad,

we have some (slightly outdated) documentation here: Backend API.

Actually, the only difference (which I’ll fix) is that the documentation currently states:

If you inspect the JSON response, you will notice a key named ‘token’.

and later:

The token will be valid for 60 minutes.

However, Baserow now returns two tokens: access_token (valid for 10 minutes) and refresh_token (valid for 7 days).

The access_token is the token to use for all API calls to Baserow. The refresh_token is only used to refresh the access_token when it expires, by providing it as the payload to the token_refresh endpoint.

For simplicity, many users just log in again to get a new access_token and refresh_token each time. However, I wouldn’t recommend this practice, as it creates many sessions that are used for only a few calls. While this works for now, we might restrict this behavior in the future.