Cognite · API Governance Rules
Cognite API Rules
Spectral linting rules defining API design standards and conventions for Cognite.
9 Rules
error 1
warn 5
info 3
Rule Categories
cognite
Rules
info
cognite-list-endpoints-use-post
Cognite list endpoints use POST with a filter body, not GET with query params
$.paths[*]
warn
cognite-external-id-in-create-body
Cognite resource create requests should support externalId
$.components.schemas[*ExternalAsset,*ExternalEvent,*Post*].properties
warn
cognite-timestamp-fields-are-epoch-ms
Timestamp fields (createdTime, lastUpdatedTime, startTime, endTime) must be int64 epoch milliseconds
$.components.schemas[*].properties[createdTime,lastUpdatedTime,startTime,endTime]
info
cognite-pagination-cursor-field
Cognite list responses use nextCursor for pagination
$.components.schemas[*Response*,*List*].properties
warn
cognite-internal-ids-are-int64
Internal IDs (id, parentId, assetId, rootId) must be int64
$.components.schemas[*].properties.id
info
cognite-metadata-string-values
Metadata fields in Cognite resources are string key -> string value maps
$.components.schemas[*].properties.metadata
warn
cognite-external-id-max-length
externalId fields must have maxLength of 255
$.components.schemas[*].properties.externalId
error
cognite-operation-ids-required
All operations must have an operationId for SDK generation
$.paths[*][get,post,put,patch,delete]
warn
cognite-operations-have-tags
All operations should be tagged for API navigation
$.paths[*][get,post,put,patch,delete]