API Documentation

Learn how to authenticate and use the Unli.ai API

Getting Started with the Unli.ai API

Welcome to the Unli.ai API documentation. This guide will help you get started with authenticating and making requests to our API.

Authentication

To use the Unli.ai API, you must authenticate using an API token. All API requests require authentication via the Authorization header.

Creating an API Token

Follow these steps to create your API token:

  1. Navigate to https://unli.ai/user/api-tokens
  2. Click on "Create New Token" or "Add Token"
  3. Enter a descriptive name for your token (e.g., "Production API", "Development", etc.)
  4. Select the appropriate permissions for your use case:
    API Token Permissions
  5. Click "Create Token" to generate your API token
Important: Store Your Token Securely
Make sure to copy and store your API token in a secure location immediately after creation. For security reasons, you won't be able to see the token again after leaving the page.

Using Your API Token

Once you have your API token, include it in the Authorization header of every API request using the Bearer authentication scheme:

Authorization: Bearer <your_token>
Replace <your_token> with your actual API token

Example Request

Here's an example of how to make an authenticated API request:

curl -X GET https://api.unli.ai/v1/endpoint \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Content-Type: application/json"

Best Practices

  • Never commit tokens to version control - Use environment variables or secure secret management systems
  • Use different tokens for different environments - Create separate tokens for development, staging, and production
  • Rotate tokens regularly - Periodically create new tokens and revoke old ones
  • Use minimal permissions - Only grant the permissions necessary for your specific use case
  • Monitor token usage - Regularly review your API token activity for any suspicious behavior

Security Considerations

Keep Your Tokens Safe
  • Store tokens in environment variables or secure vaults
  • Never expose tokens in client-side code
  • Revoke tokens immediately if compromised
  • Use HTTPS for all API requests

Next Steps

Now that you know how to authenticate, explore the API endpoints in the sidebar to start integrating with Unli.ai.