Sazabi
APIRepos

Link repositories to a project

Link repositories to a project by access source id, optionally unlinking removeIds in the same transaction. Plan admission uses the final organization-wide distinct count; a refusal preserves every mapping. Select only one access source per repository; re-linking an already-linked repository refreshes its selected access source. A batch that mixes available and unavailable access sources links the available ones and reports every requested link in results; a batch where no access source resolves is refused as not found. Retrying the same batch is safe and re-ensures each link's follow-up work.

POST https://api.sazabi.com/v1/repos

POST
/repos

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/repos" \  -H "Content-Type: application/json" \  -d '{    "accessSourceIds": [      "c2855c87-2506-413e-9ddc-fc0e63b5d013"    ]  }'
{  "repos": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "accessSourceId": "5d1da253-770d-4b15-8721-3bd2b3fc8a52",      "source": "githubApp",      "sourceLabel": "string",      "provider": "github",      "owner": "string",      "name": "string",      "fullName": "string",      "defaultBranch": "string",      "isPrivate": true,      "linked": true    }  ],  "results": [    {      "accessSourceId": "5d1da253-770d-4b15-8721-3bd2b3fc8a52",      "status": "linked",      "repoId": "c7c90052-c566-40b6-94a5-a1e9a44bfdc7",      "mappingId": "455df1f6-33e0-45b1-a8aa-27c64555cdd0",      "freshlyLinked": true    }  ]}