Create or update a secret entry (By Repo ID)
Creates or updates a secret entry asynchronously. Poll operation status at the returned status_url.
Request
PUT
https://api.sourcecraft.tech/repos/id:{repo_id}/secrets/{key}
Path parameters
|
Name |
Description |
|
key |
Type: string Example: `` |
|
repo_id |
Type: string Example: `` |
Query parameters
|
Name |
Description |
|
secret_group |
Type: string Optional: name of the secret group. Defaults to "default". Example: `` |
Body
application/json
{
"value": "example"
}
|
Name |
Description |
|
value |
Type: string<byte> The secret value. Must be a base64-encoded string. Example: |
Responses
202 Accepted
A successful response.
Body
application/json
{
"operation_id": "example",
"status_url": "example",
"status": "scheduled",
"created_at": "2025-01-01T00:00:00Z",
"modified_at": "2025-01-01T00:00:00Z",
"response": {},
"error": {
"error_code": "example",
"message": "example",
"details": {}
}
}
|
Name |
Description |
|
created_at |
Type: string<date-time> Example: |
|
error |
Type: OperationError Example
|
|
modified_at |
Type: string<date-time> Example: |
|
operation_id |
Type: string Example: |
|
response |
Type: SecretsOperationResult Example
|
|
status |
Type: OperationStatus Enum: |
|
status_url |
Type: string Example: |
OperationStatus
Type: string
Enum: scheduled, in_progress, success, failed, cancel
SecretsOperationResult
Type: object
Example
{}
OperationError
|
Name |
Description |
||
|
details |
Type: Optional details. Exact structure depends on error_code
Example
|
||
|
error_code |
Type: string Example: |
||
|
message |
Type: string Example: |
Example
{
"error_code": "example",
"message": "example",
"details": {}
}
default
Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme
Body
application/json
{
"error_code": "example",
"message": "example",
"request_id": "example",
"details": {}
}
|
Name |
Description |
||
|
details |
Type: Optional details. Exact structure depends on error_code
Example
|
||
|
error_code |
Type: string Example: |
||
|
message |
Type: string Example: |
||
|
request_id |
Type: string Example: |