Getting started
Back to home
Getting started

Set Docker build secrets

Replace the Docker build-secret configuration. Send an empty value to clear it. Normal project reads do not return these values.

PUT/api/customer/v1/projects/{projectId}/build/secrets

This operation can remove, overwrite or interrupt resources, or grant access. Check the project and resource IDs before sending it.

Path parameters

NameValue
projectIdRequired resource ID from an earlier API response.

Request body

Send JSON with Content-Type: application/json. Nested fields and accepted values are listed in the schema.

FieldTypeRequired
valuestringYes
Full request schema
{
  "type": "object",
  "properties": {
    "value": {
      "type": "string"
    }
  },
  "required": [
    "value"
  ],
  "additionalProperties": false
}

Example request

Set HCODE_BASE_URL and HCODE_API_KEY as shown in Getting started. Replace resource variables with your own IDs.

curl --request PUT "$HCODE_BASE_URL/api/customer/v1/projects/${PROJECT_ID}/build/secrets" \
  --header "Authorization: Bearer $HCODE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "value": "replace-this-value"
}'

Response

The JSON shape is defined in the response schema.

Response schema
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "message": {
      "type": "string"
    },
    "operationId": {
      "type": "string"
    },
    "operation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "operationId": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "errorMessage": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "startedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "finishedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "status"
      ],
      "additionalProperties": true
    },
    "deploymentId": {
      "type": "string"
    },
    "projectId": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "operations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "href": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "href"
        ]
      }
    }
  },
  "required": [],
  "additionalProperties": true
}

See errors and retries for failure responses.