⚠️ Porta is in beta — APIs and features may change before v1.0
Skip to content

Branding Assets API

The branding API manages organization-level logo and favicon images. Assets are stored as PostgreSQL bytea for simple deployment.

Endpoints

MethodPathPermissionDescription
GET/api/admin/organizations/:orgId/brandingorg:readList branding assets
GET/api/admin/organizations/:orgId/branding/:typeorg:readGet asset (binary)
PUT/api/admin/organizations/:orgId/branding/:typeorg:updateUpload/replace asset
DELETE/api/admin/organizations/:orgId/branding/:typeorg:updateDelete asset

Asset Types

TypeDescription
logoOrganization logo (displayed in login pages, admin UI)
faviconBrowser favicon for the organization

Supported Formats

Content TypeDescription
image/pngPNG image
image/svg+xmlSVG vector image
image/x-iconICO favicon
image/vnd.microsoft.iconMicrosoft ICO format
image/jpegJPEG image
image/webpWebP image

Maximum file size: 512 KB

List Branding Assets

http
GET /api/admin/organizations/:orgId/branding
Authorization: Bearer <token>

Returns metadata only (no binary data):

json
{
  "data": [
    {
      "id": "uuid",
      "organizationId": "uuid",
      "assetType": "logo",
      "contentType": "image/png",
      "fileSize": 15234,
      "createdAt": "2026-01-15T10:00:00Z",
      "updatedAt": "2026-01-15T10:00:00Z"
    },
    {
      "id": "uuid",
      "organizationId": "uuid",
      "assetType": "favicon",
      "contentType": "image/x-icon",
      "fileSize": 4096,
      "createdAt": "2026-01-15T10:00:00Z",
      "updatedAt": "2026-01-15T10:00:00Z"
    }
  ]
}

Get Asset (Binary)

http
GET /api/admin/organizations/:orgId/branding/logo
Authorization: Bearer <token>

Returns the raw binary image data with appropriate Content-Type header and 1-hour cache control.

Upload Asset

http
PUT /api/admin/organizations/:orgId/branding/logo
Authorization: Bearer <token>
Content-Type: application/json

Request Body (JSON with base64)

json
{
  "data": "iVBORw0KGgoAAAANSUhEUg...",
  "contentType": "image/png"
}
FieldTypeRequiredDescription
datastringYesBase64-encoded image data
contentTypestringYesMIME type of the image

Response

json
{
  "data": {
    "id": "uuid",
    "organizationId": "uuid",
    "assetType": "logo",
    "contentType": "image/png",
    "fileSize": 15234,
    "createdAt": "2026-01-15T10:00:00Z",
    "updatedAt": "2026-01-15T10:00:00Z"
  }
}

If an asset of the same type already exists, it is replaced (upsert behavior).

Delete Asset

http
DELETE /api/admin/organizations/:orgId/branding/logo
Authorization: Bearer <token>

Returns 204 No Content on success, 404 if no asset of that type exists.

Released under the MIT License.