POST /api/dev/link-installation
Summary
Links a GitHub installation to a customer by creating an installation record, a repository record, and a documentation site in the development environment.
Intent
Provides a developer shortcut to simulate the full GitHub App installation and repository connection flow without going through the real GitHub OAuth/webhook pipeline, enabling local and integration testing of the post-installation state.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| installationId | string | Yes | The GitHub App installation ID to associate with the repository. |
| customerId | string | Yes | The customer account ID that owns the repository connection. |
| githubRepoId | string | Yes | The GitHub repository ID to link to the installation. |
| repoName | string | No | The full repository name in owner/repo format. Defaults to ‘dev/repo’ if omitted. |
| branch | string | No | The default branch to track for this repository. Defaults to ‘main’ if omitted. |
Request example
curl -X POST https://maps.google.com/api/dev/link-installation \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "installationId": "inst_abc123", "customerId": "cust_xyz789", "githubRepoId": "987654321", "repoName": "acme/my-api", "branch": "main" }'Response example
{ "ok": true, "repoId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "installationId": "inst_abc123", "customerId": "cust_xyz789"}Error cases
400— Any of installationId, customerId, or githubRepoId is missing from the request body
Gotchas
- This endpoint is intended for development and testing only — it bypasses the real GitHub App OAuth and webhook flow entirely.
- repoName must be in ‘owner/repo’ format. The owner segment (everything before the first ’/’) is extracted and stored as the accountLogin. If no ’/’ is present, accountLogin defaults to ‘dev’.
- A new repoId is generated (UUID) on every call, even if the same installationId/customerId/githubRepoId combination is submitted again, which may create duplicate records in the store.
- The documentation site is created with isPublic set to false and a randomly generated previewToken prefixed with ‘prev_’.
- The pagesProject and pagesUrl values are derived internally from customerId and repoName via derivePagesMeta — you cannot supply them directly.
- branch defaults to ‘main’ if omitted; repoName defaults to ‘dev/repo’ if omitted — both are silently applied without any warning in the response.