Libraries
const url = 'https://api.tradecrafthub.ai/v1/libraries';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.tradecrafthub.ai/v1/libraries \ --header 'Authorization: Bearer <token>'Active libraries, default first.
Scope knowledge:read (Read approved answers; lowest role user). Effective access is the token’s scopes ∩ the caller’s current role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Your correlation id (8–128 of A–Z a–z 0–9 . _ : -); echoed back
Responses
Section titled “Responses”All
object
object
Example generated
{ "data": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "slug": "example", "type": "example", "typeLabel": "example", "description": "example", "isDefault": true, "archived": true, "assetKinds": [ "example" ], "documentCount": 1, "answerCount": 1, "createdAt": "2026-04-15T12:00:00Z" } ], "meta": { "nextCursor": "example" }}Headers
Section titled “Headers”Echoes a valid X-Request-Id, else generated
Requests allowed in the tightest window
Requests left
Seconds until the window resets
UNAUTHENTICATED— No valid session, API key or bearer token.
Missing, unknown, expired or revoked token, or a token for another resource (WWW-Authenticate: Bearer … names the resource metadata).
object
object
The error-code catalogue: VALIDATION_ERROR 400, UNAUTHENTICATED 401, SPEND_CAP_EXCEEDED 402, TENANT_AI_BUDGET_EXCEEDED 402, FORBIDDEN 403, NOT_FOUND 404, CONFLICT 409, GONE 410, ENDPOINT_REMOVED 410, PAYLOAD_TOO_LARGE 413, UNSUPPORTED_MEDIA_TYPE 415, RATE_LIMITED 429, INTERNAL 500, PROVIDER_ERROR 502, SERVICE_UNAVAILABLE 503, WEAK_PASSWORD 400, INVALID_TOKEN 400, EXPIRED_TOKEN 400, INVALID_CREDENTIALS 401, INVALID_CODE 401, SSO_REQUIRED 403, SLUG_TAKEN 409, LAST_ADMIN 409, MANAGED_BY_IDP 409, LOCKED 429, ASSET_KIND_NOT_ALLOWED 400, ASSET_SOURCE_NOT_ALLOWED 400, LIBRARY_ARCHIVED 409, MISSING_SCOPES 400, CLASSIC_TOKEN 400, INVALID_CREDENTIAL 400, CLOUD_ID_UNRESOLVED 400, SITE_NOT_FOUND 400, INTEGRATION_AUTH 409, INTEGRATION_NOT_CONNECTED 409, SITE_CHOICE_EXPIRED 409, PLATFORM_NOT_CONFIGURED 503, PLAN_LIMIT_REACHED 403, PLAN_FEATURE_UNAVAILABLE 403, TRIAL_EXPIRED 403, INSUFFICIENT_SCOPE 403, API_DISABLED 403, IDEMPOTENCY_CONFLICT 409. Extensible.
Human-readable message
INSUFFICIENT_SCOPE: the scope the operation needs
FORBIDDEN: why (member_inactive, permission_missing, not_opted_in, user_only, role, …)
object
Examples
No valid session, API key or bearer token.
{ "error": { "code": "UNAUTHENTICATED", "message": "The access token is invalid, expired or revoked" }}FORBIDDEN— Authenticated, but the role, object grant or policy does not allow this.INSUFFICIENT_SCOPE— The access token lacks the scope this operation needs (error.scope names it; WWW-Authenticate: Bearer error=“insufficient_scope”).API_DISABLED— The organization has turned the API off (Admin → API → Settings); its clients and grants are kept.PLAN_FEATURE_UNAVAILABLE— The organization’s plan does not include this feature (error.feature, plan).
object
object
The error-code catalogue: VALIDATION_ERROR 400, UNAUTHENTICATED 401, SPEND_CAP_EXCEEDED 402, TENANT_AI_BUDGET_EXCEEDED 402, FORBIDDEN 403, NOT_FOUND 404, CONFLICT 409, GONE 410, ENDPOINT_REMOVED 410, PAYLOAD_TOO_LARGE 413, UNSUPPORTED_MEDIA_TYPE 415, RATE_LIMITED 429, INTERNAL 500, PROVIDER_ERROR 502, SERVICE_UNAVAILABLE 503, WEAK_PASSWORD 400, INVALID_TOKEN 400, EXPIRED_TOKEN 400, INVALID_CREDENTIALS 401, INVALID_CODE 401, SSO_REQUIRED 403, SLUG_TAKEN 409, LAST_ADMIN 409, MANAGED_BY_IDP 409, LOCKED 429, ASSET_KIND_NOT_ALLOWED 400, ASSET_SOURCE_NOT_ALLOWED 400, LIBRARY_ARCHIVED 409, MISSING_SCOPES 400, CLASSIC_TOKEN 400, INVALID_CREDENTIAL 400, CLOUD_ID_UNRESOLVED 400, SITE_NOT_FOUND 400, INTEGRATION_AUTH 409, INTEGRATION_NOT_CONNECTED 409, SITE_CHOICE_EXPIRED 409, PLATFORM_NOT_CONFIGURED 503, PLAN_LIMIT_REACHED 403, PLAN_FEATURE_UNAVAILABLE 403, TRIAL_EXPIRED 403, INSUFFICIENT_SCOPE 403, API_DISABLED 403, IDEMPOTENCY_CONFLICT 409. Extensible.
Human-readable message
INSUFFICIENT_SCOPE: the scope the operation needs
FORBIDDEN: why (member_inactive, permission_missing, not_opted_in, user_only, role, …)
object
Examples
Authenticated, but the role, object grant or policy does not allow this.
{ "error": { "code": "FORBIDDEN", "message": "Your current role can't do this", "reason": "role" }}The access token lacks the scope this operation needs (error.scope names it; WWW-Authenticate: Bearer error="insufficient_scope").
{ "error": { "code": "INSUFFICIENT_SCOPE", "message": "This operation needs the knowledge:read scope", "scope": "knowledge:read" }}The organization has turned the API off (Admin → API → Settings); its clients and grants are kept.
{ "error": { "code": "API_DISABLED", "message": "The API is turned off for this organization. Ask an admin to turn it on in Admin → API." }}The organization's plan does not include this feature (error.feature, plan).
{ "error": { "code": "PLAN_FEATURE_UNAVAILABLE", "message": "The Tradecraft API is not included in your Pro plan. Available on Enterprise.", "feature": "api.rest", "plan": "pro" }}RATE_LIMITED— Too many requests; retry after the Retry-After header.
Retry-After and RateLimit-* tell when to retry.
object
object
The error-code catalogue: VALIDATION_ERROR 400, UNAUTHENTICATED 401, SPEND_CAP_EXCEEDED 402, TENANT_AI_BUDGET_EXCEEDED 402, FORBIDDEN 403, NOT_FOUND 404, CONFLICT 409, GONE 410, ENDPOINT_REMOVED 410, PAYLOAD_TOO_LARGE 413, UNSUPPORTED_MEDIA_TYPE 415, RATE_LIMITED 429, INTERNAL 500, PROVIDER_ERROR 502, SERVICE_UNAVAILABLE 503, WEAK_PASSWORD 400, INVALID_TOKEN 400, EXPIRED_TOKEN 400, INVALID_CREDENTIALS 401, INVALID_CODE 401, SSO_REQUIRED 403, SLUG_TAKEN 409, LAST_ADMIN 409, MANAGED_BY_IDP 409, LOCKED 429, ASSET_KIND_NOT_ALLOWED 400, ASSET_SOURCE_NOT_ALLOWED 400, LIBRARY_ARCHIVED 409, MISSING_SCOPES 400, CLASSIC_TOKEN 400, INVALID_CREDENTIAL 400, CLOUD_ID_UNRESOLVED 400, SITE_NOT_FOUND 400, INTEGRATION_AUTH 409, INTEGRATION_NOT_CONNECTED 409, SITE_CHOICE_EXPIRED 409, PLATFORM_NOT_CONFIGURED 503, PLAN_LIMIT_REACHED 403, PLAN_FEATURE_UNAVAILABLE 403, TRIAL_EXPIRED 403, INSUFFICIENT_SCOPE 403, API_DISABLED 403, IDEMPOTENCY_CONFLICT 409. Extensible.
Human-readable message
INSUFFICIENT_SCOPE: the scope the operation needs
FORBIDDEN: why (member_inactive, permission_missing, not_opted_in, user_only, role, …)
object
Examples
Too many requests; retry after the Retry-After header.
{ "error": { "code": "RATE_LIMITED", "message": "Too many requests — retry after the Retry-After header" }}