> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.privategpt.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.privategpt.dev/_mcp/server.

# Validate Skill

POST /v1/skills/validate
Content-Type: application/x-www-form-urlencoded

Dry-run validation of skill files and metadata without persisting.

Reference: https://docs.privategpt.dev/api-reference/skills/validate-skill-v-1-skills-validate-post

## Request

### Body (application/x-www-form-urlencoded)

This endpoint expects a Body_validate_skill_v1_skills_validate_post.

- `display_title` (string, required) — display title field.
- `collection` (string, required) — collection field.
- `loading` (enum, optional, default: lazy) — loading field.
  - Allowed values: `eager`, `lazy`

## Response

### 200

Validation result.

- `valid` (boolean, required) — Whether the skill payload would be accepted.
- `name` (string, optional, nullable) — Parsed skill name from SKILL.md frontmatter (when valid).
- `description` (string, optional, nullable) — Parsed skill description from SKILL.md frontmatter (when valid).
- `errors` (list of SkillValidationError, optional) — Validation errors (when invalid).

## Errors

### 401 Unauthorized Error

Unauthorized

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional) — detail field.

## Types

### SkillValidationError

A single structured validation error with stable code and message.

- `code` (string, required) — Uppercase error code identifying the failure kind.
- `message` (string, required) — Human-readable description of the error.
- `params` (map from string to string, optional, nullable) — Optional i18n interpolation parameters (e.g. \{'size': '10'}).

### ValidationError

ValidationError schema.

- `loc` (list of ValidationErrorLocItems, required) — loc field.
- `msg` (string, required) — msg field.
- `type` (string, required) — type field.
- `input` (any, optional) — input field.
- `ctx` (ValidationErrorCtx, optional) — ctx field.

### ValidationErrorLocItems

### ValidationErrorCtx

ctx field.

## Examples

**Request**

```json
{
  "display_title": "Sales Ops Helper",
  "collection": "acme-prod",
  "loading": "lazy"
}
```

**Response**

```json
{
  "valid": true,
  "name": "sales-ops-helper",
  "description": "Helps sales reps draft outreach.",
  "errors": []
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/skills/validate"

payload = ""
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/skills/validate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/skills/validate"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/skills/validate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/skills/validate")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/skills/validate', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/skills/validate");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/x-www-form-urlencoded"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/skills/validate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```