Image API

Interfaces to manage images


Images are used for storing and managing image assets in campaigns. You can upload images, retrieve them, and update their metadata.

ℹ️

V1 API Only

Image management is available in V1 API only.


Response Format

All image endpoints return a standardized response with success, data (or message), and request_id. Errors return:

json
{
"error": {
"type": "invalid_request_error",
"code": "missing_team_id",
"message": "TeamId is required",
"param": "TeamId",
"doc_url": "https://docs.supersend.io/docs/errors#missing_team_id"
},
"request_id": "req_a1b2c3d4e5f6789012345678"
}


List Images

Get all images for a team with pagination.

bash
curl -X GET 'https://api.supersend.io/v1/images?TeamId=team-uuid&limit=50&offset=0' \
-H "Authorization: Bearer YOUR_API_KEY"

# Response (200 OK)
{
"success": true,
"data": [
{
"id": "image-uuid",
"preview": "https://example.com/preview.jpg",
"url": "https://example.com/image.jpg",
"config": {},
"deleted": false,
"TeamId": "team-uuid",
"CampaignId": "campaign-uuid",
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-15T00:00:00Z"
}
],
"pagination": {
"total": 10,
"limit": 50,
"offset": 0,
"has_more": false
},
"request_id": "req_a1b2c3d4e5f6789012345678"
}

Query Parameters:

ParameterTypeRequiredDescription
TeamIdstringYesTeam ID
CampaignIdstringNoFilter by campaign ID
limitnumberNoResults per page
offsetnumberNoPagination offset


Note: Only returns non-deleted images (deleted: false). Results are ordered by createdAt descending.


Create Image

Create a new image record.

bash
curl -X POST 'https://api.supersend.io/v1/image' \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"preview": "https://example.com/preview.jpg",
"url": "https://example.com/image.jpg",
"config": {
"width": 800,
"height": 600
},
"TeamId": "team-uuid",
"CampaignId": "campaign-uuid"
}'

# Response (201 Created)
{
"success": true,
"data": {
"image": {
"id": "image-uuid",
"preview": "https://example.com/preview.jpg",
"url": "https://example.com/image.jpg",
"config": {
"width": 800,
"height": 600
},
"deleted": false,
"TeamId": "team-uuid",
"CampaignId": "campaign-uuid",
"OrgId": "org-uuid",
"UserId": "user-uuid",
"createdAt": "2025-01-01T00:00:00Z",
"updatedAt": "2025-01-01T00:00:00Z"
}
},
"request_id": "req_a1b2c3d4e5f6789012345678"
}

Request Parameters:

ParameterTypeRequiredDescription
previewstringNoPreview image URL
urlstringNoFull image URL
configobjectNoImage configuration/metadata (JSON object)
TeamIdstringNoTeam ID
CampaignIdstringNoCampaign ID


Note:

  • OrgId and UserId are automatically set from the authenticated user

  • At least one of preview or url should be provided

  • Update Image

    Update an image's metadata.

    bash
    curl -X PUT 'https://api.supersend.io/v1/image/image-uuid' \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "preview": "https://example.com/new-preview.jpg",
    "url": "https://example.com/new-image.jpg",
    "config": {
    "width": 1200,
    "height": 900
    },
    "TeamId": "team-uuid"
    }'

    # Response (200 OK)
    {
    "success": true,
    "data": {
    "image": {
    "id": "image-uuid",
    "preview": "https://example.com/new-preview.jpg",
    "url": "https://example.com/new-image.jpg",
    "config": {
    "width": 1200,
    "height": 900
    },
    ...
    }
    },
    "request_id": "req_a1b2c3d4e5f6789012345678"
    }

    Request Parameters:

    ParameterTypeRequiredDescription
    previewstringNoPreview image URL
    urlstringNoFull image URL
    configobjectNoImage configuration/metadata (JSON object)
    TeamIdstringYesTeam ID (for authorization)


    Note:

  • User must belong to the team

  • OrgId is automatically updated from authenticated user

  • Image must exist and belong to the specified team

  • Upload Files

    Upload files (including images) to S3 storage.

    bash
    curl -X POST 'https://api.supersend.io/v1/upload/file?TeamId=team-uuid&folder=images' \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "files=@image1.jpg" \
    -F "files=@image2.png"

    # Response (200 OK)
    {
    "success": true,
    "files": [
    {
    "originalName": "image1.jpg",
    "url": "https://bucket.s3.amazonaws.com/images/team-uuid/filename.jpg",
    "mimeType": "image/jpeg",
    "size": 123456
    },
    {
    "originalName": "image2.png",
    "url": "https://bucket.s3.amazonaws.com/images/team-uuid/filename2.png",
    "mimeType": "image/png",
    "size": 234567
    }
    ]
    }

    Query Parameters:

    ParameterTypeRequiredDescription
    TeamIdstringYesTeam ID
    folderstringNoS3 folder path (default: general)


    Form Data:

  • files: One or more files (multipart/form-data)

  • Maximum 10 files per request

  • Maximum file size: 25MB per file
  • Note:

  • Files are uploaded to S3 and made publicly accessible

  • URLs are properly encoded to handle spaces and special characters

  • Temporary files are automatically cleaned up after upload