---
title: "Save global FAP template"
method: PUT
path: "/api/data-access/defaults-template"
tags: ["DataAccess"]
---

# Save global FAP template

`PUT /api/data-access/defaults-template`

## Request

- Base URL: `https://api.agentstack.tech` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agentstack.tech/api/data-access/defaults-template`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Writes `field_access_defaults` on ecosystem project (id=1).

**Auth:** **admin** or **owner** on project 1.

Validates `globals` and each resource's `path_rules`. Does **not** change user projects until **apply** is called.

## Headers

- `Idempotency-Key` string

## Request body

- DefaultsTemplateBody: Global FAP template stored on ecosystem project (`project_id=1`) at `data.config.field_access_defaults`. **Apply** (`POST /defaults-template/apply`) copies only **missing** keys from `resources` into a user project — existing resource policies are never overwritten.
  - `default_access` string: Suggested `default_access` when a project has no globals yet (apply only).
  - `globals` object, nullable: Suggested FAP globals: `nested_path_mode` (flat|dotted), `max_mask_depth`.
  - `resources` object: Map of resource name → same object shape as `PUT /policy/{resource}` body.resource_policy (incl. path_rules).
  - `field_triggers` object, nullable: Optional global template for FAP v1.2 `field_triggers` (same shape as policy.field_triggers). Omit to leave unchanged on save.

## Response `200`

Persisted template object

- unknown

## Other responses

- `400`: Bad Request
- `401`: Not authenticated
- `403`: Insufficient project access (read / admin / owner)
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/agentstack/apis/agentstack-core-api.md) · [All operations](https://skmtc.dev/agentstack/apis/agentstack-core-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentstack/apis/agentstack-core-api/revisions/79f4a4dd8813?raw)
