ConnectCloud Developers

List the ownerships (code ownership) of a project (tenant:forge:read)

GET /api/forge/v1/projects/{key}/ownerships

Module: Forge · operationId: listForgeOwnerships · Tag: Configuration · Auth: access token (Authorization: Bearer <accessToken>)

Requires tenant:forge:read and a project the caller sees. In precedence order (a later ownership wins a path or an item both match).

Parameters

Name In Type Required Description
key path string yes Project key (e.g. APP)

Responses

  • 200 The ownerships (application/json)
  • 404 Error (application/json)

Fields of the 200 answer:

  • items (array of Ownership, required)
    • deputyRefs (array of string, required): E-mails of the deputies (members, at least developer); need an owner of their own
    • description (string, required): Description (max length 2000)
    • id (string (uuid), required): Ownership id
    • itemTypes (array of string, required): Item type keys: items of these types belong here (without an owner:: label)
    • key (string, required): Key; never changes (its label is owner::<key>)
    • labelId (string (uuid), required): The ownership's label owner::<key>; items carry it and it wins over the matchers
    • matchLabelIds (array of string (uuid), required): Plain labels (never owner::…): items carrying one belong here (without an owner:: label); the later position wins
    • name (string, required): Display name (max length 80)
    • ownerRef (string, nullable, required): E-mail of the owner person (a member, at least developer); exclusive with ownerTeamId
    • ownerTeamId (string (uuid), nullable, required): The owning team; exclusive with ownerRef. Neither is allowed only with a parent (inherited)
    • parentId (string (uuid), nullable, required): The parent ownership (same project, no cycle, at most 4 levels); without an owner of its own the nearest ancestor's applies
    • paths (array of string, required): Repository path patterns, the CODEOWNERS subset: segments separated by /, * and ? within a segment, ** as a whole segment for any number of directories. A pattern without / (other than a trailing one) matches at any depth, one with / is relative to the root (a leading / anchors explicitly); a trailing / matches directories. A pattern whose last segment has no wildcard also matches everything below the directory it names (hr, /apps/github); one ending in a wildcard matches only what it names (docs/*). No character classes, \, !, # or spaces. Paths decide only for code (CODEOWNERS, scm).
    • position (integer, required): Precedence: a later ownership wins a path or an item both match
    • version (integer, required): Optimistic-locking version; send it with PATCH

Example 200 answer:

{
  "items": [
    {
      "deputyRefs": [],
      "description": "Gesamter Code der mobilen Apps.",
      "id": "df9a0b1c-2d3e-4f4a-9b12-9d0e1f2a3b01",
      "itemTypes": [],
      "key": "apps",
      "labelId": "8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c0a",
      "matchLabelIds": [],
      "name": "Apps",
      "ownerRef": null,
      "ownerTeamId": "ce8f9a0b-1c2d-4e3f-8a01-8c9d0e1f2a01",
      "parentId": null,
      "paths": [
        "app/**"
      ],
      "position": 0,
      "version": 1
    },
    {
      "deputyRefs": [
        "paul.schmid@muster-it.example"
      ],
      "description": "Alle Fehler gehen an die Qualitätssicherung.",
      "id": "df9a0b1c-2d3e-4f4a-9b12-9d0e1f2a3b04",
      "itemTypes": [
        "fehler"
      ],
      "key": "qualitaet",
      "labelId": "8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c0f",
      "matchLabelIds": [],
      "name": "Qualitätssicherung",
      "ownerRef": "emma.maier@muster-it.example",
      "ownerTeamId": null,
      "parentId": null,
      "paths": [],
      "position": 1,
      "version": 1
    },
    {
      "deputyRefs": [
        "paul.schmid@muster-it.example"
      ],
      "description": "Kotlin-Code der Android-App.",
      "id": "df9a0b1c-2d3e-4f4a-9b12-9d0e1f2a3b02",
      "itemTypes": [],
      "key": "android",
      "labelId": "8a4b5c6d-7e8f-4a9b-8cad-4e5f6a7b8c06",
      "matchLabelIds": [],
      "name": "Android-App",
      "ownerRef": "marie.wagner@muster-it.example",
      "ownerTeamId": null,
      "parentId": "df9a0b1c-2d3e-4f4a-9b12-9d0e1f2a3b01",
      "paths": [
        "app/android/**"
      ],
      "position": 2,
      "version": 1
    }
  ]
}

Example request

curl -X GET 'https://api.mbcom.cloud/api/forge/v1/projects/string/ownerships' \
  -H "Authorization: Bearer $ACCESS_TOKEN"

View as Markdown · Interactive reference · OpenAPI