Assets

The Assets API allows you to manage your digital assets on the IPTO platform. This guide covers creating, listing, and managing your assets.

Create Asset

Upload a new asset to the platform. The file will be processed and stored securely.

curl -X POST https://api.ipto.ai/assets \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -F "file=@/path/to/your/file" \
  -F "name=My Asset Name" \
  -F "description=Detailed description of the asset" \
  -F "is_public=false"

Request Parameters

ParameterTypeRequiredDescription
fileFileYesThe asset file to upload
nameStringYesName of the asset (3-100 characters)
descriptionStringNoDetailed description (10-500 characters)
is_publicBooleanNoWhether the asset is publicly visible (default: false)

Response

{
  "name": "My Asset Name",
  "description": "Detailed description of the asset",
  "file_url": "https://storage.ipto.ai/assets/123456789",
  "metadata": {
    "file_name": "original_filename.ext",
    "file_size": 1024000,
    "file_type": "ext",
    "mime_type": "application/octet-stream",
    "created_at": "2024-03-21T10:00:00Z",
    "last_modified": "2024-03-21T10:00:00Z"
  },
  "created_at": "2024-03-21T10:00:00Z",
  "owner_id": "user_123",
  "is_public": false
}

List User Assets

Retrieve a paginated list of assets owned by the authenticated user.

curl -X GET "https://api.ipto.ai/assets?page=1&limit=10" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Query Parameters

ParameterTypeRequiredDefaultDescription
pageIntegerNo1Page number for pagination
limitIntegerNo10Number of items per page

Response

[
  {
    "name": "Asset 1",
    "description": "Description 1",
    "file_url": "https://storage.ipto.ai/assets/123",
    "metadata": {
      "file_name": "asset1.ext",
      "file_size": 1024000,
      "file_type": "ext",
      "mime_type": "application/octet-stream",
      "created_at": "2024-03-21T10:00:00Z",
      "last_modified": "2024-03-21T10:00:00Z"
    },
    "created_at": "2024-03-21T10:00:00Z",
    "owner_id": "user_123",
    "is_public": false
  },
  // ... more assets
]

Supported File Types

The platform supports various file types for different asset categories:

CategorySupported File Types
Code.zip, .tar.gz, .py, .js, .java, etc.
Design.psd, .ai, .sketch, .fig, etc.
Document.pdf, .doc, .docx, .txt, etc.
Audio.mp3, .wav, .aac, etc.
Video.mp4, .mov, .avi, etc.
Image.jpg, .png, .gif, etc.
Dataset.csv, .json, .xlsx, etc.

File Size Limits

  • Maximum file size: 2GB
  • Recommended file size: < 500MB for optimal processing

Error Responses

Invalid File Type

{
  "detail": "Unsupported file type"
}

File Too Large

{
  "detail": "File size exceeds maximum limit of 2GB"
}

Invalid Asset Name

{
  "detail": "Asset name must be between 3 and 100 characters"
}

Best Practices

  1. Use descriptive names and detailed descriptions
  2. Choose appropriate file formats for your asset type
  3. Compress large files before uploading
  4. Set appropriate visibility with is_public
  5. Keep track of your asset IDs for future reference