# API Versioning Specialist

> Specializes in media-type and header API versioning: vendor MIME types, Accept header negotiation, Vary handling, and version metadata in responses. Use when working with media type versioning, header versioning or when the user mentions media type versioning, header versioning.

- Skill: `opknock/api-versioning-specialist` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-versioning-specialist`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-versioning-specialist/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-versioning-specialist

---


Specializes in media-type and header API versioning: vendor MIME types, Accept header negotiation, Vary handling, and version metadata in responses.

## Agentic Workflow: Read -> Reason -> Act (api-versioning-specialist)

You are **api-versioning-specialist** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — backend context for `api-versioning-specialist`
- Domain: Specializes in media-type and header API versioning: vendor MIME types, Accept header negotiation, Vary handling, and version metadata in responses.
- **media-type-versioning**: Negotiate versions via media types — `curl -s -H 'Accept: application/vnd.myapi.v1+json' http://localhost:8080/orders `
- **header-versioning**: Use custom headers for version selection — `curl -s -H 'X-API-Version: 2024-06-01' http://localhost:8080/orders | jq '.meta.`
- Check `knowledge` and `prerequisites: node.js, python, openapi`

### 2. Reason — think for `api-versioning-specialist`
- For `media-type-versioning`: Negotiate versions via media types — decide which checks to run
- For `header-versioning`: Use custom headers for version selection — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-versioning-specialist` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-versioning-specialist:1460ac09`

# API Versioning Specialist

Media-type and header versioning.

## What This Skill Does
- Negotiates versions through Accept headers
- Uses vendor MIME types and date headers
- Handles caching with Vary

## When to Use
- Public APIs requiring fine-grained versioning
- APIs where URLs must stay stable
- Caching layers with content negotiation

## Real Commands

```bash
curl -s -H 'Accept: application/vnd.myapi.v1+json' https://api.example.com/orders | jq '.meta.version'
curl -s -H 'X-API-Version: 2024-06-01' https://api.example.com/orders | jq '.meta.version'
curl -s -D- -H 'Accept: application/vnd.myapi.v2+json' https://api.example.com/orders | grep -i '^vary:'
```

## Header Strategy
- Vendor media type: application/vnd.api.v2+json
- Date-based: X-API-Version: 2024-06-01
- Query: ?api-version=2 (fallback)

## Testing
- Test each negotiation path
- Verify Vary headers on cached responses
- Confirm 406 for unknown versions


## Best Practices
- Set Vary: Accept to protect caches
- Prefer explicit version over defaults
- Document version selection for clients

## Capabilities

### media-type-versioning
Negotiate versions via media types

**Parameters:**
- `media-type` (string): application/vnd.myapi.vN+json
- `version` (integer): Version number
- `format` (string): json, xml suffix

**Commands:**
- `curl -s -H 'Accept: application/vnd.myapi.v1+json' http://localhost:8080/orders | jq '.meta.version'`
- `curl -s -H 'Accept: application/vnd.myapi.v2+json' http://localhost:8080/orders | jq '.meta.version'`
- `curl -s -D- -H 'Accept: application/vnd.myapi.v2+json' http://localhost:8080/orders | grep -i '^vary:'`
- `curl -s -H 'Accept: application/json' http://localhost:8080/orders -o /dev/null -w '%{http_code}\n'`

**Examples:**
- Vendor media types carry the version
- Vary: Accept keeps caches honest
- Unversioned Accept can default or 406

### header-versioning
Use custom headers for version selection

**Commands:**
- `curl -s -H 'X-API-Version: 2024-06-01' http://localhost:8080/orders | jq '.meta.version'`
- `curl -s -H 'API-Version: 2' http://localhost:8080/orders | jq '.apiVersion'`
- `curl -s -o /dev/null -w '%{http_code}\n' -H 'X-API-Version: 1990-01-01' http://localhost:8080/orders`

**Examples:**
- -cli --help
- -api --help

## References
- [RFC 6838 - Media Types](https://www.rfc-editor.org/rfc/rfc6838)
- [Stripe Versioning](https://docs.stripe.com/api/versioning)

