Tabnine APIs
The Usage API provides programmatic access to usage metrics across an organization
Usage Metrics API
The Usage API (released with 5.18.0) provides programmatic access to usage metrics across an organization. It complements existing enterprise reporting options—UI-based usage reports and CSV exports—by enabling integration into internal dashboards and tools via API.
The Usage API is available to all Enterprise customers on both Enterprise SaaS (console.tabnine.com) and Private Installations.
The APIs return JSON with parameter details and example responses.
Audit Logs API
The Audit Logs API (released with 5.25.0), allows for user access to audit logs that track key user management, team management, and user logging events.
The audit log includes the following information:
Performing user
Affected user
Time of change
Value change for each event
Tabnine allows for self-serve access via the Audit Logs API with a token. Users can download these logs either as a CSV file or a JSON HTTP response.
To set the number of parameters, use this URL:
/organization/audit_logs?limit=50&offset=0
To download as a CSV, use the URL:
/organization/audit-logs?csv-format
Only users with Admin access to Tabnine can access the Audit Logs API.
You can use the same mapping from the Usage API between user_id to email and team_id to team name.
API Categories
The Usage API can retrieve the following information:
Organization & Teams
Get organization and team IDs
List organization teams
List users from each team
Usage Metrics
Active users
Account utilization
Productivity factor
Automation factor
Usage volumes for:
Code Completions
Chat Interactions
List of Implemented APIs
APIs return JSON with parameter details and example responses:
Organization-Level Info APIs and Usage APIs
Get current organization ID and high-level settings
Get list of teams for given organization
Get license info
Get account utilization info
Get account permissions info
Get organization-level usage
Team-Level Info APIs
Get users of a given team
Get users that aren't assigned to a team
Get current utilization info
Get team name
Team Level Usage API
Organization-Level APIs
Get current organization ID and high-level settings
Endpoint:
Parameters:
-
-
-
-
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Get list of teams for a given organization
Endpoint:
Parameters:
Parameter
Type
Required
Description
limit
string (non-negative integer)
⨉ (optional)
Specifies the maximum number of items to return. (Example: limit=10 returns only 10 items)
offset
string
⨉
Skips a number of items before starting to return results.(Example: offset=20 skips the first 20 items and starts from item 21)
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Notes:
Get License Info
Endpoint:
Parameters:
-
-
-
-
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
exp— the expiration date of the license and is in UNIX timestamp formatiat— “issued at” is the timestamp where the license was created
Get Account Utilization Info
Endpoint:
Parameters:
Parameter
Type
Required?
Description
startDate
string
⨉
(default: last 12 months)
Start date for showing utilization: Will only show up to the last 12 months
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Notes:
Get Account Permissions Info
Endpoint:
Parameters:
Parameter
Type
Required?
Description
role
string
✓
Admin
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Get Organization-Level Usage
Endpoint:
Parameters:
Parameter
Type
Required?
Description
organizationId
string
✓
The unique identifier of the organization
from
string (ISO 8601)
✓
Filter usage data from this date
to
string (ISO 8601)
✓
Filter usage data until this date
granularity
string
✓
Determines the time resolution at which usage data is aggregated and returned. Options: all, daily, weekly, monthly
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Responses (JSON):
Granularity: All
Granularity: Monthly
Team-Level APIs
Get Users for a Given Team
This returns all registered and deactivated users from a team.
Endpoint:
Parameters:
Parameter
Type
Required?
Description
limit
string (non-negative integer)
✓
Specifies the maximum number of items to return. (Example: limit=10 returns only 10 items)
offset
string
✓
Skips a number of items before starting to return results.(Example: offset=20 skips the first 20 items and starts from item 21)
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Get Users Who Aren't Assigned to a Team
Endpoint:
Parameters:
Parameter
Type
Required?
Description
limit
string (non-negative integer)
✓
Specifies the maximum number of items to return. (Example: limit=10 returns only 10 items)
offset
string
✓
Skips a number of items before starting to return results.(Example: offset=20 skips the first 20 items and starts from item 21)
teamMember
boolean
✓
false for users who are not assigned to a team
active
boolean
✓
true, for users who are registered (false for deactivated user
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Get Current Team Utilization Info
Endpoint:
Parameters:
Parameter
Type
Required?
Description
teamId
string
✓
The unique identifier of the team
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Get Team Name
Endpoint:
Parameters: NONE
-
-
-
-
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Team Level Usage API
Endpoint:
Parameters:
Parameter
Type
Required?
Description
organizationId
string
✓
The unique identifier of the organization
teamId
string
✓
The unique identifier of the team
from
string (ISO 8601)
✓
Filter usage data from this date
to
string (ISO 8601)
✓
Filter usage data until this date
granularity
string
✓
Determines the time resolution at which usage data is aggregated and returned.
Options: all, daily, weekly, monthly
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token403 Forbidden– User does not have permission to access this team's data404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
Granularity: All
User-Level APIs
This returns all user-level information: organization ID, user ID, and token.
Endpoint:
Parameters:
user_id
string
✅
The unique identifier of the user
Response Codes:
200 OK– Successful response with user info.400 Bad Request– Invalid or missing parameters.401 Unauthorized– Invalid token.403 Forbidden– User lacks permission to access this user's info.404 Not Found– Organization or user not found.500 Internal Server Error– Unexpected server error.
Response (JSON):
This returns all user-level usage data: organizational ID, user ID, token, start date, and end date.
Endpoint:
Parameters:
organizationId
string
✓
The unique identifier of the organization
userId
string
✓
The unique identifier of the user
granularity
string
✓
determines the time resolution at which usage data is aggregated and returned.
Options: all, daily, weekly, monthly
from
string (ISO 8601)
✓
Filter usage data from this date
to
string (ISO 8601)
✓
Filter usage data until this date
Response Codes:
200 OK– Successful response with user usage data.400 Bad Request– Invalid or missing parameters.401 Unauthorized– Invalid token.403 Forbidden– User lacks permission to access this user's data.404 Not Found– Organization or user not found.500 Internal Server Error– Unexpected server error.
Response (JSON):
User Management API
The User Management API (released with 5.27.0) allows automation of user role management and team membership.
Admin
✓
✓ (all roles)
✓
✓ (all roles)
Manager
✓
✓ (Member, Team Lead, Manager)
✓
✓ (Member, Team Lead, Manager)
Team Lead
✗
✗
✗
✗
Member
✗
✗
✗
✗
To use this API, you will need user and team data, which you can retrieve via current currently implemented Organization & Team APIs.
Endpoints
Endpoint: PATCH /api/user/v1/:userId
Permissions: Admin can update any field and assign any role; Manager has same permissions except for assigning an Admin.
Request:
Successful Response (200):
Endpoint: POST /api/invitation/v1
Permissions: Admin can invite anyone to any role; Manager has same permissions except for inviting for an Admin role.
Request:
Successful Response (Existing User - 200):
Successful Response (New User - 201):
Repository API
The Repository Management API (released with 5.27.0) allows admins to automate repository connection management for teams.
All repo management endpoints follow this structure:
/api/team/v1/{teamId}/connections/repositories
As of 5.27.0, only Admins have permission for this endpoint.
Endpoints
Retrieves all repositories (Git and Perforce) configured for a specific team.
Endpoint: GET /api/team/v1/{teamId}/connections/repositories
Path Parameters:
teamId- UUID of the team
Request:
Successful Response (200):
Adds a new repository (Git or Perforce) to a team's indexing configuration.
Endpoint: POST /api/team/v1/{teamId}/connections/repositories
Path Parameters:
teamId- UUID of the team
Request for Git Repository:
Request for Perforce Depot:
Successful Response (200):
Updates an existing repository's authentication method, credentials, or 'view source' link pattern.
Endpoint: PUT /api/team/v1/{teamId}/connections/repositories/{repositoryLink}
Path Parameters:
teamId- UUID of the teamrepositoryLink- URL-encoded repository link
Request for Git Repository:
Request for Perforce Depot:
Successful Response (204):
(No content)
Removes a repository or depot from a team's indexing configuration.
Endpoint: DELETE /api/team/v1/{teamId}/connections/repositories/{repositoryLink}
Path Parameters:
teamId- UUID of the teamrepositoryLink- URL-encoded repository link
Examples:
Successful Response (204):
(No content)
Field Descriptions
Common Fields
repo_type
string
Yes
Repository type: "git" or "perforce"
repository_link
string
Yes
Git: Repository URL (SSH or HTTPS format)<br>Perforce: Depot path (e.g., //depot/main)
latest_status
string
Read-only
Current indexing status (see Status Values below)
last_indexed_successfully
string or null
Read-only
ISO 8601 timestamp of last successful indexing, or null if never indexed
Git-Specific Fields
authentication_method
string
Yes
"ssh" or "https"
authentication_credentials_name
string
Conditional
Required when authentication_method is "https"<br>Must match an existing HTTP credential name for the team
view_source_link_pattern
string
No
URL pattern for viewing source code<br>Supports placeholders: {sha}, {path}, {line}
Perforce-Specific Fields
authentication_credentials_name
string
Yes
Must match an existing Perforce credential name for the team
view_source_link_pattern
string
No
Currently not used for Perforce
Status Values
The latest_status field can have the following values:
pending
Repository is queued for initial indexing
cloning
Repository is being cloned (Git only)
indexing
Repository is currently being indexed
success
Repository was successfully indexed
failed
Last indexing attempt failed
Last updated
Was this helpful?
