PUT /api/repos/:repoId/overrides/:fileType
Summary
Creates or replaces a file content override for a specific file type within a repository.
Intent
Allows callers to store custom file content overrides for a given repo and file type, enabling per-repo customization of generated or managed files without modifying the underlying source.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| repoId | string | Yes | The unique identifier of the repository for which the override is being set. |
| fileType | string | Yes | The type of file to override. Must be one of the valid file types recognized by the system (e.g., values from VALID_FILE_TYPES). |
| content | string | Yes | The full content to store as the override for the specified file type. |
| customerId | string | No | Optional customer identifier. If provided, it must match the customerId associated with the repo; otherwise the request is rejected with 403. |
Request example
curl -X PUT https://maps.google.com/api/repos/repo-abc123/overrides/readme \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "content": "# My Custom README\n\nThis is a custom override for the readme file.", "customerId": "cust-456" }'Response example
{ "ok": true, "fileType": "readme", "hasOverride": true}Error cases
400— The fileType path parameter is not one of the recognized valid file types.400— The request body does not include the required ‘content’ field.404— No repository was 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.
Gotchas
- The fileType must exactly match one of the values in VALID_FILE_TYPES; the allowed values are enforced server-side and an invalid value returns 400 with the full list of accepted types.
- The ‘content’ field in the request body is required — omitting it (even sending null) will result in a 400 error.
- If you supply ‘customerId’ in the body, it must match the customerId stored on the repo record. A mismatch returns 403, not 404, so the repo existence is checked before the ownership check.
- This is a full replace (PUT) operation — the entire content is overwritten each time; there is no partial update or merge.
- The savedAt timestamp is set server-side at the time of the request; you cannot supply your own timestamp.