Since API keys are user-specific and users may belong to multiple teams, providing the team_id ensures operations are executed within the appropriate team context.
In scenarios where API operations are performed at the team level, the 'team_id' parameter is required in the query params otherwise the API call with fail with 400 Bad request error.
Example URL: https://api.smartreach.io/api/v3/prospects?team_id=team_********
The team_id starts with the prefix ‘team’ and can be obtained from Settings -> Team Settings -> Integrations, under the API Key section.
Reference video:Team Identification
Error Scenarios related to 'team_id':
When 'team_id' is not passed in the query param where it is required:
status: 400 Bad request error
Example:
curl --request GET \
--url https://api.smartreach.io/api/v3/prospects \
--header 'X-API-KEY: uk__xxxxxx' \
--header 'accept: application/json'
Response:
{
"errors" : [
{
"error_type": "bad_request",
"message": "Please pass a 'team_id' query param with this API. You can refer our API docs to know more about how to get 'team_id'. Link: https://help.smartreach.io/reference/using-the-smartreach-api"
}
]
}
When invalid team_id is passed
Status: 403 Forbidden Error
Example:
curl --request GET \
--url https://api.smartreach.io/api/v3/prospects?team_id=team_xxxxxx \
--header 'X-API-KEY: uk__xxxxxx' \
--header 'accept: application/json'
Response:
{
"error_type": "forbidden",
"message": "Please pass a valid team_id."
}