**API versions** · [V2 (Latest)](/integrations/v2/docs?lang=en) · **V1**

> **This API version is obsolete.** Use the latest version for new integrations. [View the current documentation](/integrations/v2/docs?lang=en)

# Uploads

OpenAPI 3.0.3 · API 1.0.0

```json
[
  {
    "url": "https://api.unisoft.world/integrations/v1",
    "description": "API"
  }
]
```

TRANSVERSE file hosting: upload a file ONCE (POST /uploads for any media, /uploads/image, /uploads/pdf) and get back a hosted filename + URL, to THEN place it where it belongs — a contact document, a campaign media, a page image. Mirrors the admin « upload first, place after » flow. Multipart only — an MCP/AI agent that cannot stream a binary passes an http(s) URL directly to the consuming endpoint (re-hosted server-side). Scope: `uploads:write` (a `messages:write` key is also accepted on the generic POST /uploads).

## Operations

## POST /uploads

Upload a media file (any type)

`create_upload`

Required scope: `uploads:write` (a `messages:write` key is ALSO accepted here for the campaign flow). Uploads an image/PDF/video (multipart/form-data) and returns its hosted filename + URL, to THEN reference it where it belongs (a contact document, a campaign media…). NOTE: multipart only — for an MCP/AI agent that cannot stream a binary, pass an http(s) `url` to the consuming endpoint instead (e.g. POST /contacts/{id}/documents), which re-hosts it server-side.

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "uploads:write",
  "additional": []
}
```

### Request body

```json
{
  "required": true,
  "content": {
    "multipart/form-data": {
      "schema": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary"
          }
        }
      }
    }
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "OK",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/UploadResult"
          }
        }
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "UNSUPPORTED_MEDIA_TYPE",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "example": "UNSUPPORTED_MEDIA_TYPE"
          }
        }
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "example": "INSUFFICIENT_SCOPE"
          }
        }
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-scope": "uploads:write",
  "x-unisoft-mcp": {
    "category": "create",
    "readOnly": false,
    "destructive": false,
    "idempotent": false,
    "warn": false
  }
}
```

## POST /uploads/image

Upload an image

`create_upload_image`

Required scope: `uploads:write`. Uploads an image only (image/*, ≤ 5mo, multipart/form-data) and returns its hosted filename + URL. Mirrors the admin image upload. Multipart only (see POST /uploads note for MCP/AI).

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "uploads:write",
  "additional": []
}
```

### Request body

```json
{
  "required": true,
  "content": {
    "multipart/form-data": {
      "schema": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary"
          }
        }
      }
    }
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "OK",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/UploadResult"
          }
        }
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "WRONG_MEDIA_FAMILY",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "example": "WRONG_MEDIA_FAMILY"
          }
        }
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "example": "INSUFFICIENT_SCOPE"
          }
        }
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-scope": "uploads:write",
  "x-unisoft-mcp": {
    "category": "create",
    "readOnly": false,
    "destructive": false,
    "idempotent": false,
    "warn": false
  }
}
```

## POST /uploads/pdf

Upload a PDF

`create_upload_pdf`

Required scope: `uploads:write`. Uploads a PDF only (application/pdf, ≤ 15mo, multipart/form-data) and returns its hosted filename + URL. Mirrors the admin document upload. Multipart only (see POST /uploads note for MCP/AI).

### Authentication

```json
[
  {
    "bearerAuth": []
  },
  {
    "apiKeyHeader": []
  }
]
```

### Required permissions

```json
{
  "accepted": "uploads:write",
  "additional": []
}
```

### Request body

```json
{
  "required": true,
  "content": {
    "multipart/form-data": {
      "schema": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary"
          }
        }
      }
    }
  }
}
```

### Responses

#### HTTP 200

```json
{
  "description": "OK",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/UploadResult"
          }
        }
      }
    }
  }
}
```

#### HTTP 400

```json
{
  "description": "WRONG_MEDIA_FAMILY",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "example": "WRONG_MEDIA_FAMILY"
          }
        }
      }
    }
  }
}
```

#### HTTP 403

```json
{
  "description": "INSUFFICIENT_SCOPE",
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "example": "INSUFFICIENT_SCOPE"
          }
        }
      }
    }
  }
}
```

### OpenAPI

```json
{
  "x-unisoft-scope": "uploads:write",
  "x-unisoft-mcp": {
    "category": "create",
    "readOnly": false,
    "destructive": false,
    "idempotent": false,
    "warn": false
  }
}
```

## Schemas

```json
{
  "components": {
    "schemas": {
      "UploadResult": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "description": "Hosted filename — put it in a campaign's docs[].doc / videos[].doc."
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "mimetype": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Format: `ke_live_xxx`"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  }
}
```
