Editor for the platform's terms & conditions (panel → Configuración → Términos y
Condiciones) and the acceptance log. Paths are relative to the /api/v1 prefix.
Requires an admin bearer token (see Admin auth). Main admin (super) only.
The apps read the published text through Terms.
See Common errors.
| Method | URI | Access | Description |
|---|---|---|---|
GET |
/admin/terms |
Super | Current version, draft in progress and version history |
PUT |
/admin/terms/draft |
Super | Create or overwrite the draft |
DELETE |
/admin/terms/draft |
Super | Discard the draft |
POST |
/admin/terms/publish |
Super | Publish the draft as the next version |
GET |
/admin/terms/versions/{version} |
Super | Read a published version with its content |
GET |
/admin/terms/acceptances |
Super | Paginated acceptance log |
Response 200
{
"public_url": "https://api.pideaguita.com/legal/terminos",
"current": {
"id": 7,
"version": 3,
"title": "Términos y Condiciones",
"content": "<h2>Uso del servicio</h2><p>…</p>",
"published_at": "2026-10-16T18:30:00+00:00",
"acceptances_count": 184,
"admin": { "id": 1, "name": "Ana Pérez" }
},
"draft": {
"id": 8,
"title": "Términos y Condiciones",
"content": "<p>…</p>",
"updated_at": "2026-10-16T19:02:11+00:00"
},
"versions": [
{
"id": 7,
"version": 3,
"title": "Términos y Condiciones",
"published_at": "2026-10-16T18:30:00+00:00",
"acceptances_count": 184,
"admin": { "id": 1, "name": "Ana Pérez" }
}
]
}
| Field | Type | Description |
|---|---|---|
public_url |
string | Public web page that renders the published version |
current |
object|null | Last published version, with content |
draft |
object|null | Unpublished draft, with content |
versions[] |
array | Published versions, newest first, without content |
versions[].acceptances_count |
integer | Users who accepted that version |
Creates the draft or overwrites it. The HTML is sanitized before being stored:
only p, br, hr, div, strong, b, em, i, u, s, h1–h4,
ul, ol, li, blockquote and a survive, every attribute is dropped
except a link's href with an http, https, mailto or tel scheme.
Request
| Field | Type | Required | Rules |
|---|---|---|---|
title |
string | no | max:150 |
content |
string | yes | max:200000, must not be empty after sanitizing |
Response 200 — { "draft": { id, title, content, updated_at } }
Errors
| Status | When |
|---|---|
401 |
Missing or invalid admin token |
403 |
Forbidden — the admin is not the main admin |
422 |
EmptyContent — nothing survives the sanitizer |
422 |
ValidationError — content missing or over the length limit |
Response 200 — { "discarded": true }
Errors
| Status | When |
|---|---|
401 |
Missing or invalid admin token |
403 |
Forbidden — the admin is not the main admin |
404 |
DraftNotFound — there is no draft |
Publishes the draft with the next version number.
Response 200 — { "current": { id, version, title, content, published_at, acceptances_count, admin } }
Errors
| Status | When |
|---|---|
401 |
Missing or invalid admin token |
403 |
Forbidden — the admin is not the main admin |
422 |
DraftNotFound — there is no draft to publish |
Response 200 — { "terms": { id, version, title, content, published_at, acceptances_count, admin } }
Errors
| Status | When |
|---|---|
401 |
Missing or invalid admin token |
403 |
Forbidden — the admin is not the main admin |
404 |
TermsVersionNotFound — unknown or unpublished version |
Query params
| Field | Type | Required | Rules |
|---|---|---|---|
version |
integer | no | min:1 |
role |
string | no | CLIENT or DRIVER |
search |
string | no | max:100, matches the user's name or phone |
limit |
integer | no | min:1, max:100 (default 20) |
Response 200
{
"items": [
{
"id": 912,
"version": 3,
"role": "CLIENT",
"ip_address": "190.11.22.33",
"accepted_at": "2026-10-16T18:45:12+00:00",
"user": { "id": 45, "name": "José Rojas", "phone": "+584121234567" }
}
],
"meta": { "total": 184, "per_page": 20, "current_page": 1, "last_page": 10 }
}
Errors
| Status | When |
|---|---|
401 |
Missing or invalid admin token |
403 |
Forbidden — the admin is not the main admin |
422 |
ValidationError — invalid role, version or limit |
# Save the draft and publish it
curl -X PUT /api/v1/admin/terms/draft -H "Authorization: Bearer {admin}" \
-H "Content-Type: application/json" -d '{"content":"<h2>Uso</h2><p>…</p>"}'
curl -X POST /api/v1/admin/terms/publish -H "Authorization: Bearer {admin}"
# Who accepted version 3
curl "/api/v1/admin/terms/acceptances?version=3" -H "Authorization: Bearer {admin}"