API Documentation

    Complete reference for the Assets Management API

    MCP Server
    Try it:

    TestAssets API (1.0.0)

    Download OpenAPI specification:Download

    API Support: support@testassets.io

    API for managing assets and asset lists.

    Authentication

    This API uses API key authentication for all data operations (/assets and /asset-lists). The /generate-api-key endpoint uses JWT Bearer token authentication (used by the web application to create API keys).

    API Key Authentication

    API keys provide secure, long-lived access to the API without requiring user credentials. This is the primary authentication method for integrations, scripts, and third-party applications.

    Obtaining an API Key

    1. Log in to your account at the web application
    2. Navigate to Settings → API Keys
    3. Click Generate New API Key
    4. Give your key a descriptive name (optional but recommended)
    5. Copy the key immediately — it will only be displayed once
    6. Store the key securely (e.g., in environment variables or a secrets manager)

    Using API Keys

    Include your API key in the apikey header with every request:

    curl -X GET 'https://api.testassets.io/v1/assets' \
      -H 'apikey: sk_live_1234567890abcdef...' \
      -H 'Content-Type: application/json'
    

    JavaScript Example:

    const response = await fetch('https://api.testassets.io/v1/assets', {
      headers: {
        'apikey': 'sk_live_1234567890abcdef...',
        'Content-Type': 'application/json'
      }
    });
    const assets = await response.json();
    

    Python Example:

    import requests
    
    headers = {
        'apikey': 'sk_live_1234567890abcdef...',
        'Content-Type': 'application/json'
    }
    response = requests.get(
        'https://api.testassets.io/v1/assets',
        headers=headers
    )
    assets = response.json()
    

    Note: The /assets and /asset-lists endpoints accept only API key authentication. JWT Bearer tokens and the anonymous key are not accepted on these endpoints.

    Security Best Practices

    • Never commit API keys to version control (Git, SVN, etc.)
    • Use environment variables to store keys in your applications
    • Rotate keys regularly as part of your security hygiene
    • Revoke compromised keys immediately from the Settings page
    • Use different keys per environment (development, staging, production)
    • Always use HTTPS — never send credentials over HTTP

    Error Responses

    The API returns standardized JSON error responses:

    {
      "message": "Error description",
      "code": "ERROR_CODE"
    }
    

    Common error codes:

    Status Code Description
    400 VALIDATION_ERROR Invalid request body
    400 INVALID_SELECT Invalid fields in select parameter
    400 INVALID_ORDER Invalid order parameter
    400 INVALID_LIMIT Invalid limit parameter
    401 INVALID_API_KEY Missing, invalid, or revoked API key
    403 ACCESS_DENIED Valid auth but insufficient permissions
    404 NOT_FOUND Resource does not exist
    429 RATE_LIMIT Rate limit exceeded

    Rate Limiting

    • Default limit: 100 requests per minute per API key
    • Exceeded limits return 429 Too Many Requests
    • Rate limit headers included in all responses:
      • X-RateLimit-Limit: Maximum requests allowed per minute
      • X-RateLimit-Remaining: Requests remaining in current window
      • X-RateLimit-Reset: Unix timestamp when the limit resets

    Query Parameters

    The GET endpoints support the following query parameters:

    select

    Specify which fields to return. Default: all fields.

    Assets: id, name, comment, created_at, updated_at, list_id, parent_id, user_id

    Asset Lists: id, title, description, created_at, updated_at, user_id

    Example: ?select=id,name,created_at

    search (Assets only)

    Filter assets by name or notes/comment using a case-insensitive partial match.

    Example: ?search=login returns all assets whose name or notes contain "login".

    order

    Sort results by a field with direction.

    Assets: name, created_at, updated_at

    Asset Lists: title, created_at, updated_at

    Example: ?order=created_at.desc

    limit

    Limit the number of results (max 1000). Example: ?limit=50

    Managing API Keys

    Viewing Your Keys

    Navigate to Settings → API Keys to see all active keys with their name, prefix, creation date, and last used date.

    Revoking Keys

    Click Revoke next to any key. Revoked keys are immediately invalidated and applications using them will receive 401 errors.

    The full API key value is never stored or displayed again after initial creation for security reasons.

    Assets

    CRUD operations for individual assets. Requires API key authentication.

    List Assets

    Retrieve all assets accessible to the authenticated user (owned and shared lists). Supports filtering by list, field selection, sorting, pagination, and search.

    Use the search parameter to filter assets by name or notes (case-insensitive partial match).

    If list_id is provided:

    • Returns 404 if the list does not exist
    • Returns 403 if the list exists but the user has no access

    Results include a Content-Range header with total count.

    Authorizations:
    ApiKeyAuth
    query Parameters
    list_id
    stringeq\.[a-f0-9\-]{36}

    Filter assets by list ID (format: eq.{uuid}). Returns 404 if the list does not exist, 403 if user has no access.

    search
    string

    Case-insensitive partial match filter applied to both name and comment (notes) fields. Example: ?search=login returns assets whose name or notes contain "login".

    select
    string

    Comma-separated list of fields to return (e.g., id,name,created_at). Use * for all fields.

    order
    string
    Default: "created_at.desc"

    Sort results by field with direction (e.g., created_at.desc, name.asc)

    limit
    integer [ 1 .. 1000 ]
    Default: 1000

    Maximum number of results to return (capped at 1000)

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Create Asset

    Create a new asset in a specified list. The user must have edit access (owner, admin, or editor) to the target list.

    Authorizations:
    ApiKeyAuth
    Request Body schema: application/json
    required
    name
    required
    string [ 1 .. 200 ] characters

    Asset name (required, max 200 characters)

    comment
    string or null <= 1000 characters

    Asset comment/notes (optional, max 1000 characters)

    list_id
    required
    string <uuid>

    Target asset list ID (required)

    parent_id
    string or null <uuid>

    Parent asset ID for hierarchical organization (optional)

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "string",
    • "comment": "string",
    • "list_id": "430bbdbc-9d7f-4d06-a273-67ca4ba4ae4b",
    • "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef"
    }

    Response samples

    Content type
    application/json
    {
    • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    • "name": "string",
    • "comment": "string",
    • "list_id": "430bbdbc-9d7f-4d06-a273-67ca4ba4ae4b",
    • "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef",
    • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z",
    • "is_qr_code": false,
    • "is_dmc_code": false
    }

    Get Asset

    Retrieve a specific asset by ID. The user must have access (owner, admin, editor, or viewer) to the asset's list.

    Authorizations:
    ApiKeyAuth
    query Parameters
    id
    required
    stringeq\.[a-f0-9\-]{36}

    Asset ID filter (format: eq.{uuid})

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Asset

    Update an existing asset. Only name and comment can be updated. The user must have edit access (owner, admin, or editor) to the asset's list. Unknown fields are rejected.

    Authorizations:
    ApiKeyAuth
    query Parameters
    id
    required
    stringeq\.[a-f0-9\-]{36}

    Asset ID filter (format: eq.{uuid})

    Request Body schema: application/json
    required
    name
    string [ 1 .. 200 ] characters

    Updated asset name

    comment
    string or null <= 1000 characters

    Updated comment/notes

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "string",
    • "comment": "string"
    }

    Response samples

    Content type
    application/json
    {
    • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    • "name": "string",
    • "comment": "string",
    • "list_id": "430bbdbc-9d7f-4d06-a273-67ca4ba4ae4b",
    • "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef",
    • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z",
    • "is_qr_code": false,
    • "is_dmc_code": false
    }

    Delete Asset

    Delete an asset. The user must have delete access (owner, admin, or editor) to the asset's list.

    Authorizations:
    ApiKeyAuth
    query Parameters
    id
    required
    stringeq\.[a-f0-9\-]{36}

    Asset ID filter (format: eq.{uuid})

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string",
    • "code": "string",
    • "hint": "string",
    • "errors": [
      ]
    }

    Asset Lists

    CRUD operations for asset list collections. Requires API key authentication.

    List Asset Lists

    Retrieve all asset lists accessible to the authenticated user, including owned and shared lists. Supports field selection, sorting, and pagination.

    Results include a Content-Range header with total count.

    Authorizations:
    ApiKeyAuth
    query Parameters
    select
    string

    Comma-separated list of fields to return (e.g., id,name,created_at). Use * for all fields.

    order
    string
    Default: "created_at.desc"

    Sort results by field with direction (e.g., created_at.desc, name.asc)

    limit
    integer [ 1 .. 1000 ]
    Default: 1000

    Maximum number of results to return (capped at 1000)

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Create Asset List

    Create a new asset list. The authenticated user becomes the owner.

    Authorizations:
    ApiKeyAuth
    Request Body schema: application/json
    required
    title
    required
    string [ 1 .. 200 ] characters

    Asset list title (required, max 200 characters)

    description
    string or null <= 1000 characters

    Asset list description (optional, max 1000 characters)

    Responses

    Request samples

    Content type
    application/json
    {
    • "title": "string",
    • "description": "string"
    }

    Response samples

    Content type
    application/json
    {
    • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    • "title": "string",
    • "description": "string",
    • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    }

    Get Asset List

    Retrieve a specific asset list by ID. Returns 404 if the list does not exist, 403 if the user has no access.

    Authorizations:
    ApiKeyAuth
    query Parameters
    id
    required
    stringeq\.[a-f0-9\-]{36}

    Asset list ID filter (format: eq.{uuid})

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Asset List

    Update an existing asset list. Only owners and admins can update lists. Only title and description can be updated; unknown fields are rejected.

    Authorizations:
    ApiKeyAuth
    query Parameters
    id
    required
    stringeq\.[a-f0-9\-]{36}

    Asset list ID filter (format: eq.{uuid})

    Request Body schema: application/json
    required
    title
    string [ 1 .. 200 ] characters

    Updated title

    description
    string or null <= 1000 characters

    Updated description

    Responses

    Request samples

    Content type
    application/json
    {
    • "title": "string",
    • "description": "string"
    }

    Response samples

    Content type
    application/json
    {
    • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    • "title": "string",
    • "description": "string",
    • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    • "created_at": "2019-08-24T14:15:22Z",
    • "updated_at": "2019-08-24T14:15:22Z"
    }

    Delete Asset List

    Delete an asset list and all its assets. Only the owner can delete a list — admins and editors cannot.

    Authorizations:
    ApiKeyAuth
    query Parameters
    id
    required
    stringeq\.[a-f0-9\-]{36}

    Asset list ID filter (format: eq.{uuid})

    Responses

    Response samples

    Content type
    application/json
    {
    • "message": "string",
    • "code": "string",
    • "hint": "string",
    • "errors": [
      ]
    }

    Authentication

    API key management. The generate endpoint requires JWT Bearer token authentication.

    Generate API Key

    Generate a new API key for programmatic access. Requires JWT Bearer token authentication (not API key). Returns the full API key only once — store it securely.

    Rate limit: 100 key generations per minute per user.

    Authorizations:
    BearerAuth
    Request Body schema: application/json
    required
    name
    string or null

    Optional descriptive name for the API key

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "string"
    }

    Response samples

    Content type
    application/json
    {
    • "key": "string",
    • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    • "keyPrefix": "string",
    • "createdAt": "2019-08-24T14:15:22Z"
    }

    We use essential cookies for core functionality and optional cookies to improve your experience. Learn more about our privacy policy