TikTok · API Governance Rules

TikTok API Rules

Spectral linting rules defining API design standards and conventions for TikTok.

6 Rules error 2 warn 2 info 2
View Rules File View on GitHub

Rule Categories

tiktok

Rules

warn
tiktok-operation-id-camel-case
Operation IDs must use camelCase
$.paths[*][*].operationId
error
tiktok-versioned-paths
All paths must include an API version prefix
$.paths
error
tiktok-operation-summary
All operations must have a summary
$.paths[*][*]
warn
tiktok-operation-tags
All operations must have tags
$.paths[*][*]
info
tiktok-business-api-code-field
Business API responses should include a code field
$.paths[*][*].responses.200.content.application/json.schema.properties
info
tiktok-advertiser-id-required
Business API operations should document advertiser_id parameter
$.paths[*][get].parameters[*]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  tiktok-operation-id-camel-case:
    description: Operation IDs must use camelCase
    message: "Operation ID '{{value}}' must use camelCase"
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  tiktok-versioned-paths:
    description: All paths must include an API version prefix
    message: "Path '{{value}}' must start with a version prefix"
    severity: error
    given: "$.paths"
    then:
      field: "@key"
      function: pattern
      functionOptions:
        match: "^/(v[0-9]+|open_api/v[0-9]+)"

  tiktok-operation-summary:
    description: All operations must have a summary
    message: "Operation must have a summary"
    severity: error
    given: "$.paths[*][*]"
    then:
      field: summary
      function: truthy

  tiktok-operation-tags:
    description: All operations must have tags
    message: "Operation must have at least one tag"
    severity: warn
    given: "$.paths[*][*]"
    then:
      field: tags
      function: truthy

  tiktok-business-api-code-field:
    description: Business API responses should include a code field
    message: "Business API response schema should have a 'code' field"
    severity: info
    given: "$.paths[*][*].responses.200.content.application/json.schema.properties"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  tiktok-advertiser-id-required:
    description: Business API operations should document advertiser_id parameter
    message: "Endpoint should document advertiser_id parameter"
    severity: info
    given: "$.paths[*][get].parameters[*]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/tiktok-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.