POST /api/repos/:repoId/gaps/config
Summary
Creates a pull request on GitHub with the provided YAML configuration content for a repository’s gaps config.
Intent
Allows users to submit a YAML configuration file that will be committed to a new branch and opened as a pull request against the repository’s default branch, enabling configuration of gap detection settings without direct repository write access.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| repoId | string | Yes | The unique identifier of the repository to configure. |
| customerId | string | No | Optional customer ID used to verify ownership of the repository. If provided, it must match the customerId associated with the repo. |
| yamlContent | string | Yes | The YAML content to write into the configuration file via a pull request. |
Request example
curl -X POST https://maps.google.com//api/repos/:repoId/gaps/config \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "customerId": "cust-456", "yamlContent": "api:\n base_url: https://api.acme.com\nauth:\n type: bearer\n header: Authorization\nrate_limits:\n requests_per_minute: 100\n scope: per_api_key\n" }'Response example
{ "prUrl": "https://github.com/acme/my-api/pull/42"}Error cases
404— No repository found matching the provided repoId.403— A customerId was provided in the request body but it does not match the customerId associated with the repository.400— The yamlContent field is missing or empty in the request body.
Gotchas
- The yamlContent field is required — omitting it will result in a 400 error even if all other fields are valid.
- If customerId is included in the request body, it must exactly match the customerId stored on the repository record; a mismatch returns 403 rather than 404 to avoid leaking repo existence.
- This endpoint creates a new GitHub branch named turbodog/configure-<timestamp> and opens a PR against the repository’s configured default branch — it does not directly write to the default branch.
- A new branch and PR are created on every call; calling this endpoint multiple times will produce multiple open pull requests.
- The endpoint interacts with GitHub via an installation ID stored on the repo record, so the GitHub App must have write access to the target repository for the PR creation to succeed.