Referencia de endpoints
Contrato HTTP exacto: parámetros, cuerpos, ejemplos de respuesta, cabeceras y errores.
/v1/reportsCrear un informe de análisis
Valida y encola un texto. La respuesta 202 incluye recursos de estado y eventos; no implica que el análisis haya terminado.
Authorization: Bearer ARTEXT_API_KEYParameters
Idempotency-KeyheaderRecommended unique key for safely retrying this creation request. It is scoped to the authenticated caller, retained for 24 hours, and must not be reused with a different payload.
Request body
application/json
{
"$ref": "#/components/schemas/ReportRequest"
}
Create a report
{
"domain_slug": "lenguaje-claro",
"external_id": "document-123",
"language": "es",
"text": "En el d\u00eda de hoy se realizar\u00e1 la revisi\u00f3n de la solicitud.",
"text_type_slug": "texto-juridico-administrativo-dirigido-a-la-ciudadania"
}
Responses
LocationCanonical status resource for the accepted report.Retry-AfterMinimum number of seconds before the first status poll.X-Request-IDIdentifier to retain for support and tracing.application/json{
"$ref": "#/components/schemas/ReportAccepted"
}
Report accepted and queued
{
"events_url": "/v1/reports/rep_7f12a4c8/events",
"external_id": "document-123",
"report_id": "rep_7f12a4c8",
"status": "queued",
"status_url": "/v1/reports/rep_7f12a4c8"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.Retry-AfterSeconds to wait before a retry can be attempted.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.Retry-AfterSeconds to wait before a retry can be attempted.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
/v1/reports/{report_id}Consultar estado y resultado
Devuelve el estado actual. En queued/running hay que respetar Retry-After; completed y failed son terminales.
Authorization: Bearer ARTEXT_API_KEYParameters
report_idpath · requiredUnique report identifier returned by POST /v1/reports.
Responses
Retry-AfterPresent for queued/running reports; wait at least this many seconds before polling again.X-Request-IDIdentifier to retain for support and tracing.application/json{
"$ref": "#/components/schemas/Report"
}
Report queued
{
"events_url": "/v1/reports/rep_7f12a4c8/events",
"external_id": "document-123",
"report_id": "rep_7f12a4c8",
"status": "queued",
"status_url": "/v1/reports/rep_7f12a4c8"
}Report completed
{
"error": null,
"external_id": "document-123",
"position_in_queue": null,
"report_id": "rep_7f12a4c8",
"result": {
"genre": {
"domain": {
"name": "Lenguaje claro",
"slug": "lenguaje-claro"
},
"text_type": {
"name": "Texto jur\u00eddico-administrativo dirigido a la ciudadan\u00eda",
"slug": "texto-juridico-administrativo-dirigido-a-la-ciudadania"
}
},
"language": "es",
"measurements": [
{
"implementation_version": "1.0",
"metric_id": "word-count",
"unit": "words",
"value": 12
}
],
"offset_unit": "unicode_code_points",
"schema_version": "1.0",
"suggestions": [
{
"category": "lexical",
"explanation": null,
"id": "sug_1",
"implementation_version": "1.0",
"metric_id": "redundant-expressions",
"metric_title": "Eliminaci\u00f3n de expresiones redundantes",
"occurrences": [
{
"alternatives": [],
"edits": [
{
"end": 16,
"start": 0,
"text": ""
}
],
"end": 16,
"id": "occ_1",
"paragraph_index": 0,
"replacement": null,
"sentence_index": 0,
"start": 0,
"text": "En el d\u00eda de hoy"
}
],
"recommendations": [
"Elimina la expresi\u00f3n si el contexto lo permite."
],
"severity": "warning",
"summary": "Conviene formular el fragmento de manera m\u00e1s directa."
}
]
},
"status": "completed"
}Report failed
{
"error": {
"code": "analysis_failed",
"message": "The analysis could not be completed."
},
"external_id": "document-123",
"position_in_queue": null,
"report_id": "rep_7f12a4c8",
"result": null,
"status": "failed"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.Retry-AfterSeconds to wait before a retry can be attempted.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.Retry-AfterSeconds to wait before a retry can be attempted.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
/v1/reports/{report_id}/eventsRecibir transiciones por SSE
Canal SSE opcional con el estado inicial, cambios y heartbeats. Se cierra al terminar; el polling sigue siendo el respaldo compatible.
Authorization: Bearer ARTEXT_API_KEYParameters
report_idpath · requiredUnique report identifier returned by POST /v1/reports.
Responses
X-Request-IDIdentifier to retain for support and tracing.text/event-stream{
"type": "string"
}
A stream closes after completed or failed
"event: status\\ndata: {\"report_id\":\"rep_7f12a4c8\",\"status\":\"running\",\"updated_at\":\"2026-07-15T10:00:02Z\"}\\n\\nevent: status\\ndata: {\"report_id\":\"rep_7f12a4c8\",\"status\":\"completed\",\"updated_at\":\"2026-07-15T10:00:06Z\"}\\n\\n"
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.Retry-AfterSeconds to wait before a retry can be attempted.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.Retry-AfterSeconds to wait before a retry can be attempted.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
/v1/metricsList metric implementations
Returns measurement and suggestion implementations, including inactive variants and localized documentation. Narrowing the request to a genre reports which metrics that genre actually evaluates.
Authorization: Bearer ARTEXT_API_KEYParameters
analysis_languagequeryLanguage implementation to return: es, ca or en.
documentation_languagequeryLanguage used for titles and documentation: es, ca or en.
kindqueryFilter by measurement or suggestion.
enabledqueryFilter by the current implementation status.
domain_slugqueryText domain of a genre, as listed by GET /v1/text-types.
text_type_slugqueryText type (genre) inside domain_slug, as listed by GET /v1/text-types.
Responses
X-Request-IDIdentifier to retain for support and tracing.application/json{
"$ref": "#/components/schemas/MetricCatalog"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
/v1/metrics/{metric_id}Get one metric implementation
Returns the status, category and localized documentation for one language variant, optionally narrowed to a genre.
Authorization: Bearer ARTEXT_API_KEYParameters
metric_idpath · requiredStable conceptual metric identifier.
analysis_languagequery · requiredLanguage implementation to return: es, ca or en.
documentation_languagequeryLanguage used for titles and documentation: es, ca or en.
domain_slugqueryText domain of a genre, as listed by GET /v1/text-types.
text_type_slugqueryText type (genre) inside domain_slug, as listed by GET /v1/text-types.
Responses
X-Request-IDIdentifier to retain for support and tracing.application/json{
"$ref": "#/components/schemas/Metric"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
/v1/text-typesList text domains and genres
Returns the domains (ámbitos) and the genres (text types) available for a language. The slug pair of a genre is what POST /v1/reports expects.
Authorization: Bearer ARTEXT_API_KEYParameters
languagequeryCatalog language: es, ca or en.
Responses
X-Request-IDIdentifier to retain for support and tracing.application/json{
"$ref": "#/components/schemas/PublicTextTypeCatalog"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
/v1/text-types/{domain_slug}/{text_type_slug}Get one genre
Returns the sections and contents recommended for a genre, plus the exact report_defaults to forward to POST /v1/reports.
Authorization: Bearer ARTEXT_API_KEYParameters
domain_slugpath · requiredText domain of a genre, as listed by GET /v1/text-types.
text_type_slugpath · requiredText type (genre) inside domain_slug, as listed by GET /v1/text-types.
languagequeryCatalog language: es, ca or en.
Responses
X-Request-IDIdentifier to retain for support and tracing.application/json{
"$ref": "#/components/schemas/PublicTextTypeDetail"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}
X-Request-IDIdentifier to retain for support and tracing.application/problem+json{
"$ref": "#/components/schemas/ApiProblem"
}