# Validate Template

Source: https://agenta.ai/docs/reference/api/validate-agent-template

`POST /agent-templates/validate`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Validate Template

## Parameters

- `project_id` (in query, string (uuid))

## Request body schema

Content type: `application/json` (required)

- `source` (object, required)
  - One of, option 1 (InternalTemplateSource):
    - `kind` (string) Default: `"internal"`.
    - `key` (string, required)
  - One of, option 2 (UploadTemplateSource):
    - `kind` (string) Default: `"upload"`.
    - `staging_session_id` (string, required)
    - `attachment_id` (string (uuid), required)
  - One of, option 3 (SessionFileTemplateSource):
    - `kind` (string) Default: `"session_file"`.
    - `session_id` (string, required)
    - `path` (string, required)
    - `pin` (object, nullable)
      - `version` (string, required)
      - `digest` (string, required)
  - One of, option 4 (GitHubTemplateSource):
    - `kind` (string) Default: `"github"`.
    - `repo_url` (string, required)
    - `commit` (string, required)
    - `path` (string, required)
- `pin` (object, nullable)
  - `version` (string, required)
  - `digest` (string, required)

## Response schemas

### 200: Successful Response

- `valid` (boolean, required)
- `version` (string, nullable)
- `digest` (string, nullable)
- `supported_schema_versions` (array of string, required)
- `issues` (array of object)
  - `code` (string, required)
  - `path` (string, nullable)
  - `field` (string, nullable)
  - `message` (string, required)
  - `next_step` (string, nullable)

### 403: Forbidden

### 404: Template source not found

### 422: Invalid request
