API de Monofield
Lee y escribe los formularios, registros, listas de opciones y archivos de tu equipo desde tus propios sistemas. La API forma parte del plan Team. Cada escritura se comprueba como la comprueba la app, y una fila mala nunca para a las demás.
La referencia está en inglés, como la propia API.
Claves
El propietario o un gestor crea una clave del equipo en Ajustes › Equipo › API. Se muestra una sola vez; envíala como token Bearer. No la pongas en apps que otras personas puedan leer.
curl "https://api.monofield.app/v1" -H "Authorization: Bearer $MONOFIELD_KEY"Operaciones
- GET/v1
- GET/v1/openapi.json
- GET/v1/forms
- GET/v1/forms/{form}
- GET/v1/forms/{form}/records
- POST/v1/forms/{form}/records
- PATCH/v1/forms/{form}/records
- GET/v1/forms/{form}/records/{record}
- PATCH/v1/forms/{form}/records/{record}
- DELETE/v1/forms/{form}/records/{record}
- GET/v1/forms/{form}/changes
- POST/v1/forms/{form}/records/{record}/files
- GET/v1/forms/{form}/records/{record}/files/{name}
- GET/v1/choice-lists
- GET/v1/classification-sets
- GET/v1/audit-log
- GET/v1/webhooks
- POST/v1/webhooks
- DELETE/v1/webhooks/{webhook}
- GET/v1/forms/{form}/webhook-sample
- GET/v1/forms/{form}/query
The key
GET /v1
The key’s name, team, the role it acts with, its forms and its limits.
Respuestas: 200, 400, 401, 403, 429, 500
curl -X GET "https://api.monofield.app/v1" \
-H "Authorization: Bearer $MONOFIELD_KEY"This document
GET /v1/openapi.json
The OpenAPI 3.1 document of the API (no key needed).
Respuestas: 200
curl -X GET "https://api.monofield.app/v1/openapi.json" \
-H "Authorization: Bearer $MONOFIELD_KEY"List forms
GET /v1/forms
The forms the key sees (archived ones only with `archived=true`).
- archived (query)
- Also archived forms.
Respuestas: 200, 400, 401, 403, 429, 500
curl -X GET "https://api.monofield.app/v1/forms" \
-H "Authorization: Bearer $MONOFIELD_KEY"Get a form
GET /v1/forms/{form}
Its fields with their data name, type, label, whether required, and options.
- form (path)
- The form’s id.
- keys (query)
- How fields are named in `values`: by data name (default), by field id, or by label.
Respuestas: 200, 400, 401, 403, 404, 429, 500
curl -X GET "https://api.monofield.app/v1/forms/$FORM_ID" \
-H "Authorization: Bearer $MONOFIELD_KEY"List records
GET /v1/forms/{form}/records
Live records by id, a page at a time, optionally filtered with the records table’s filter.
- form (path)
- The form’s id.
- keys (query)
- How fields are named in `values`: by data name (default), by field id, or by label.
- limit (query)
- Items per page, 1–200 (50 by default).
- cursor (query)
- The `next_cursor` of the previous page.
- filter (query)
- A filter tree as JSON (AND/OR/NOT groups of rules), fields named as in `keys`.
- project (query)
- Only the records of this project: the same as the filter rule `project is any of`.
Respuestas: 200, 400, 401, 403, 404, 429, 500
curl -X GET "https://api.monofield.app/v1/forms/$FORM_ID/records" \
-H "Authorization: Bearer $MONOFIELD_KEY"Create records
POST /v1/forms/{form}/records
1–100 records, each checked like the app checks it; a bad row never stops the others.
- form (path)
- The form’s id.
- keys (query)
- How fields are named in `values`: by data name (default), by field id, or by label.
- Idempotency-Key (header)
- Sent again with the same request, it gives the same answer and never writes twice; kept 24 h.
Cuerpo: CreateRecords
Respuestas: 200, 400, 401, 403, 404, 409, 413, 422, 429, 500
curl -X POST "https://api.monofield.app/v1/forms/$FORM_ID/records" \
-H "Authorization: Bearer $MONOFIELD_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"records": [{"values": {"serial": "H-104", "pressure": 4.5}}]}'Change records
PATCH /v1/forms/{form}/records
1–100 records; only the fields sent change; one result per row.
- form (path)
- The form’s id.
- keys (query)
- How fields are named in `values`: by data name (default), by field id, or by label.
- Idempotency-Key (header)
- Sent again with the same request, it gives the same answer and never writes twice; kept 24 h.
Cuerpo: UpdateRecords
Respuestas: 200, 400, 401, 403, 404, 409, 413, 422, 429, 500
curl -X PATCH "https://api.monofield.app/v1/forms/$FORM_ID/records" \
-H "Authorization: Bearer $MONOFIELD_KEY" \
-H "Content-Type: application/json" \
-d '{"records": [{"id": "$RECORD_ID", "values": {"pressure": 5}}]}'Get a record
GET /v1/forms/{form}/records/{record}
One record, also from the trash (with `deleted_at`).
- form (path)
- The form’s id.
- record (path)
- The record’s id.
- keys (query)
- How fields are named in `values`: by data name (default), by field id, or by label.
Respuestas: 200, 400, 401, 403, 404, 429, 500
curl -X GET "https://api.monofield.app/v1/forms/$FORM_ID/records/$RECORD_ID" \
-H "Authorization: Bearer $MONOFIELD_KEY"Change a record
PATCH /v1/forms/{form}/records/{record}
Only the fields sent change.
- form (path)
- The form’s id.
- record (path)
- The record’s id.
- keys (query)
- How fields are named in `values`: by data name (default), by field id, or by label.
- Idempotency-Key (header)
- Sent again with the same request, it gives the same answer and never writes twice; kept 24 h.
Cuerpo: RecordChange
Respuestas: 200, 400, 401, 403, 404, 409, 413, 422, 429, 500
curl -X PATCH "https://api.monofield.app/v1/forms/$FORM_ID/records/$RECORD_ID" \
-H "Authorization: Bearer $MONOFIELD_KEY" \
-H "Content-Type: application/json" \
-d '{"values": {"pressure": 5}, "if_version": "12"}'Delete a record
DELETE /v1/forms/{form}/records/{record}
To the trash, recoverable for 30 days (L6, §5.2).
- form (path)
- The form’s id.
- record (path)
- The record’s id.
- Idempotency-Key (header)
- Sent again with the same request, it gives the same answer and never writes twice; kept 24 h.
Respuestas: 200, 400, 401, 403, 404, 409, 413, 422, 429, 500
curl -X DELETE "https://api.monofield.app/v1/forms/$FORM_ID/records/$RECORD_ID" \
-H "Authorization: Bearer $MONOFIELD_KEY"Changes since a cursor
GET /v1/forms/{form}/changes
Records that changed after `after`, in the server’s order, deleted ones too. Keep `next_cursor` for the next call.
- form (path)
- The form’s id.
- keys (query)
- How fields are named in `values`: by data name (default), by field id, or by label.
- limit (query)
- Items per page, 1–200 (50 by default).
- after (query)
- The `next_cursor` of the last call; from the start when absent.
Respuestas: 200, 400, 401, 403, 404, 429, 500
curl -X GET "https://api.monofield.app/v1/forms/$FORM_ID/changes" \
-H "Authorization: Bearer $MONOFIELD_KEY"Upload a file
POST /v1/forms/{form}/records/{record}/files
A signed URL (2 h) to upload a photo or document of the record, under a name the server gives; then put `[{ "id", "fileName" }]` in its field.
- form (path)
- The form’s id.
- record (path)
- The record’s id.
- Idempotency-Key (header)
- Sent again with the same request, it gives the same answer and never writes twice; kept 24 h.
Cuerpo: NewFile
Respuestas: 200, 400, 401, 403, 404, 409, 413, 422, 429, 500
curl -X POST "https://api.monofield.app/v1/forms/$FORM_ID/records/$RECORD_ID/files" \
-H "Authorization: Bearer $MONOFIELD_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"extension": "jpg"}'Download a file
GET /v1/forms/{form}/records/{record}/files/{name}
A signed URL (60 seconds: ask for it right before downloading) to a photo or document of the record.
- form (path)
- The form’s id.
- record (path)
- The record’s id.
- name (path)
- The file name, as in the field’s value.
Respuestas: 200, 400, 401, 403, 404, 429, 500
curl -X GET "https://api.monofield.app/v1/forms/$FORM_ID/records/$RECORD_ID/files/$FILE_NAME" \
-H "Authorization: Bearer $MONOFIELD_KEY"List choice lists
GET /v1/choice-lists
The team’s choice lists (§2.11), read only.
Respuestas: 200, 400, 401, 403, 429, 500
curl -X GET "https://api.monofield.app/v1/choice-lists" \
-H "Authorization: Bearer $MONOFIELD_KEY"List classification sets
GET /v1/classification-sets
The team’s classification sets (§2.11), read only.
Respuestas: 200, 400, 401, 403, 429, 500
curl -X GET "https://api.monofield.app/v1/classification-sets" \
-H "Authorization: Bearer $MONOFIELD_KEY"Audit log
GET /v1/audit-log
The team’s audit log, newest first, with who, what, when, channel, address, place, device and sign-in of each entry. Only for a key whose role may see the audit log (`audit.view`).
- limit (query)
- Items per page, 1–200 (50 by default).
- cursor (query)
- The `next_cursor` of the previous page.
- action (query)
- Only these actions (comma separated, e.g. `auth.sign_in,apikey.use`).
- actor (query)
- Only what this person did (their id).
- from (query)
- From this instant (ISO 8601, included).
- until (query)
- Until this instant (ISO 8601, excluded).
- ip (query)
- An address, or a network in CIDR (`203.0.113.0/24`).
- source (query)
- Only these channels (comma separated: web, ios, android, api, mcp…).
- country (query)
- ISO 3166-1 alpha-2 country code.
- device (query)
- Words of the device: platform, model, browser or system.
Respuestas: 200, 400, 401, 403, 429, 500
curl -X GET "https://api.monofield.app/v1/audit-log" \
-H "Authorization: Bearer $MONOFIELD_KEY"List subscriptions
GET /v1/webhooks
The REST Hook subscriptions this key made; never their secrets.
Respuestas: 200, 400, 401, 403, 429, 500
curl -X GET "https://api.monofield.app/v1/webhooks" \
-H "Authorization: Bearer $MONOFIELD_KEY"Subscribe to record events
POST /v1/webhooks
A REST Hook (Zapier, Make, Power Automate): the events of the forms this key reaches are sent, signed, to `url`. The secret is shown once; `Location` names the subscription.
- Idempotency-Key (header)
- Sent again with the same request, it gives the same answer and never writes twice; kept 24 h.
Cuerpo: NewSubscription
Respuestas: 201, 400, 401, 403, 409, 413, 422, 429, 500
curl -X POST "https://api.monofield.app/v1/webhooks" \
-H "Authorization: Bearer $MONOFIELD_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'Unsubscribe
DELETE /v1/webhooks/{webhook}
Deletes a subscription of this key; what it had waiting is not sent.
- webhook (path)
- The subscription’s id.
- Idempotency-Key (header)
- Sent again with the same request, it gives the same answer and never writes twice; kept 24 h.
Respuestas: 200, 400, 401, 403, 404, 409, 413, 422, 429, 500
curl -X DELETE "https://api.monofield.app/v1/webhooks/{webhook}" \
-H "Authorization: Bearer $MONOFIELD_KEY"Sample deliveries
GET /v1/forms/{form}/webhook-sample
Up to 3 bodies shaped as deliveries of `event`, from the records that changed last: to map fields before the first event.
- form (path)
- The form’s id.
- event (query)
- The event (record.created by default).
Respuestas: 200, 400, 401, 403, 404, 429, 500
curl -X GET "https://api.monofield.app/v1/forms/$FORM_ID/webhook-sample" \
-H "Authorization: Bearer $MONOFIELD_KEY"Query records
GET /v1/forms/{form}/query
Typed rows, one column per field by data name, filtered with `where`, ordered with `sort`, as JSON or CSV. Never SQL: `where` is `field op value` joined with and, or, not and parentheses.
- form (path)
- The form’s id.
- where (query)
- E.g. `status = "Open" and quantity >= 3`. Operators: = != < <= > >= contains not_contains starts_with ends_with, `is [not] empty`, `[not] in (…)`, `between … and …`; `_created_at`, `_updated_at` (days) and `_status` are the record’s.
- sort (query)
- Up to 3 names, `-` for descending (default `-_updated_at`).
- fields (query)
- The columns to return, by name (`id` always comes first).
- limit (query)
- Rows per page, 1–500 (100 by default).
- cursor (query)
- The `next_cursor` of the previous page (with CSV, its `Monofield-Next-Cursor` header).
- format (query)
- `json` (default) or `csv` (UTF-8 with BOM, for Excel and Power BI).
Respuestas: 200, 400, 401, 403, 404, 429, 500
curl -X GET "https://api.monofield.app/v1/forms/$FORM_ID/query" \
-H "Authorization: Bearer $MONOFIELD_KEY"