Accessing APIs

NocoDB APIs can be authorized by either Auth Token or API Token.

Auth Token

Auth Token is a JWT Token generated based on the logged-in user. By default, the token is only valid for 10 hours. However, you can change the value by defining it using environment variable NC_JWT_EXPIRES_IN. If you are passing Auth Token, make sure that the header is called xc-auth.

  • Go to NocoDB Project, click the rightmost button and click Copy Auth Token.

Screenshot 2022-09-14 at 10 18 58 AM

API Token

NocoDB allows creating API tokens which allow it to be integrated seamlessly with 3rd party apps. API Token is a Nano ID with a length of 40. If you are passing API Token, make sure that the header is called xc-token.

  • Open Project Menu, click on Team & Settings
image
  • Click API Tokens Management tab under Team & Auth section
  • Click Add New Token

Screenshot 2022-09-14 at 10 20 00 AM

  • Type an recognizable name for your token and click Generate

Screenshot 2022-09-14 at 10 20 10 AM

  • Copy API token to your clipboard; use action menu to the right of token list

Swagger UI

You can interact with the API's resources via Swagger UI.

  • Go to NocoDB Project, click the rightmost button and click Swagger APIs Doc.

Screenshot 2022-09-14 at 10 22 00 AM

  • Click Authorize, paste the token you copied in above steps and click Authorize to save.

image