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

# Stage data for write jobs

> Generates a presigned URL for uploading a JSON file to a connector's uploads directory. Upload the file to the returned URL, then trigger a write job to process it.

Instead of uploading your records in the POST job requests (which is subject to payload size limits), you can use this endpoint to stage records of arbitrary size.

After generating your presigned url, you can upload json records:

```bash theme={null}
# Upload your data
curl --request PUT \
  --url "$PRESIGNED_URL" \
  --header 'Content-Type: application/json' \
  --data '{
  "Contacts": [
    {
      "email": "testemail@hg.io",
      "id": "5634",
      "name": "John Doe"
    },
    {
      "email": "testemailtwo@hg.io",
      "id": "6634",
      "name": "Jane Doe"
    }
  ]
}'

# Trigger a write job (no state body — the job reads the staged file)
curl --request POST \
  --url 'https://api.hotglue.com/v2/{env_id}/{flow_id}/{tenant}/jobs' \
  --header 'content-type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "connector_id": "hubspot",
  "job_type": "write",
}'
```


## OpenAPI

````yaml post /{env_id}/{flow}/{user_id}/connectors/api/uploads/url
openapi: 3.1.0
info:
  title: hotglue API
  version: '1.2'
servers:
  - url: https://api.hotglue.com
security:
  - sec0: []
paths:
  /{env_id}/{flow}/{user_id}/connectors/api/uploads/url:
    post:
      summary: Stage data for write jobs
      description: >-
        Generates a presigned URL for uploading a JSON file to a connector's
        uploads directory. Upload the file to the returned URL, then trigger a
        write job to process it.
      operationId: generate-connector-upload-url
      parameters:
        - name: env_id
          in: path
          description: ID of environment
          schema:
            type: string
          required: true
        - name: flow
          in: path
          description: ID of flow
          schema:
            type: string
          required: true
        - name: user_id
          in: path
          description: ID of tenant
          schema:
            type: string
          required: true
        - name: connector_id
          in: path
          description: ID of connector
          schema:
            type: string
            example: api
          required: true
      responses:
        '200':
          description: Presigned upload URL generated
          content:
            application/json:
              examples:
                Result:
                  value:
                    presigned_url: >-
                      https://s3.amazonaws.com/example-bucket/example-key?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...
              schema:
                type: object
                required:
                  - presigned_url
                properties:
                  presigned_url:
                    type: string
                    format: uri
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value:
                    Code: BadRequestError
                    Message: Connector api is not linked to flow customer-sync
              schema:
                type: object
                properties:
                  Code:
                    type: string
                    example: BadRequestError
                  Message:
                    type: string
                    example: Connector api is not linked to flow customer-sync
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: x-api-key

````