v1

Inicio rápido

Su primera llamada

Después de crear una clave API, llame a la API con X-API-Key.

URLs base

REST API:

https://<project-ref>.supabase.co/functions/v1/api-gateway/v1

OGC API - Features:

https://<project-ref>.supabase.co/functions/v1/api-gateway/oapif

Reemplace <project-ref> con la referencia de su proyecto Supabase.

Listar registros

curl -H "X-API-Key: mk_live_your_key_here" \
  "https://<ref>.supabase.co/functions/v1/api-gateway/v1/records?per_page=5"

Formato de respuesta

{
  "ok": true,
  "data": [
    {
      "id": "8ba2dac9-2f85-4b36-9b8f-2da8c9a7f4a0",
      "type": "record",
      "form_id": "df7991ef-4a6f-48f4-9f1d-0fd4f53c9a77",
      "project_id": "c328e46a-8fb9-41f1-a5f9-3dca9a894ab3",
      "form_version_id": "e5d3f7bc-ec9c-457b-8f2f-9ab8e76b519c",
      "properties": {
        "name": "Inspection #42",
        "status_field": "completed"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [-73.985, 40.758]
      },
      "created_at": "2026-02-20T09:00:00Z",
      "updated_at": "2026-02-20T09:15:00Z",
      "status": "active"
    }
  ],
  "pagination": {
    "total": 142,
    "page": 1,
    "per_page": 5,
    "total_pages": 29
  }
}

Paginación

Parámetro Por defecto Máx Descripción
page 1 -- Número de página
per_page 50 500 Elementos por página

Reintentos seguros para escrituras

Use Idempotency-Key en llamadas POST y PUT.

curl -X POST \
  -H "X-API-Key: mk_live_..." \
  -H "Idempotency-Key: rec-create-001" \
  -H "Content-Type: application/json" \
  -d '{"form_id":"...","properties":{"name":"Example"}}' \
  "https://<ref>.supabase.co/functions/v1/api-gateway/v1/records"

Verificación de conexión

Use un endpoint autenticado para verificar la conectividad:

curl -H "X-API-Key: mk_live_..." \
  "https://<ref>.supabase.co/functions/v1/api-gateway/v1/organization"

Próximos pasos

¿Necesita ayuda con la API? Contacte a nuestro equipo de soporte.

Abrir la Aplicación Web