Skip to main content

Overview

CVAT API supports multiple authentication methods:
  • Token Authentication - API tokens for programmatic access
  • Access Token Authentication - Personal access tokens with expiration
  • Session Authentication - Browser session cookies
  • Basic Authentication - Username and password (not recommended for production)

Token Authentication

Token authentication is the recommended method for API access.

Using Tokens

Include your token in the Authorization header:

Access Tokens

Access tokens provide more control with features like expiration dates and read-only access.

Create an Access Token

Request Body

string
required
Token name for identification
string
Token expiration date in ISO 8601 format
boolean
default:false
Whether the token is read-only

Response

integer
Token ID
string
Token name
string
The access token (only returned on creation)
string
Token creation timestamp
string
Token expiration timestamp
boolean
Whether the token is read-only
string
Last usage timestamp

List Access Tokens

Query Parameters

string
Filter by token name
integer
Page number for pagination
integer
Number of results per page
string
Sort field (name, id, created_date, updated_date, expiry_date)

Get Token Details

Get Current Token Details

Get details about the token used for the current request:

Update a Token

Revoke a Token

Login

Obtain an authentication token by logging in with credentials:

Request Body

string
required
Username or email address
string
required
User password

Response

string
Authentication token

Logout

Invalidate the current authentication token:

Register

Create a new user account:

Password Management

Change Password

Change the password for the authenticated user:

Reset Password

Request a password reset email:

Confirm Password Reset

Reset password using the token from the reset email:

Session Authentication

When using the CVAT web interface, sessions are managed automatically through cookies. This method includes CSRF protection:
  • sessionid cookie for authentication
  • csrftoken cookie for CSRF protection
  • X-CSRFToken header with CSRF token value

Basic Authentication

Basic authentication uses base64-encoded credentials:
Basic authentication is less secure and should only be used for testing or in secure environments.

Security Best Practices

  1. Use Access Tokens - Create dedicated tokens for different applications
  2. Set Expiration Dates - Tokens should expire periodically
  3. Use Read-Only Tokens - When write access isn’t needed
  4. Revoke Unused Tokens - Remove tokens that are no longer needed
  5. Keep Tokens Secret - Never commit tokens to version control
  6. Use HTTPS - Always make API requests over HTTPS

Example: Complete Authentication Flow