2026-08-06 16:50:57.209883+08 / restful-api
API Meta Information
A practical guide to API metadata, semantic versioning, API identifiers, and audience classification.
API Meta Information
API Specifications MUST contain API metadata
API specifications MUST contain sufficient metadata to support API lifecycle management and governance.
The OpenAPI specification MUST provide the following information:
| Field | Description |
|---|---|
#/info/title |
A unique and meaningful functional name identifying the API |
#/info/version |
The API specification version following semantic versioning rules |
#/info/description |
A clear and comprehensive description of the API |
In addition, the following OpenAPI extension properties MUST be provided:
| Field | Description |
|---|---|
#/info/x-api-id |
A unique and immutable identifier of the API |
#/info/x-audience |
The intended audience of the API |
Example:
openapi: 3.0.1
info:
title: User Management API
description: API for managing user accounts and profiles.
version: 1.2.0
x-api-id: user-management-api-123456
x-audience: company-internal
API Versioning MUST follow Semantic Versioning
The API version specified in:
#/info/version
MUST follow Semantic Versioning 2.0 rules.
The API version format MUST be:
<MAJOR>.<MINOR>.<PATCH>
Example:
1.3.7
Version increment rules
MAJOR version
The MAJOR version MUST be increased when incompatible changes are introduced.
Examples:
- Removing an existing endpoint
- Removing or renaming request fields
- Changing response structures in a breaking way
- Changing API behavior that breaks existing consumers
Example:
1.0.0 -> 2.0.0
MINOR version
The MINOR version MUST be increased when new functionality is added in a backward-compatible manner.
Examples:
- Adding a new endpoint
- Adding optional request parameters
- Adding new response fields without affecting existing clients
Example:
1.2.0 -> 1.3.0
PATCH version
The PATCH version MAY be increased for backward-compatible fixes or documentation changes.
Examples:
- Fixing incorrect descriptions
- Correcting examples
- Fixing documentation errors
Example:
1.3.0 -> 1.3.1
API Version vs Software Version
API versioning describes changes in the external API contract.
It does NOT represent software release versions.
Examples:
An internal implementation change:
- Refactoring code
- Updating dependencies
- Changing database implementation
does not require an API version change if the API contract remains unchanged.
Version restrictions
The following MUST NOT be used in API versions:
- Pre-release identifiers
Example:
1.0.0-alpha
- Build metadata
Example:
1.0.0+build123
Only the following format is allowed:
MAJOR.MINOR.PATCH
Example:
info:
version: 1.3.7
API Identifier
Each API specification MUST provide a unique and immutable API identifier.
The identifier allows API lifecycle management, including:
- Tracking API evolution
- Maintaining API history
- Linking different versions of the same API
- Supporting automated compatibility checks
The identifier MUST remain unchanged throughout the API lifecycle.
Example:
info:
x-api-id: user-management-api-123456
Recommended format:
x-api-id:
type: string
description: Unique and immutable identifier of the API.
Example:
info:
x-api-id: d0184f38-b98d-11e7-9c56-68f728c1ba70
The API identifier identifies the API itself, while the API version identifies a specific evolution stage.
Example:
API ID:
user-management-api
Versions:
1.0.0
1.1.0
1.2.0
2.0.0
All versions belong to the same API lifecycle.
API Audience Classification
Each API MUST define its intended audience.
The audience classification helps determine:
- API governance requirements
- Documentation visibility
- Security requirements
- Change management rules
- Review requirements
The audience MUST be defined in:
#/info/x-audience
Allowed values:
x-audience:
type: string
Supported values:
internal
company-internal
external-partner
external-public
Audience Definitions
| Audience | Classification | Description |
|---|---|---|
| internal | System internal | Used only inside a component or subsystem owned by the same team |
| company-internal | Organization internal | Can be used across teams inside the organization but not exposed externally |
| external-partner | Partner API | Intended for authorized external partners |
| external-public | Public API | Available to external users over public networks |
Audience Examples
Internal API
info:
x-audience: internal
Example:
Service A -> Service B
within the same application
Company Internal API
info:
x-audience: company-internal
Example:
Service A -> Service B
between different teams inside the organization
Partner API
info:
x-audience: external-partner
Example:
Company system -> Business partner system
Public API
info:
x-audience: external-public
Example:
Public Internet API
Audience Rules
- Each API specification MUST define exactly one audience.
- Multiple audience classifications MUST NOT be assigned to a single API.
- If an API contains interfaces with different audiences, split them into separate API specifications.
Example:
Incorrect:
x-audience:
- internal
- external-public
Correct:
API A:
x-audience: internal
API B:
x-audience: external-public