Skip to content

Docs

POST /list_media

https://heyeveryone.ai/api/v1/list_media

Operation

{
  "post": {
    "description": "List the workspace's media library, newest first: images and finished videos with their status (uploading, processing, ready, failed), dimensions, duration, alt text, public URL, cover frames, and fitsPlatforms (the platforms whose formats take the file as is, from the capability matrix). Filter by kind, status, a platform the file must fit (fitsPlatform) or a file-name search (query); page with nextCursor as cursor. Pass `mediaAssetId` for one asset in full: poll it after an upload until status is 'ready' or 'failed'; it adds probe data, `fit` for every platform and format (which checks fail and why), `usedIn` (drafts and posts, with their state) and `deletable` (false while a post that will still go out uses it).",
    "operationId": "list_media",
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "workspaceId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "image",
                  "video"
                ],
                "type": "string"
              },
              "status": {
                "enum": [
                  "uploading",
                  "processing",
                  "ready",
                  "failed"
                ],
                "type": "string"
              },
              "fitsPlatform": {
                "enum": [
                  "x",
                  "linkedin",
                  "threads",
                  "bluesky",
                  "instagram",
                  "facebook",
                  "tiktok",
                  "youtube",
                  "sandbox"
                ],
                "type": "string"
              },
              "query": {
                "maxLength": 200,
                "type": "string"
              },
              "limit": {
                "default": 60,
                "maximum": 200,
                "minimum": 1,
                "type": "integer"
              },
              "cursor": {
                "maxLength": 200,
                "type": "string"
              },
              "mediaAssetId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              }
            },
            "required": [
              "workspaceId"
            ],
            "type": "object"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "additionalProperties": false,
              "properties": {
                "mediaAssets": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                        "type": "string"
                      },
                      "workspaceId": {
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                        "type": "string"
                      },
                      "kind": {
                        "enum": [
                          "image",
                          "video"
                        ],
                        "type": "string"
                      },
                      "status": {
                        "enum": [
                          "uploading",
                          "processing",
                          "ready",
                          "failed"
                        ],
                        "type": "string"
                      },
                      "storageProvider": {
                        "enum": [
                          "supabase",
                          "r2"
                        ],
                        "type": "string"
                      },
                      "storageBucket": {
                        "type": "string"
                      },
                      "storageKey": {
                        "type": "string"
                      },
                      "publicUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "filename": {
                        "type": "string"
                      },
                      "mimeType": {
                        "type": "string"
                      },
                      "sizeBytes": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "width": {
                        "anyOf": [
                          {
                            "maximum": 9007199254740991,
                            "minimum": -9007199254740991,
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "height": {
                        "anyOf": [
                          {
                            "maximum": 9007199254740991,
                            "minimum": -9007199254740991,
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "durationMs": {
                        "anyOf": [
                          {
                            "maximum": 9007199254740991,
                            "minimum": -9007199254740991,
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "probe": {
                        "additionalProperties": {},
                        "propertyNames": {
                          "type": "string"
                        },
                        "type": "object"
                      },
                      "probeError": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "covers": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "storageKey": {
                              "type": "string"
                            },
                            "width": {
                              "maximum": 9007199254740991,
                              "minimum": -9007199254740991,
                              "type": "integer"
                            },
                            "height": {
                              "maximum": 9007199254740991,
                              "minimum": -9007199254740991,
                              "type": "integer"
                            },
                            "atMs": {
                              "maximum": 9007199254740991,
                              "minimum": 0,
                              "type": "integer"
                            }
                          },
                          "required": [
                            "storageKey",
                            "width",
                            "height",
                            "atMs"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "altText": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdByAccountId": {
                        "anyOf": [
                          {
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdByAgentClientId": {
                        "anyOf": [
                          {
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                        "type": "string"
                      },
                      "updatedAt": {
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                        "type": "string"
                      },
                      "previewUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "coverFrames": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "atMs": {
                              "maximum": 9007199254740991,
                              "minimum": 0,
                              "type": "integer"
                            },
                            "width": {
                              "maximum": 9007199254740991,
                              "minimum": -9007199254740991,
                              "type": "integer"
                            },
                            "height": {
                              "maximum": 9007199254740991,
                              "minimum": -9007199254740991,
                              "type": "integer"
                            },
                            "url": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "atMs",
                            "width",
                            "height",
                            "url"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "fitsPlatforms": {
                        "items": {
                          "enum": [
                            "x",
                            "linkedin",
                            "threads",
                            "bluesky",
                            "instagram",
                            "facebook",
                            "tiktok",
                            "youtube",
                            "sandbox"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "id",
                      "workspaceId",
                      "kind",
                      "status",
                      "storageProvider",
                      "storageBucket",
                      "storageKey",
                      "publicUrl",
                      "filename",
                      "mimeType",
                      "sizeBytes",
                      "width",
                      "height",
                      "durationMs",
                      "probe",
                      "probeError",
                      "covers",
                      "altText",
                      "createdByAccountId",
                      "createdByAgentClientId",
                      "createdAt",
                      "updatedAt",
                      "previewUrl",
                      "coverFrames",
                      "fitsPlatforms"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "nextCursor": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "storage": {
                  "additionalProperties": false,
                  "properties": {
                    "videos": {
                      "enum": [
                        "r2",
                        "supabase"
                      ],
                      "type": "string"
                    },
                    "videoStandIn": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "videos",
                    "videoStandIn"
                  ],
                  "type": "object"
                },
                "fit": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "platform": {
                        "enum": [
                          "x",
                          "linkedin",
                          "threads",
                          "bluesky",
                          "instagram",
                          "facebook",
                          "tiktok",
                          "youtube",
                          "sandbox"
                        ],
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "fits": {
                        "type": "boolean"
                      },
                      "summary": {
                        "type": "string"
                      },
                      "formats": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "format": {
                              "pattern": "^[a-z][a-z0-9_]*$",
                              "type": "string"
                            },
                            "label": {
                              "type": "string"
                            },
                            "fits": {
                              "type": "boolean"
                            },
                            "errors": {
                              "items": {
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "warnings": {
                              "items": {
                                "additionalProperties": false,
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            }
                          },
                          "required": [
                            "format",
                            "label",
                            "fits",
                            "errors",
                            "warnings"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "platform",
                      "label",
                      "fits",
                      "summary",
                      "formats"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "usedIn": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "pieceId": {
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                        "type": "string"
                      },
                      "pieceTitle": {
                        "type": "string"
                      },
                      "postId": {
                        "anyOf": [
                          {
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "channelAccountId": {
                        "anyOf": [
                          {
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "platform": {
                        "anyOf": [
                          {
                            "enum": [
                              "x",
                              "linkedin",
                              "threads",
                              "bluesky",
                              "instagram",
                              "facebook",
                              "tiktok",
                              "youtube",
                              "sandbox"
                            ],
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "state": {
                        "anyOf": [
                          {
                            "enum": [
                              "draft",
                              "ready",
                              "awaiting_confirmation",
                              "scheduled",
                              "publishing",
                              "published",
                              "failed_retrying",
                              "needs_attention",
                              "failed",
                              "manual",
                              "removed"
                            ],
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "scheduledAt": {
                        "anyOf": [
                          {
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "pieceId",
                      "pieceTitle",
                      "postId",
                      "channelAccountId",
                      "platform",
                      "state",
                      "scheduledAt"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "deletable": {
                  "type": "boolean"
                }
              },
              "required": [
                "mediaAssets",
                "nextCursor",
                "storage"
              ],
              "type": "object"
            }
          }
        },
        "description": "Success"
      },
      "400": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "invalid_input: the body does not match the schema"
      },
      "401": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "unauthenticated: missing, invalid, expired or revoked token"
      },
      "403": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "forbidden: the agent may not do this (for example, another workspace)"
      },
      "404": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "not_found"
      },
      "409": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "conflict"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      },
      "500": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "internal_error"
      }
    },
    "summary": "List media",
    "tags": [
      "workspace"
    ],
    "x-heyeveryone-kind": "query"
  }
}

Referenced definitions

{
  "schemas": {
    "Error": {
      "properties": {
        "error": {
          "description": "A stable error code, for example forbidden.",
          "type": "string"
        },
        "message": {
          "description": "What went wrong, in plain words.",
          "type": "string"
        }
      },
      "required": [
        "error",
        "message"
      ],
      "type": "object"
    }
  },
  "responses": {
    "RateLimited": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "rate_limited: too many requests from this agent, account or address (docs/setup/agents.md, Rate limits); wait the Retry-After seconds, then retry",
      "headers": {
        "Retry-After": {
          "description": "Seconds to wait before retrying.",
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    }
  }
}

Authentication

{
  "bearer": {
    "description": "Personal access token (hey_pat_...)",
    "scheme": "bearer",
    "type": "http"
  },
  "oauth": {
    "flows": {
      "authorizationCode": {
        "authorizationUrl": "https://heyeveryone.ai/oauth/authorize",
        "refreshUrl": "https://heyeveryone.ai/oauth/token",
        "scopes": {
          "agent": "Act as your agent in the workspaces you choose"
        },
        "tokenUrl": "https://heyeveryone.ai/oauth/token"
      }
    },
    "type": "oauth2"
  }
}

Security requirements

[
  {
    "bearer": []
  },
  {
    "oauth": [
      "agent"
    ]
  }
]