---
title: "Replace a skill from a skill folder"
description: "Replace one of your skills with a new upload of the same skill (same ``name``):\nSKILL.md and the whole file tree, as one version in its history."
---

> Documentation Index
> Fetch the complete documentation index at: https://truememory-docs.mvstg.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: AI Gateway API › Skills

`POST /skills/{skill_id}/import`

Replace one of your skills with a new upload of the same skill (same ``name``):
SKILL.md and the whole file tree, as one version in its history.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Path parameters

- `skill_id` (`reimport_skill.path.skill_id`; string, required)
  - format `uuid`

## Header parameters

- `X-On-Behalf-Of` (`reimport_skill.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`reimport_skill.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`
- `X-App-Id` (`reimport_skill.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`

## Request body

- `files` (`reimport_skill.files`; any of, optional) — One .zip or .skill file, or the skill folder's files named by their paths.
  - any of: `array<string>`, `null`
- `files[]` (`reimport_skill.files[]`; any of, optional) — The same as `files`, under the name the Claude and OpenAI APIs use.
  - any of: `array<string>`, `null`

## Example request

```text
{
  "files": [
    "string"
  ],
  "files[]": [
    "string"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://truememory-api.mvstg.com/skills/<skill_id>/import' \
  --header 'Authorization: Bearer <token>' \
  --form-string 'files=string' \
  --form-string 'files[]=string'
```

### TypeScript

```typescript
const formData = new FormData();
formData.append('files', 'string');
formData.append('files[]', 'string');

const url = 'https://truememory-api.mvstg.com/skills/<skill_id>/import';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}, body: formData};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/skills/<skill_id>/import"

files = [
    ("files", (None, "string")),
    ("files[]", (None, "string"))
]
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, files=files, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "id": "string",
  "user_id": "string",
  "app_ids": [
    "string"
  ],
  "key": "string",
  "name": "string",
  "description": "string",
  "prompt": "string",
  "category": "string",
  "categories": [
    {
      "id": "string",
      "name": "string"
    }
  ],
  "icon": "string",
  "argument_hint": "string",
  "allowed_tools": [
    "string"
  ],
  "metadata": {},
  "use_case": "string",
  "detection_patterns": [
    "string"
  ],
  "license": "string",
  "compatibility": "string",
  "is_preset": true,
  "is_active": true,
  "sort_order": 0,
  "forked_from_skill_id": "string",
  "usage_count": 0,
  "last_used_at": "2019-08-24T14:15:22Z",
  "parent_synced_at": "2019-08-24T14:15:22Z",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "files": [
    {
      "path": "string",
      "sha256": "string",
      "size": 0,
      "content_type": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "ignored_frontmatter": [
    "string"
  ],
  "app_id": "string"
}
```

- `id` (`reimport_skill.response.200.id`; string, required)
- `user_id` (`reimport_skill.response.200.user_id`; any of, required) — Owner user_id, NULL for presets.
  - any of: `string`, `null`
- `app_ids` (`reimport_skill.response.200.app_ids`; any of, required) — Apps this skill is assigned to. NULL means all apps (global/unscoped).
  - any of: `array<string>`, `null`
- `key` (`reimport_skill.response.200.key`; string, required)
- `name` (`reimport_skill.response.200.name`; string, required)
- `description` (`reimport_skill.response.200.description`; any of, required)
  - any of: `string`, `null`
- `prompt` (`reimport_skill.response.200.prompt`; string, required)
- `category` (`reimport_skill.response.200.category`; any of, required) — Freeform grouping label (legacy string). Distinct from `categories`.
  - any of: `string`, `null`
- `icon` (`reimport_skill.response.200.icon`; any of, required)
  - any of: `string`, `null`
- `argument_hint` (`reimport_skill.response.200.argument_hint`; any of, required)
  - any of: `string`, `null`
- `allowed_tools` (`reimport_skill.response.200.allowed_tools`; array<string>, required)
- `metadata` (`reimport_skill.response.200.metadata`; object, required)
- `is_preset` (`reimport_skill.response.200.is_preset`; boolean, required)
- `is_active` (`reimport_skill.response.200.is_active`; boolean, required)
- `sort_order` (`reimport_skill.response.200.sort_order`; integer, required)
- `forked_from_skill_id` (`reimport_skill.response.200.forked_from_skill_id`; any of, required)
  - any of: `string`, `null`
- `usage_count` (`reimport_skill.response.200.usage_count`; integer, required) — Global invocation count, bumped via POST /skills/{id}/usage.
- `last_used_at` (`reimport_skill.response.200.last_used_at`; any of, required) — When the skill was last invoked, NULL if never.
  - any of: `string`, `null`
- `parent_synced_at` (`reimport_skill.response.200.parent_synced_at`; any of, required) — For forks: the preset updated_at this fork is synced to. The fork is stale when its preset's updated_at is newer. NULL for non-forks.
  - any of: `string`, `null`
- `created_at` (`reimport_skill.response.200.created_at`; string, required)
  - format `date-time`
- `updated_at` (`reimport_skill.response.200.updated_at`; string, required)
  - format `date-time`
- `files` (`reimport_skill.response.200.files`; array<object>, required)
  - `path` (`reimport_skill.response.200.files.path`; string, required) — Path in the skill folder, e.g. `references/method.md`.
  - `sha256` (`reimport_skill.response.200.files.sha256`; string, required) — Hex SHA-256 of the file's bytes.
  - `size` (`reimport_skill.response.200.files.size`; integer, required) — Size in bytes.
  - `content_type` (`reimport_skill.response.200.files.content_type`; string, required)
  - `created_at` (`reimport_skill.response.200.files.created_at`; string, required)
    - format `date-time`
  - `updated_at` (`reimport_skill.response.200.files.updated_at`; string, required) — When this path last got different bytes.
    - format `date-time`
- `app_id` (`reimport_skill.response.200.app_id`; any of, required) — DEPRECATED, read app_ids instead. Legacy single-app scalar derived from app_ids for pre-multi-app consumers: the first app id, or null for all apps. Lossy for multi-app skills.
  - any of: `string`, `null`
- `categories` (`reimport_skill.response.200.categories`; array<object>, optional) — Category entities assigned via the registry. Returned by the list endpoints, the single-skill reads (user and admin) and PUT /admin/skills/{skill_id}/categories; omitted by writes.
  - `id` (`reimport_skill.response.200.categories.id`; string, required)
  - `name` (`reimport_skill.response.200.categories.name`; string, required)
- `use_case` (`reimport_skill.response.200.use_case`; any of, optional) — When this skill applies, in natural language. Read by skill selection.
  - any of: `string`, `null`
- `detection_patterns` (`reimport_skill.response.200.detection_patterns`; any of, optional) — Example utterances that should invoke this skill.
  - any of: `array<string>`, `null`
- `license` (`reimport_skill.response.200.license`; any of, optional) — SKILL.md `license`: a license name, or the file in the skill that holds it.
  - any of: `string`, `null`
- `compatibility` (`reimport_skill.response.200.compatibility`; any of, optional) — SKILL.md `compatibility`: what the skill needs to run (product, packages, network).
  - any of: `string`, `null`
- `ignored_frontmatter` (`reimport_skill.response.200.ignored_frontmatter`; array<string>, optional) — SKILL.md frontmatter keys with no Truememory field. They were not stored, and an export will not contain them.

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`reimport_skill.response.422.detail`; array<object>, optional)
  - `loc` (`reimport_skill.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`reimport_skill.response.422.detail.msg`; string, required)
  - `type` (`reimport_skill.response.422.detail.type`; string, required)
  - `input` (`reimport_skill.response.422.detail.input`; unknown, optional)
  - `ctx` (`reimport_skill.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/skills/post-import/index.md
