curl -sS -X POST "$BMA_BASE_URL/v1/skills" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID" \
-H "Idempotency-Key: $(uuidgen)" \
-F "files=@(contents of pdf-tools/SKILL.md)" \
-F "files=@(contents of pdf-tools/scripts/extract.py)" \
-F "display_name=PDF tools"{
"type": "skill",
"id": "skl_agq7qo75pb6s5gqqjnxy4li4a4",
"display_name": "PDF tools",
"latest_version_id": "skr_agq7qo75rj5bddb6f6owwsq6ku",
"source": {
"type": "custom"
},
"created_at": "2026-11-20T09:14:03.530412Z",
"updated_at": "2026-11-20T09:14:03.530412Z",
"bma_name": "pdf-tools",
"bma_revision": 1,
"bma_description": "Extract text and tables from PDF files with the bundled scripts.",
"bma_owner": {
"kind": "project",
"project_id": "01a0fba0-9400-7c9e-8f41-0d2b7a6c3e18"
},
"bma_skill_md": "---\nname: pdf-tools\ndescription: Extract text and tables from PDF files with the bundled scripts.\n---\n# PDF tools\n\nRun `scripts/extract.py <file.pdf>` to print the text of every page.\n",
"bma_files": [
{
"path": "SKILL.md",
"size": 184
},
{
"path": "scripts/extract.py",
"size": 2381
}
]
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}Create a skill
Creates a skill in the request workspace from a multipart/form-data upload (files parts, or one zip archive) and stores the upload as its first version (bma_revision 1). The SKILL.md frontmatter name becomes the skill’s immutable bma_name and must equal the name of the upload’s top-level directory (an upload with SKILL.md at its root is stored under a directory of that name). Names are not unique: uploading the same name again creates another skill; add a version to an existing skill with Create a skill version. The answer is the skill as retrieve shows it, including bma_skill_md and bma_files. Send Idempotency-Key to make retries safe: for 24 hours the same key with the same upload (path, display name, owner and every file) replays the first answer, the same key with a different upload is a 400, and one sent while the first is still running is a 409. A request refused before it ran (400, 403, 404, 413) or a 5xx frees the key. Without a key, an SDK retry (X-Stainless-Retry-Count of 1 or more) of the same upload within 10 minutes replays the first attempt’s answer instead of creating a second skill.
Authorization: An organization API key (x-api-key: bma_org_v1_...), a personal access token (Authorization: Bearer bma_pat_v1_...), an OAuth access token, or a signed-in user’s dashboard token or session, with the workspace role admin or developer in the request workspace (organization owners and admins qualify in every workspace of their organization); operators and viewers get 403. The workspace is the one named by bma-workspace-id (or anthropic-workspace-id), otherwise the credential’s own workspace; a user credential names its organization with bma-organization-id.
Limits:
- Upload size: at most 30 MiB (31,457,280 bytes) of file content in total, uncompressed (for an
archive, both the zip and its unpacked files count against it); the whole request body at most 31 MiB. A larger upload is a 413request_too_largewithout anerror.code. - File paths: relative,
/-separated, at most 4,096 bytes, each segment at most 255 bytes; no empty,.or..segment, no backslash or NUL, no path twice. - SKILL.md frontmatter (YAML between the first two
---lines):namerequired, at most 64 characters of lowercase letters and digits in segments joined by single hyphens, withoutanthropicorclaude;descriptionrequired, non-blank, at most 1,024 bytes, without XML tags. display_name: one line of 1-255 characters.Idempotency-Key: 1-255 visible ASCII characters; a completed key replays for 24 hours, a running one blocks the key for up to 10 minutes.- Rate limit: one request of the organization’s write budget (Rate limits).
Errors (besides the common errors (401 authentication, 429 rate_limited, 500)):
| Status | error.type | error.code | Cause | Fix |
|---|---|---|---|---|
| 400 | invalid_request_error | idempotency_key_reused | Idempotency-Key was already used with a different upload. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | invalid_idempotency_key | Idempotency-Key is empty, longer than 255 characters or not visible ASCII. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | invalid_request | The upload breaks a skill rule: SKILL.md missing from the top-level directory, missing or invalid frontmatter name or description, more than one top-level directory, a frontmatter name that differs from the top-level directory, an invalid or repeated file path, or an archive that is not a valid zip or holds no files. The message names the rule. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | organization_required | A user credential that is bound to no organization names none. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 400 | invalid_request_error | project_required | The credential can use several workspaces and the request names none. | Name the workspace with the bma-workspace-id header. |
| 400 | invalid_request_error | workspace_id_conflict | bma-workspace-id and anthropic-workspace-id name different workspaces. | Correct the request as the message describes and send it again; the same request will keep failing. |
| 403 | permission_error | permission_denied | The caller’s workspace role is operator or viewer. | Use a credential with the required role or access; retrying with the same credential will not help. |
| 409 | conflict_error | idempotency_key_in_use | A request with the same Idempotency-Key is still running. | Retry the same request after a short delay. |
curl -sS -X POST "$BMA_BASE_URL/v1/skills" \
-H "x-api-key: $BMA_API_KEY" \
-H "bma-workspace-id: $BMA_PROJECT_ID" \
-H "Idempotency-Key: $(uuidgen)" \
-F "files=@(contents of pdf-tools/SKILL.md)" \
-F "files=@(contents of pdf-tools/scripts/extract.py)" \
-F "display_name=PDF tools"{
"type": "skill",
"id": "skl_agq7qo75pb6s5gqqjnxy4li4a4",
"display_name": "PDF tools",
"latest_version_id": "skr_agq7qo75rj5bddb6f6owwsq6ku",
"source": {
"type": "custom"
},
"created_at": "2026-11-20T09:14:03.530412Z",
"updated_at": "2026-11-20T09:14:03.530412Z",
"bma_name": "pdf-tools",
"bma_revision": 1,
"bma_description": "Extract text and tables from PDF files with the bundled scripts.",
"bma_owner": {
"kind": "project",
"project_id": "01a0fba0-9400-7c9e-8f41-0d2b7a6c3e18"
},
"bma_skill_md": "---\nname: pdf-tools\ndescription: Extract text and tables from PDF files with the bundled scripts.\n---\n# PDF tools\n\nRun `scripts/extract.py <file.pdf>` to print the text of every page.\n",
"bma_files": [
{
"path": "SKILL.md",
"size": 184
},
{
"path": "scripts/extract.py",
"size": 2381
}
]
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"bma_error_code": "<string>"
},
"request_id": "<string>"
}Headers
Body
The multipart form of a skill upload. Send either files parts or one archive part.
The skill's files, one multipart part each (field name files or files[]); each part's filename is the file's relative path. Either all files sit in one top-level directory named like the SKILL.md name that holds SKILL.md (any letter case), or SKILL.md is at the root and the files are stored under a directory named after the skill.
BMA extension. The owner as JSON text, for example {"kind":"project","project_id":"proj_agqpxieuab6j5d2bbuvxu3b6da"}. Text that is not JSON, or a project owner naming any workspace but the request workspace by its proj_ ID, is a 400; otherwise the value is not used: the skill is always owned by the request workspace.
Response
Success.
A custom skill of a workspace, shown with the metadata of its latest live version.