Create Git registry
const url = 'http://localhost:3000/api/v1/registries/git';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"name":"my-workloads-repo","url":"https://github.com/org/workloads.git","branch":"main","path":"/","authType":"NONE","credential":"ghp_xxxxxxxxxxxxxxxxxxxx","syncIntervalMinutes":60,"webhookSecret":"my-webhook-secret-123","enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/registries/git \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "name": "my-workloads-repo", "url": "https://github.com/org/workloads.git", "branch": "main", "path": "/", "authType": "NONE", "credential": "ghp_xxxxxxxxxxxxxxxxxxxx", "syncIntervalMinutes": 60, "webhookSecret": "my-webhook-secret-123", "enabled": true }'Creates a new Git registry for the current organization.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Unique name for the registry within the organization
Example
my-workloads-repoGit repository URL
Example
https://github.com/org/workloads.gitBranch to use
Example
mainPath within the repository to scan for workloads
Example
/workloadsAuthentication type
Example
NONECredential (token or SSH key) for authentication. Will be encrypted at rest.
Example
ghp_xxxxxxxxxxxxxxxxxxxxSync interval in minutes
Example
60Webhook secret for GitHub/GitLab webhook validation
Example
my-webhook-secret-123Whether the registry is enabled
Example
trueResponses
Section titled “ Responses ”Git registry created successfully
object
Unique identifier
Organization ID that owns this registry
Registry name
Git repository URL
Branch to use
Path within the repository to scan
Authentication type
Whether credentials are configured
Sync interval in minutes
Last successful sync timestamp
Last sync error message
Last synced commit SHA
Whether a webhook is configured
Whether the registry is enabled
Creation timestamp
Last update timestamp
Example
{ "id": "550e8400-e29b-41d4-a716-446655440000", "organizationId": "550e8400-e29b-41d4-a716-446655440001", "name": "my-workloads-repo", "url": "https://github.com/org/workloads.git", "branch": "main", "path": "/workloads", "authType": "NONE", "hasCredentials": false, "syncIntervalMinutes": 60, "lastSyncAt": "2024-01-15T10:30:00Z", "lastSyncError": "Authentication failed", "lastSyncCommit": "abc123def456", "hasWebhook": false, "enabled": true, "createdAt": "2024-01-01T00:00:00Z", "updatedAt": "2024-01-15T10:30:00Z"}Invalid input data
Unauthorized
Forbidden
Registry with this name already exists