ServicesCatalogHTTP APICommits

Compare the state of two commits

POST
/api/catalog/projects/{project_id}/commits/diff

Return all net changes to resources and namespace bindings between two commits. The response is complete. It is not paged or truncated. When the result is too large, the response is CatalogLimitExceeded. You must have permission to read the project.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Path Parameters

project_id*string

Owning project identifier. Nonempty, at most 128 UTF-8 bytes, with no control characters. Project creation belongs to the project service.

Request Body

application/json
  1. body
base*||

A commit identity or a movable branch/immutable tag resolved exactly once per request. Relative expressions such as main~3 are not supported.

head*||

A commit identity or a movable branch/immutable tag resolved exactly once per request. Relative expressions such as main~3 are not supported.

Response Body

Success

application/json
  1. response

Canonical net mutations transforming base state into head state. Does not include assertions. Materialization limits produce named errors rather than silently truncating a diff.

baseCommitId*catalog.CommitId

Immutable UUIDv7 project commit identity.

Formatuuid
headCommitId*catalog.CommitId

Immutable UUIDv7 project commit identity.

Formatuuid
namespace*array<||>
resources*array<|||>
curl -X POST 'https://api.spiraldb.dev/api/catalog/projects/string/commits/diff' \  -H 'Content-Type: application/json' \  -d '{  "base": {    "branch": {      "branch": "string"    },    "type": "branch"  },  "head": {    "branch": {      "branch": "string"    },    "type": "branch"  }}'
{  "baseCommitId": "444e6d44-c77c-4d6f-9c8c-82cfd8252d0c",  "headCommitId": "ccbbf3ab-15f4-491f-bfd0-0193cd890679",  "namespace": [    {      "assert": {        "expected": "cc46ff75-488a-4f5d-9162-1798e46c1fcc",        "name": "string",        "parent": {          "prefix": {            "path": [              "string"            ],            "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6"          },          "type": "prefix"        }      },      "type": "assert"    }  ],  "resources": [    {      "advance": {        "expected": "cc46ff75-488a-4f5d-9162-1798e46c1fcc",        "replacement": "0d5797a7-50c5-42e4-893d-e90cf0476063",        "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6"      },      "type": "advance"    }  ]}