---
title: "Create a Generic git provider for self-hosted or arbitrary HTTPS git hosts. Supports public repositories (no token) and private repositories (token-based)."
method: POST
path: "/git-providers/generic"
tags: ["Git Providers"]
---

# Create a Generic git provider for self-hosted or arbitrary HTTPS git hosts. Supports public repositories (no token) and private repositories (token-based).

`POST /git-providers/generic`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/git-providers/generic`
- Auth: HTTP bearer

## Request body

- CreateGenericRequest
  - `base_url` string, nullable: Optional base URL of the git host for display purposes (no API is called).
  - `clone_url` string, required: HTTPS clone URL for the repository, e.g. `https://git.example.com/org/repo.git`.
  - `name` string, required: Display name for this provider.
  - `token` string, password, nullable: A credential. Write-only: it is never returned, and the AI assistant supplies it through a secret slot instead of typing it into the conversation.
  - `token_username` string, nullable: HTTP Basic username used with the token. Defaults to `x-access-token` when absent or empty. Ignored for public (unauthenticated) repositories.

## Response `201`

Generic git provider created successfully

- ProviderResponse
  - `auth_method` string, required
  - `base_url` string, nullable
  - `created_at` string, date-time, required
  - `id` integer, required
  - `is_active` boolean, required
  - `is_default` boolean, required
  - `name` string, required
  - `provider_type` string, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Bad request — invalid clone URL or missing fields
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal server error

## Changes

- **2026-10-23** `7d41b820a372`: 2 breaking, 1 info
  - the request property `token` became not nullable
  - the `token` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `token` request property `oneOf` list
- **2026-10-23** `24af93ff5379`: 2 breaking, 1 info
  - removed `#/components/schemas/SecretString, subschema #2` from the `token` request property `oneOf` list
  - the `token` request property type changed from no type to `string, null`
  - the request property `token` became nullable
- **2026-10-22** `842d42ed4659`: 2 breaking, 1 info
  - the request property `token` became not nullable
  - the `token` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `token` request property `oneOf` list
- **2026-10-22** `1a12a50b75ee`: 2 breaking, 1 info
  - removed `#/components/schemas/SecretString, subschema #2` from the `token` request property `oneOf` list
  - the `token` request property type changed from no type to `string, null`
  - the request property `token` became nullable
- **2026-10-21** `79089e9f49ee`: 2 breaking, 1 info
  - the request property `token` became not nullable
  - the `token` request property type changed from `string, null` to no type
  - added `#/components/schemas/SecretString, subschema #2` to the `token` request property `oneOf` list

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/git-providers/generic/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
