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

  1. Get current organization ID and high-level settings

  2. Get list of teams for given organization

  3. Get license info

  4. Get account utilization info

  5. Get account permissions info

  6. Get organization-level usage

Team-Level Info APIs

  1. Get users of a given team

  2. Get users that aren't assigned to a team

  3. Get current utilization info

  4. Get team name

  5. Team Level Usage API

Organization-Level APIs

Get current organization ID and high-level settings

Endpoint:

Parameters:

Parameter
Type
Required?
Description

-

-

-

-

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

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 data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

User-Level APIs

This returns all user-level information: organization ID, user ID, and token.

Endpoint:

Parameters:

Parameter
Type
Required
Description

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):


User Management API

The User Management API (released with 5.27.0) allows automation of user role management and team membership.

Role
Assign Team
Update Role
Activate/Deactivate
Invite

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:

circle-info

Note that all three of these values are marked optional, but at least one of the three is necessary for this request.

Successful Response (200):


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):

Field Descriptions

Common Fields

Field
Type
Required
Description

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

Field
Type
Required
Description

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

Field
Type
Required
Description

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:

Status
Description

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

circle-info

Perforce depots typically skip the cloning status and go directly to indexing.

Last updated

Was this helpful?