> 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.

# Create Skill

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

Create a new skill in a collection from multipart form fields and uploaded files.

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

## Request

### Headers

- `anthropic-beta` (list of string, optional, nullable)

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

This endpoint expects a Body_create_skill_v1_skills_post.

- `display_title` (string, required) — display title field.
- `collection` (string, required) — collection field.
- `source` (enum, optional, default: custom) — source field.
  - Allowed values: `custom`, `anthropic`, `zylon`
- `loading` (enum, optional, default: lazy) — loading field.
  - Allowed values: `eager`, `lazy`
- `readonly` (boolean, optional, default: false) — readonly field.

## Response

### 200

Skill created successfully.

- `id` (string, required) — Unique skill identifier.
- `created_at` (datetime, required) — Creation timestamp.
- `display_title` (string, required) — Human display title.
- `source` (enum, required) — Source of the skill.
  - Allowed values: `custom`, `anthropic`, `zylon`
- `updated_at` (datetime, required) — Update timestamp.
- `collection` (string, required) — Tenant identifier (org_id boundary).
- `loading` (enum, required) — Instruction loading strategy.
  - Allowed values: `eager`, `lazy`
- `readonly` (boolean, required) — Readonly flag.
- `latest_version` (string, optional, nullable) — Latest version token for this skill.
- `type` ("skill", optional, default: skill) — Object type.

## Errors

### 401 Unauthorized Error

Unauthorized

- `any`

### 422 Unprocessable Entity Error

Validation Error

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

## Types

### 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",
  "source": "custom",
  "loading": "lazy",
  "readonly": false
}
```

**Response**

```json
{
  "id": "skill_01HZX8N83J4WQ2E4K4G3Q2H9E8",
  "created_at": "2026-04-16T10:30:00Z",
  "display_title": "Sales Ops Helper",
  "source": "custom",
  "updated_at": "2026-04-16T10:30:00Z",
  "collection": "acme-prod",
  "loading": "lazy",
  "readonly": false,
  "latest_version": "v1",
  "type": "skill"
}
```

**SDK Code**

```python
import requests

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

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';
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"

	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")

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")
  .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', [
  '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");
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")! 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()
```