> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hacktron.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Request archive upload

> Get a URL to upload a code archive to, for code that isn't in a connected repository.

Returns a signed URL for uploading a `.zip`, `.7z` or `.tar.gz` source archive.

> [!NOTE]
>
> **Scope required**: `write`. **Role**: member or above.

1. Call this endpoint with the archive's `file_name`.
2. `PUT` the file to `upload_url`, with the `Content-Type` header set to the returned `content_type`.
3. Add `{ "source": "upload", "archive_id": "<id>" }` to `repos` when you [create a pentest draft](https://docs.hacktron.ai/api-reference/pentests/create-pentest.md).

To assess part of the archive, set `include_paths` or `exclude_paths` on its entry in `repos`. You can use the same uploaded archive.

> [!NOTE]
>
> Some self-hosted deployments return `400` because they don't support API
> uploads. In that case, upload the archive through the Hacktron web app.


## OpenAPI

````yaml POST /archives/uploads
openapi: 3.0.0
info:
  title: Hacktron REST API
  description: Public REST API for programmatic access to Hacktron
  version: '1.0'
  contact: {}
servers:
  - url: https://api.hacktron.ai/v1
security:
  - api-key: []
tags: []
paths:
  /archives/uploads:
    post:
      tags:
        - REST API - Archives
      summary: >-
        Get a URL to upload a code archive (.zip, .7z or .tar.gz) to, then
        pentest it as a repo with source upload
      operationId: RestArchiveController_requestUpload
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestUploadDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestUploadResponseDto'
components:
  schemas:
    RequestUploadDto:
      type: object
      properties:
        file_name:
          type: string
          description: Original filename (e.g. "my-project.zip")
          example: my-project.zip
        name:
          type: string
          description: Display name (defaults to filename)
      required:
        - file_name
    RequestUploadResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Archive ID
        upload_url:
          type: string
          description: Signed GCS upload URL (PUT)
        content_type:
          type: string
          description: Content-Type to use in the PUT request
          example: application/zip
      required:
        - id
        - upload_url
        - content_type
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-Api-Key

````

## Related topics

- [Get Started](https://docs.hacktron.ai/mcp/get-started.md)
- [Create pentest draft](https://docs.hacktron.ai/api-reference/pentests/create-pentest.md)
- [On-premises deployment](https://docs.hacktron.ai/platform/on-premises.md)
- [Quickstart](https://docs.hacktron.ai/white-box-pentest/quickstart.md)
- [Changelog](https://docs.hacktron.ai/changelog.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.