Authentication
Authentication with the Thinkeo API is done using bearer tokens. The process involves two steps to obtain a permanent token for your team.
Token Creation Process
1. Identify Your Team
List the Teams accessible with your account using Basic Auth and your Thinkeo credentials. From the response, you'll need to retrieve the ID of the Team for which you want to create your permanent bearer token.
Make a GET request to /teams:
curl -X GET https://api.thinkeo.io/v0/teams \
-u YOUR_USERNAME:YOUR_PASSWORD \
-H "Content-Type: application/json"
Example response:
[
{
"id": "018eebbd-c47a-7d2c-a315-9f8c2e41b6d3",
"name": "Team A",
"stripeCustomerId": null,
"aiConfig": null
},
{
"id": "019010b5-e189-7f5d-b423-a0d7f5623c9e",
"name": "Team B",
"stripeCustomerId": null,
"aiConfig": null
}
]
Note down the ID of your desired Team for the next step.
2. Create Permanent Token
Finally, create a permanent bearer token for your Team. Make sure to specify the teamId and set an expiration date that suits your needs.
Make a POST request to /tokens:
curl -X POST "https://api.thinkeo.io/v0/tokens?name=token_teamA&once=false&expiration=2024-09-07T00:00:00Z" \
-u YOUR_USERNAME:YOUR_PASSWORD \
-H "Content-Type: application/json"
Example response:
{
"id": "018eebbd-f94b-7a68-c531-b2e9d7f84a0f",
"teamId": "018eebbd-c47a-7d2c-a315-9f8c2e41b6d3",
"name": "token_teamA",
"expiration": "2024-09-07T00:00:00Z",
"createdAt": "2024-09-06T11:01:53.241234399Z",
"token": "tkak_qRXm9bNfLJTVUWoYzp15-3HKQSFD-nZxwEMCyAueghPiBcOlr_G7Jtv-TaLkdIjfw"
}
The "token" field in the response contains your permanent bearer token. You can use this token to authenticate all API requests for your Team's Apps until it expires.
Important: Store this token securely, as it provides access to all your Team's resources.