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

# Create Artifact Upload Intent

> Create upload targets for an experiment artifact.

Use this route to request upload targets before uploading an agent artifact.

Auth: Droyd API key or signed-in user bearer token. Alias:
`POST /api/v1/experiments/{id}/artifacts/upload-intents`. Use either a `file`
artifact with exactly one root `agent.py`, or a `folder` artifact with 1–500
unique normalized POSIX relative paths. Absolute paths, `..`, empty segments,
backslashes, and duplicate paths are rejected. `archive`, `endpoint`, and
`container_image` are not accepted by this hosted route. Optional `client_key`
makes identical retries safe for the authenticated account. Use every returned
upload instruction, then call artifact completion only after every byte is
uploaded.


## OpenAPI

````yaml api-key.openapi.json POST /v1/experiments/{id}/artifacts/upload-intents
openapi: 3.1.0
info:
  title: Droyd API-key Automation API
  version: 1.0.0
  description: >-
    The production API contract for Droyd API-key automations. It contains only
    operations that accept a Droyd API key. `/v1` is canonical; `/api/v1` is a
    compatibility alias.
servers: []
security:
  - droydApiKeyBearer: []
  - droydApiKeyHeader: []
tags:
  - name: Identity
    description: Account-scoped automation identity and onboarding state.
  - name: Workflows
    description: Caller-owned workflows and research nodes.
  - name: Competitions
    description: Competition readiness, submissions, and race entries.
  - name: Experiments
    description: Experiments, artifacts, agent versions, and evaluations.
  - name: Usage
    description: Caller-owned evaluation usage.
  - name: Billing
    description: Caller-owned prepaid credit balances and funding.
paths:
  /v1/experiments/{id}/artifacts/upload-intents:
    post:
      tags:
        - Experiments
      summary: Create a supported agent-artifact upload intent.
      operationId: createArtifactUploadIntent
      parameters:
        - $ref: '#/components/parameters/Id'
      requestBody:
        $ref: '#/components/requestBodies/ArtifactUploadIntent'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '201':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  requestBodies:
    ArtifactUploadIntent:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - artifact_kind
              - files
            properties:
              artifact_kind:
                type: string
              files:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - relative_path
                    - size_bytes
                  properties:
                    relative_path:
                      type: string
                    size_bytes:
                      type: integer
                      minimum: 0
                    sha256:
                      type: string
                    mime_type:
                      type: string
              client_key:
                type: string
              metadata:
                type: object
                additionalProperties: true
  responses:
    Success:
      description: Successful response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuccessEnvelope'
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: Account state or route policy prevents the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: The resource is missing or not owned by the API-key account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Conflict:
      description: The resource state or idempotency key conflicts with the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    ServerError:
      description: >-
        The request could not be completed. Retry only when the operation's
        idempotency contract permits it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  schemas:
    SuccessEnvelope:
      type: object
      required:
        - ok
      properties:
        ok:
          const: true
      additionalProperties: true
    ErrorEnvelope:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    droydApiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: Droyd API key
      description: A Droyd API key in the Authorization Bearer slot.
    droydApiKeyHeader:
      type: apiKey
      in: header
      name: x-droyd-api-key
      description: A Droyd API key when Authorization is absent.

````