Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.case.dev/llms.txt

Use this file to discover all available pages before exploring further.

Skill namespaces let you publish a tree of private Agent Skills files, then materialize that tree inside an agent chat sandbox before the chat starts. Use namespaces when you need more than a single custom skill record: companion files, templates, examples, or a complete SKILL.md bundle that should live in the chat workspace.
Skill namespace management requires an API key with agent write access. Namespace publish and pull calls use the namespace bearer token returned when the namespace is created.

Flow

  1. Create a namespace with POST /agent/skills/namespaces.
  2. Store the returned namespace token securely. It is shown once.
  3. Publish files with POST /agent/skills/namespaces/{id}/publish.
  4. Attach the namespace to a chat with skillTargets on POST /agent/v2/chat.
When the chat boots, the runtime calls GET /agent/skills/namespaces/{id}/pull, downloads the namespace files into /workspace/.agents/skills, deletes the temporary token config, and then starts the chat.

Create a Namespace

curl -X POST https://api.case.dev/agent/skills/namespaces \
  -H "Authorization: Bearer $CASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "namespaceId": "litigation-playbooks",
    "label": "Litigation Playbooks"
  }'
Response:
{
  "namespace": {
    "id": "skn_abc123",
    "namespaceId": "litigation-playbooks",
    "currentVersion": 0
  },
  "token": "sk_skill_namespace_..."
}

Publish Skill Files

Publish a complete skill tree. At least one file must be named SKILL.md.
curl -X POST https://api.case.dev/agent/skills/namespaces/skn_abc123/publish \
  -H "Authorization: Bearer $SKILL_NAMESPACE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "files": [
      {
        "path": "motion-opposition/SKILL.md",
        "encoding": "utf8",
        "content": "---\nname: motion-opposition\ndescription: Draft opposition briefs.\n---\n\n# Motion Opposition\n\nUse this skill when drafting opposition briefs."
      },
      {
        "path": "motion-opposition/checklist.md",
        "encoding": "utf8",
        "content": "# Opposition Checklist\n\n- Identify burden\n- Preserve objections\n- Request alternative relief"
      }
    ]
  }'
Response:
{
  "namespace": {
    "id": "skn_abc123",
    "namespaceId": "litigation-playbooks"
  },
  "version": 1,
  "fileCount": 2,
  "totalBytes": 278
}

Attach to a Chat

Use skillTargets when creating a chat. Each target includes the namespace row id and namespace bearer token.
curl -X POST https://api.case.dev/agent/v2/chat \
  -H "Authorization: Bearer $CASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Draft opposition brief",
    "skillTargets": [
      {
        "namespaceId": "skn_abc123",
        "token": "'"$SKILL_NAMESPACE_TOKEN"'"
      }
    ]
  }'
The chat response does not echo the namespace token. Inside the sandbox, the files are available under:
/workspace/.agents/skills/motion-opposition/SKILL.md
/workspace/.agents/skills/motion-opposition/checklist.md
You can then reference the skill naturally in chat:
curl -X POST https://api.case.dev/agent/v2/chat/chat_abc123/message \
  -H "Authorization: Bearer $CASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      {
        "type": "text",
        "text": "Use the motion-opposition skill to draft an outline for our response."
      }
    ]
  }'

Pull Manifest

GET /agent/skills/namespaces/{id}/pull returns the active version manifest with short-lived presigned URLs. This is the endpoint the sandbox bootstrap uses.
curl https://api.case.dev/agent/skills/namespaces/skn_abc123/pull \
  -H "Authorization: Bearer $SKILL_NAMESPACE_TOKEN"
Response:
{
  "namespace": {
    "id": "skn_abc123",
    "namespaceId": "litigation-playbooks"
  },
  "version": 1,
  "expiresIn": 600,
  "objects": [
    {
      "relativePath": "motion-opposition/SKILL.md",
      "sizeBytes": 118,
      "url": "https://..."
    }
  ]
}

Same-org Namespace Slugs

For namespaces owned by the same organization as the API key, chats can also pass skillNamespaces with customer-facing namespace slugs:
{
  "title": "Draft opposition brief",
  "skillNamespaces": ["litigation-playbooks"]
}
Use skillTargets when you want explicit secret transport or cross-organization provisioning. Use skillNamespaces when the router should resolve and inject namespaces owned by the caller’s organization.