Golden API
Trazadera Golden provides a full API based on REST and OpenAPI definition.
The Golden API has predictable resource-oriented URLs, accepts URL parameters, request parameters and request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Quick Reference
Item | Value |
|---|---|
Base URL |
|
Authentication | Bearer token in |
Content Type |
|
API Specification | OpenAPI 3.0 |
Documentation |
|
Getting Started
You need the API <GOLDEN_URL> and the access <GOLDEN_TOKEN> to start using the Golden API. Your administrator or Trazadera Support will provide you with this information.
Environment Setup
Set up your environment variables (replace with your actual values):
export GOLDEN_URL="https://your-instance.trazadera.net"
export GOLDEN_TOKEN="golden:YourAccessTokenHere"
Verify Connection
Test your connection with the /api/security/whoami endpoint:
curl -X 'GET' "${GOLDEN_URL}/api/security/whoami" \
-H 'Accept: application/json' \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
Successful response (authenticated):
{
"token": "golden:***",
"id": "t-abc123",
"role": "STEWARD",
"permissions": {
"entity.view": "ALLOW",
"golden.search": "ALLOW",
"golden.upsertRecord": "ALLOW"
},
"name": "My API Token",
"type": "ACCESS_TOKEN"
}
Unauthenticated response:
{
"type": "NONE"
}
Authentication
The Golden API uses access tokens to authenticate requests. Your Golden administrator can manage API keys, including creation, renewal, and deletion.
Authentication Rules
Requirement | Description |
|---|---|
Header |
|
Token Format | Must have |
Protocol | HTTPS required (HTTP calls will fail) |
Scope | Token must be included in every request |
Token Types
Type | Description | Use Case |
|---|---|---|
Access Token | Long-lived API key | Service integrations, automation |
JWT Token | Short-lived session token | Web UI, interactive applications |
Example Request with Authentication
curl -X 'GET' "${GOLDEN_URL}/api/entity" \
-H 'Accept: application/json' \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
Security Best Practice: Keep your API keys secure. They carry privileges based on their associated role.
Request Format
HTTP Methods
Method | Purpose | Example |
|---|---|---|
| Retrieve resources | Get entity list |
| Create resources or execute actions | Create entity, search records |
| Update resources | Update entity configuration |
| Remove resources | Delete entity |
Common Headers
# Required headers
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
-H "Accept: application/json"
# For POST/PUT requests with body
-H "Content-Type: application/json"
URL Parameters
Many endpoints support query parameters for filtering and pagination:
# Pagination
curl "${GOLDEN_URL}/api/entity?page=0&size=20"
# Filtering
curl "${GOLDEN_URL}/api/entity?status=COMPLETED"
# Sorting
curl "${GOLDEN_URL}/api/entity?sort=created,desc"
Request Body
POST and PUT requests typically require a JSON body:
curl -X 'POST' "${GOLDEN_URL}/api/entity" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "my-entity",
"description": "Customer deduplication entity"
}'
Response Format
Success Responses
All successful responses return JSON with status code 200:
{
"content": [...],
"page": {
"size": 20,
"number": 0,
"totalElements": 150,
"totalPages": 8
}
}
Paginated Results
List endpoints return paginated results:
Field | Description |
|---|---|
| Array of results |
| Items per page |
| Current page (0-based) |
| Total items available |
| Total pages available |
HTTP Status Codes
Code | Result | Meaning |
|---|---|---|
| Success | Request completed successfully |
| Bad Request | Invalid parameters or malformed request |
| Unauthorized | Missing or invalid authentication token |
| Forbidden | Insufficient permissions for this operation |
| Not Found | Resource does not exist |
| Conflict | Resource state conflict (e.g., entity already running) |
| Server Error | Unexpected system error |
Error Response Format
{
"errors": ["Detailed error message here"]
}
Example Error Handling
# Invalid endpoint
curl -X 'GET' "${GOLDEN_URL}/api/invalid" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
# Response (404):
{"errors":["No static resource api/invalid."]}
API Modules
The Golden API is organized into modules (OpenAPI tags) that group related functionality.
Core Modules
Module | Description | Key Operations |
|---|---|---|
golden | Golden Record management | Search, upsert, merge records |
entity | Entity lifecycle management | Create, run, monitor entities |
resource | Resource configuration | Datasets, indexers, classifiers |
table | Table operations | CRUD, query, import/export |
metric | Metrics and statistics | Quality metrics, dashboards |
System Modules
Module | Description | Key Operations |
|---|---|---|
security | Authentication & authorization | Users, tokens, roles |
task | Task scheduling & monitoring | Schedule, cancel, status |
event | Event logging | View system events |
file | File management | Upload, download files |
configuration | System configuration | Version, settings, OpenAPI |
Common API Operations
Entity Operations
# List all entities
curl -X 'GET' "${GOLDEN_URL}/api/entity" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
# Get specific entity
curl -X 'GET' "${GOLDEN_URL}/api/entity/my-entity" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
# Run entity
curl -X 'POST' "${GOLDEN_URL}/api/entity/my-entity/run" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
# Check entity status
curl -X 'GET' "${GOLDEN_URL}/api/entity/my-entity/status" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
Golden Record Operations
# Search records
curl -X 'POST' "${GOLDEN_URL}/api/golden/my-entity/search" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"query": "[email protected]",
"page": 0,
"size": 10
}'
# Upsert record
curl -X 'POST' "${GOLDEN_URL}/api/golden/my-entity/upsert" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"source": "CRM",
"sourceId": "12345",
"data": {
"name": "John Doe",
"email": "[email protected]"
}
}'
# Get bucket details
curl -X 'GET' "${GOLDEN_URL}/api/golden/my-entity/bucket/B-12345" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
Table Operations
# List tables
curl -X 'GET' "${GOLDEN_URL}/api/table" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
# Query table
curl -X 'POST' "${GOLDEN_URL}/api/table/customers/query" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"filter": "status = '\''active'\''",
"page": 0,
"size": 100
}'
Retrieving API Version and OpenAPI Definition
Get API Version
curl -X 'GET' "${GOLDEN_URL}/api/configuration/version" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}"
# Response:
{"version":"2.0.38"}
Download OpenAPI Specification
curl -X 'GET' "${GOLDEN_URL}/api/configuration/openapi" \
-H "Authorization: Bearer ${GOLDEN_TOKEN}" \
-o golden-openapi.json
The OpenAPI definition follows the OpenAPI 3.0 Specification.
OpenAPI Resources
Resource | Description |
|---|---|
GitHub | trazadera-golden-openapi - API definition and Java client |
Swagger UI |
|
Live Spec |
|
Tip: Always use the OpenAPI version that matches your production environment.
Roles and Authorization
Your token is associated with a role that determines your permissions. See the Security section for details.
Role Hierarchy
Role | Capabilities |
|---|---|
USER | Read-only access to data |
STEWARD | Read and write access to data |
ADMIN | Full access including configuration |
Authorization Errors
# Response when lacking permissions (403):
{
"errors": ["Access denied: insufficient permissions for operation 'entity.delete'"]
}
Security Best Practices
Practice | Description |
|---|---|
Least Privilege | Grant only the minimum required permissions |
Avoid ADMIN tokens | Use STEWARD or USER roles for integrations |
Rotate tokens | Periodically regenerate API tokens |
Secure storage | Never commit tokens to version control |
HTTPS only | All API calls must use HTTPS |
Rate Limiting and Performance
Best Practices
Practice | Recommendation |
|---|---|
Batch operations | Use bulk endpoints when available |
Pagination | Always paginate large result sets |
Caching | Cache frequently accessed data client-side |
Connection pooling | Reuse HTTP connections |
Pagination Example
# First page
curl "${GOLDEN_URL}/api/entity?page=0&size=50"
# Next page
curl "${GOLDEN_URL}/api/entity?page=1&size=50"
Next Steps
Resource | Description |
|---|---|
Swagger UI and OpenAPI details | |
Java client library | |
CLI tool for automation | |
Complete developer documentation |