Hi digital.agro,
Here’s how you can handle each of them using the TagoIO API:
1. How to edit the environment variables of an analysis?
Yes, you can update the environment variables using the following API route:
curl --location --request PUT 'https://api.tago.io/analysis/1234567890abcdef' \--header 'Authorization: YOUR_PROFILE_TOKEN' \--header 'Content-Type: application/json' \--data '{ "variables": [ { "key": "example_key_1", "value": "value_1" }, { "key": "example_key_2", "value": "value_2" } ]}'
2. How to check the expiration date of your profile token?
You can list your tokens and check the expire_time field like this:
curl --location 'https://api.tago.io/profile/YOUR_PROFILE_ID/token' \--header 'Authorization: YOUR_PROFILE_TOKEN
3. How to create a profile token with expiration and permission via API?
You can create a new profile token with an expiration, permission level, and authentication type using:
curl --location 'https://api.tago.io/profile/YOUR_PROFILE_ID/token' \--header 'Content-Type: application/json' \--header 'Authorization: YOUR_PROFILE_TOKEN' \--data-raw '{ "email": "example.user@email.com", "expire_time": "1d", "name": "My New Token", "password": "YourPasswordHere", "permission": "write", // write | read | full "otp_type": "authenticator", // sms | email | authenticator "pin_code": "123456", "profile_id": "YOUR_PROFILE_ID"}'
You can find more about the request body fields in the SDK documentation:
Profile.tokenCreate | TagoIO SDK
4. How to access and delete a created token?
To access tokens, use the same route from step 2.
To delete a specific token, use this endpoint:
curl --location --request DELETE 'https://api.tago.io/profile/YOUR_PROFILE_ID/token/YOUR_TOKEN' \--header 'Authorization: YOUR_PROFILE_TOKEN
Additional Reference: Managing Profile Tokens – TagoIO Documentation
Bonus Tip: You can also inspect API requests directly from your browser’s developer tools while using the TagoIO Admin portal. This helps uncover hidden routes and request structures quickly.