Skip to main content
Personal Access Tokens (PATs) provide a secure way to authenticate with the wit platform API from scripts, CI/CD pipelines, and other automated workflows.

Overview

PATs are an alternative to OAuth for:
  • CI/CD pipelines
  • Automated scripts
  • API integrations
  • Command-line tools
Each token has:
  • A unique identifier
  • Scoped permissions
  • Optional expiration date
  • Audit trail of usage

Quick Start

Creating Tokens

Basic Token

Output:

Token with Expiration

Token with Limited Scopes

Token Scopes

View Available Scopes

Managing Tokens

List Tokens

Revoke Token

Using Tokens

Environment Variable

In CI/CD

GitHub Actions

GitLab CI

Jenkins

In Scripts

API Usage

Security Best Practices

1. Use Minimal Scopes

Only request the permissions you need:

2. Set Expiration

For CI/CD tokens, set reasonable expiration:

3. Use Secrets Management

Never hardcode tokens:

4. Rotate Regularly

Create new tokens and revoke old ones periodically:

5. Audit Usage

Monitor token usage:
Check “Last Used” to identify inactive tokens.

Token Format

wit tokens follow this format:
  • wit_ - Identifies as a wit token
  • <prefix> - First 8 characters (visible in UI)
  • <random> - Cryptographically secure random string
Tokens are hashed before storage - the full token is only shown once at creation.

Comparison with Other Auth Methods

API Reference

Create Token

List Tokens

Revoke Token

Troubleshooting

Check that:
  1. Token is set correctly: echo $WIT_TOKEN
  2. Token hasn’t expired: wit token list
  3. Token has required scopes for the operation
Tokens cannot be retrieved after creation. You must:
  1. Revoke the old token: wit token revoke <id>
  2. Create a new one: wit token create <name>
The token may lack required scopes: