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
Parameter | Type | Required | Description |
---|---|---|---|
file | File | Yes | The asset file to upload |
name | String | Yes | Name of the asset (3-100 characters) |
description | String | No | Detailed description (10-500 characters) |
is_public | Boolean | No | Whether 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
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
page | Integer | No | 1 | Page number for pagination |
limit | Integer | No | 10 | Number 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:
Category | Supported 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
- Use descriptive names and detailed descriptions
- Choose appropriate file formats for your asset type
- Compress large files before uploading
- Set appropriate visibility with
is_public
- Keep track of your asset IDs for future reference