TestAssets API (1.0.0)
Download OpenAPI specification:Download
API for managing assets and asset lists.
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
- Log in to your account at the web application
- Navigate to Settings → API Keys
- Click Generate New API Key
- Give your key a descriptive name (optional but recommended)
- Copy the key immediately — it will only be displayed once
- 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
/assetsand/asset-listsendpoints accept only API key authentication. JWT Bearer tokens and the anonymous key are not accepted on these endpoints.
- 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
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 |
- 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 minuteX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when the limit resets
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
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.
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:
query Parameters
| list_id | stringeq\.[a-f0-9\-]{36} Filter assets by list ID (format: |
| search | string Case-insensitive partial match filter applied to both |
| select | string Comma-separated list of fields to return (e.g., |
| order | string Default: "created_at.desc" Sort results by field with direction (e.g., |
| limit | integer [ 1 .. 1000 ] Default: 1000 Maximum number of results to return (capped at 1000) |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
[- {
- "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
}
]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:
Request Body schema: application/jsonrequired
| 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
- Payload
{- "name": "string",
- "comment": "string",
- "list_id": "430bbdbc-9d7f-4d06-a273-67ca4ba4ae4b",
- "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef"
}Response samples
- 201
- 400
- 401
- 403
- 429
{- "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:
query Parameters
| id required | stringeq\.[a-f0-9\-]{36} Asset ID filter (format: |
Responses
Response samples
- 200
- 401
- 404
- 429
[- {
- "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
}
]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:
query Parameters
| id required | stringeq\.[a-f0-9\-]{36} Asset ID filter (format: |
Request Body schema: application/jsonrequired
| name | string [ 1 .. 200 ] characters Updated asset name |
| comment | string or null <= 1000 characters Updated comment/notes |
Responses
Request samples
- Payload
{- "name": "string",
- "comment": "string"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 429
{- "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:
query Parameters
| id required | stringeq\.[a-f0-9\-]{36} Asset ID filter (format: |
Responses
Response samples
- 401
- 403
- 404
- 429
{- "message": "string",
- "code": "string",
- "hint": "string",
- "errors": [
- {
- "message": "string",
- "path": [
- "string"
]
}
]
}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:
query Parameters
| select | string Comma-separated list of fields to return (e.g., |
| order | string Default: "created_at.desc" Sort results by field with direction (e.g., |
| limit | integer [ 1 .. 1000 ] Default: 1000 Maximum number of results to return (capped at 1000) |
Responses
Response samples
- 200
- 400
- 401
- 429
[- {
- "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"
}
]Create Asset List
Create a new asset list. The authenticated user becomes the owner.
Authorizations:
Request Body schema: application/jsonrequired
| 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
- Payload
{- "title": "string",
- "description": "string"
}Response samples
- 201
- 400
- 401
- 429
{- "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:
query Parameters
| id required | stringeq\.[a-f0-9\-]{36} Asset list ID filter (format: |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
[- {
- "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"
}
]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:
query Parameters
| id required | stringeq\.[a-f0-9\-]{36} Asset list ID filter (format: |
Request Body schema: application/jsonrequired
| title | string [ 1 .. 200 ] characters Updated title |
| description | string or null <= 1000 characters Updated description |
Responses
Request samples
- Payload
{- "title": "string",
- "description": "string"
}Response samples
- 200
- 400
- 401
- 403
- 404
- 429
{- "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:
query Parameters
| id required | stringeq\.[a-f0-9\-]{36} Asset list ID filter (format: |
Responses
Response samples
- 401
- 403
- 404
- 429
{- "message": "string",
- "code": "string",
- "hint": "string",
- "errors": [
- {
- "message": "string",
- "path": [
- "string"
]
}
]
}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:
Request Body schema: application/jsonrequired
| name | string or null Optional descriptive name for the API key |
Responses
Request samples
- Payload
{- "name": "string"
}Response samples
- 200
- 401
- 429
- 500
{- "key": "string",
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "keyPrefix": "string",
- "createdAt": "2019-08-24T14:15:22Z"
}