Skip to main content

Medusa API Reference

Internal API endpoints for Medusa content intake automation system.

Authentication

All API endpoints require authentication via user-token header.

Authorization: Bearer {user-token}

Tokens are managed through Farfalla's authentication system.


REST API Endpoints

Base URL: https://medusa.publica.la/api/v1

List Automations

Returns all automations configured for a tenant.

Request

GET /api/v1/automations

Parameters

ParameterTypeRequiredDescription
tenant_idintegerYesTenant identifier

Example Request

curl -X GET "https://medusa.publica.la/api/v1/automations?tenant_id=123" \
-H "Authorization: Bearer {token}"

Response

{
"data": [
{
"id": 1,
"name": "Daily Publication",
"description": "Automated daily content publishing",
"status": "active"
}
]
}

Dispatch Automation

Triggers an automation job manually.

Request

GET /api/v1/dispatch/{automation}

Path Parameters

ParameterTypeRequiredDescription
automationintegerYesAutomation ID

Query Parameters

ParameterTypeRequiredDescription
datestringNoTarget date (YYYY-MM-DD)
actionstringNoAction type: dispatch or redispatch
issue_idintegerNoSpecific issue ID for redispatch
user_idintegerNoUser triggering the automation
user_emailstringNoEmail for notifications
process_typestringNoProcessing mode

Example Request

curl -X GET "https://medusa.publica.la/api/v1/dispatch/1?date=2026-01-22&action=dispatch" \
-H "Authorization: Bearer {token}"

Response

{
"success": true,
"message": "Automation dispatched",
"run_id": 456
}

Nova Tool APIs

Administrative APIs accessible through Laravel Nova interface.

Base URL: https://medusa.publica.la/nova-api/tools

ONIX Validator

Validates ONIX XML files against standard specifications.

Request

POST /nova-api/tools/onix-validator/api/

Headers

HeaderValue
Content-Typemultipart/form-data

Body

FieldTypeRequiredDescription
filefileYesONIX XML file (max 4MB)

Example Request

curl -X POST "https://medusa.publica.la/nova-api/tools/onix-validator/api/" \
-H "Authorization: Bearer {token}" \
-F "file=@onix_file.xml"

Response

{
"valid": true,
"required_fields": {
"present": ["RecordReference", "NotificationType", "ProductIdentifier"],
"missing": []
},
"optional_fields": {
"present": ["Title", "Contributor", "Subject"],
"missing": ["Audience", "OtherText"]
},
"error_count": 0,
"warnings": []
}

ISBN Tracker

Tracks ISBN processing status across the ONIX intake pipeline.

Get ISBN Status

Request

GET /nova-api/tools/isbn-tracker/api/{isbn}

Path Parameters

ParameterTypeRequiredDescription
isbnstringYesISBN-10 or ISBN-13

Example Request

curl -X GET "https://medusa.publica.la/nova-api/tools/isbn-tracker/api/9781234567890" \
-H "Authorization: Bearer {token}"

Response

{
"isbn": "9781234567890",
"current_state": {
"onix_file": {
"id": 123,
"status": "processed",
"processed_at": "2026-01-22T10:00:00Z"
},
"onix_event": {
"id": 456,
"status": "completed",
"event_type": "create"
},
"onix_issue": {
"id": 789,
"status": "ingested",
"farfalla_issue_id": 1234
}
},
"previous_states": []
}

Force Discover Events

Manually triggers ONIX event discovery for an ISBN.

Request

POST /nova-api/tools/isbn-tracker/api/{isbn}/force-discover-events

Response

{
"success": true,
"message": "Event discovery triggered",
"events_found": 2
}

Force Process Event

Manually triggers ONIX event processing.

Request

POST /nova-api/tools/isbn-tracker/api/{isbn}/force-process-event

Response

{
"success": true,
"message": "Event processing triggered"
}

Force Ingest Issue

Manually triggers issue ingestion to Farfalla.

Request

POST /nova-api/tools/isbn-tracker/api/{isbn}/force-ingest-issue

Response

{
"success": true,
"message": "Issue ingestion triggered",
"farfalla_issue_id": 1234,
"validation": {
"has_content": true,
"has_metadata": true,
"has_cover": true
}
}

Health Endpoints

Ping

Simple health check.

Request

GET /ping

Response

Pong! 2026-01-22 10:00:00

Health Check

Full system health status (requires authentication).

Request

GET /health

Response

{
"status": "healthy",
"database": "connected",
"queue": "running",
"storage": "accessible"
}

Error Responses

All endpoints return consistent error format:

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid tenant_id parameter",
"details": {}
}
}

Common Error Codes

CodeHTTP StatusDescription
UNAUTHORIZED401Invalid or missing token
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
VALIDATION_ERROR422Invalid request parameters
INTERNAL_ERROR500Server error

Rate Limiting

API requests are rate-limited per tenant:

Endpoint TypeLimit
REST API100 requests/minute
Nova Tools20 requests/minute

Exceeded limits return HTTP 429 with Retry-After header.

X

Graph View