Getting started
Back to home
Getting started

Complete a source upload

Validate a direct upload before using its ID to inspect source or deploy. The upload must belong to the credential's user and organisation/project.

POST/api/customer/v1/source/uploads/{uploadId}/complete

Path parameters

NameValue
uploadIdRequired 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
projectIdstringNo
Full request schema
{
  "type": "object",
  "properties": {
    "projectId": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [],
  "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 POST "$HCODE_BASE_URL/api/customer/v1/source/uploads/${UPLOAD_ID}/complete" \
  --header "Authorization: Bearer $HCODE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "projectId": "REPLACE_WITH_PROJECT_ID"
}'

Response

The JSON shape is defined in the response schema.

Response schema
{
  "type": "object",
  "properties": {
    "uploadId": {
      "type": "string"
    },
    "expiresAt": {
      "type": "string"
    },
    "sizeBytes": {
      "type": "integer"
    },
    "filename": {
      "type": "string"
    },
    "directUpload": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "headers": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "required": [
        "url",
        "method",
        "headers"
      ],
      "additionalProperties": true
    },
    "operationId": {
      "type": "string"
    },
    "operations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "href": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "href"
        ]
      }
    }
  },
  "required": [
    "uploadId"
  ],
  "additionalProperties": true
}

See errors and retries for failure responses.