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

# Get Upload URL

> Generate a pre-signed URL for secure media upload. This endpoint provides direct access to upload URLs for service request images.

**Example workflow:**
```bash
# Step 1: Get pre-signed URL (with required sr and side parameters)
curl --location 'https://asset.legitmark.com/intent?sr=22077e95-b403-41bc-9c9d-ee0243a98fc7&side=3c14e504-8134-11ef-9e85-02d0d7ecc26b.jpg'

# Step 2: Upload to returned URL
curl -X PUT 'RETURNED_PRESIGNED_URL' \
  -H 'Content-Type: image/jpeg' \
  --data-binary '@image.jpg'
```

## Supported File Types

| Extension        | MIME Type         |
| ---------------- | ----------------- |
| `.jpg` / `.jpeg` | image/jpeg        |
| `.png`           | image/png         |
| `.heic`          | image/heic        |
| `.dng`           | image/x-adobe-dng |

<Note>The `side` parameter must include a file extension (e.g. `side-uuid.jpg`). Requests without an extension return 400.</Note>


## OpenAPI

````yaml /openapi.json get /intent
openapi: 3.1.0
info:
  title: Legitmark Partner API
  description: Comprehensive partner integration API for Legitmark authentication platform
  version: 2.0.0
  contact:
    name: Legitmark Support
    email: support@legitmark.com
    url: https://legitmark.com
servers:
  - url: https://api.legitmark.com
    description: Production API
security:
  - BearerAuth: []
tags:
  - name: Service Requests
    description: Create, retrieve, and manage authentication service requests.
  - name: Media Management
    description: Upload images for service request authentication.
  - name: Taxonomy
    description: Browse categories, types, brands, models, and services to build requests.
paths:
  /intent:
    servers:
      - url: https://asset.legitmark.com
        description: Asset Service API
    get:
      tags:
        - Media Management
      summary: Get Upload URL
      description: >-
        Generate a pre-signed URL for secure media upload. This endpoint
        provides direct access to upload URLs for service request images.


        **Example workflow:**

        ```bash

        # Step 1: Get pre-signed URL (with required sr and side parameters)

        curl --location
        'https://asset.legitmark.com/intent?sr=22077e95-b403-41bc-9c9d-ee0243a98fc7&side=3c14e504-8134-11ef-9e85-02d0d7ecc26b.jpg'


        # Step 2: Upload to returned URL

        curl -X PUT 'RETURNED_PRESIGNED_URL' \
          -H 'Content-Type: image/jpeg' \
          --data-binary '@image.jpg'
        ```
      operationId: createUploadIntent
      parameters:
        - name: sr
          in: query
          required: true
          schema:
            type: string
            format: uuid
          description: Service request UUID
          example: 8e61c991-553a-4a58-9eb6-561b64c11908
        - name: side
          in: query
          required: true
          schema:
            type: string
          description: >-
            Side UUID with file extension appended (e.g., `{side_uuid}.jpg`).
            The file extension determines the upload content type. Allowed
            extensions: jpg, jpeg, png, heic, dng
          example: ec883c70-f896-47c9-81b6-8d6ff0b5856a.jpg
      responses:
        '200':
          description: Pre-signed URL generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Pre-signed URL generated successfully.
                  url:
                    type: string
                    format: uri
                    description: Pre-signed URL for upload
                required:
                  - message
                  - url
              example:
                message: Pre-signed URL generated successfully.
                url: >-
                  https://s3.us-east-1.amazonaws.com/cdn.legitmark.com/sr/8e61c991-553a-4a58-9eb6-561b64c11908/ec883c70-f896-47c9-81b6-8d6ff0b5856a.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Expires=300&X-Amz-Signature=...
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: |-
            import { Legitmark } from 'legitmark';

            const legitmark = new Legitmark('leo_your_api_key');

            // The SDK handles intent + upload in one call
            await legitmark.images.uploadForSide(
              '8e61c991-553a-4a58-9eb6-561b64c11908',
              'ec883c70-f896-47c9-81b6-8d6ff0b5856a',
              './interior-size-tag.jpg'
            );
        - lang: javascript
          label: JavaScript
          source: |-
            // Step 1: Get presigned upload URL
            const intentRes = await fetch(
              'https://asset.legitmark.com/intent?sr=8e61c991-553a-4a58-9eb6-561b64c11908&side=ec883c70-f896-47c9-81b6-8d6ff0b5856a.jpg'
            );
            const { url } = await intentRes.json();

            // Step 2: Upload image directly to S3
            await fetch(url, {
              method: 'PUT',
              body: imageFile,
              headers: { 'Content-Type': 'image/jpeg' },
            });
        - lang: curl
          label: cURL
          source: >-
            # Get presigned URL

            curl
            'https://asset.legitmark.com/intent?sr=8e61c991-553a-4a58-9eb6-561b64c11908&side=ec883c70-f896-47c9-81b6-8d6ff0b5856a.jpg'


            # Upload image to the returned presigned URL

            curl -X PUT 'PRESIGNED_URL_FROM_ABOVE' \
              -H 'Content-Type: image/jpeg' \
              --data-binary @interior-size-tag.jpg
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
            timestamp:
              type: string
              format: date-time
            message:
              type: string
            details:
              type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication. Use your API key in the format: Bearer
        leo_xxxxxxxx
      x-default: leo_your_api_key_here

````