---
title: "Validate agreement structure"
method: POST
path: "/v0/agreements/validate-template"
tags: ["Authoring"]
---

# Validate agreement structure

`POST /v0/agreements/validate-template`

## Request

- Base URL: `https://test-api.shodai.network`
- URL: `https://test-api.shodai.network/v0/agreements/validate-template`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Checks only the authored agreement JSON and returns participant variable keys, input IDs, state IDs, and warnings. This does not validate deployment values, participant wallet addresses, signer, or permit data.

## Request body

- object: Authored agreement JSON to validate before deployment preflight.

## Response `201`

Agreement structure validation summary.

- object
  - `data` ValidateDirectAgreementTemplateResponse, required
    - `templateId` string, nullable, required: Agreement metadata templateId or id value, when present.
    - `participantVariableKeys` string[], required: Participant address variable keys found in the agreement JSON.
    - `inputIds` string[], required: Input IDs defined in the agreement JSON.
    - `stateIds` string[], required: State IDs defined in the agreement JSON.
    - `warnings` string[], required: Warnings to review before preparing deployment.
  - `meta` ResponseMeta, required
    - `apiVersion` string, required
    - `requestId` string, required: Correlation ID for support and debugging.

## Other responses

- `400`: Invalid agreement JSON.
- `401`: Missing or invalid API credential.
- `402`: The authenticated Shodai account has paid_required entitlement mode for the requested scope. Per-call x402 settlement is not implemented. Treat this as an entitlement/operator issue.
- `403`: The credential lacks the required OAuth scope, the account lacks entitlement, or the account cannot access the resource.

---

[API](https://skmtc.dev/shodai/apis/agreements-api.md) · [All operations](https://skmtc.dev/shodai/apis/agreements-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shodai/apis/agreements-api/revisions/0ac329d0e9a0?raw)
