PixAI Platform
API v2 DocumentationMedia

Register an uploaded image

Step 3 of uploading an image: turns the uploaded file into a media item. Call it after the PUT to uploadUrl has succeeded. The returned id is the media ID to pass to other endpoints.

POST
/media/image/register

Authorization

bearerAuth
AuthorizationBearer <token>

In all requests that require authentication

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.pixai.art/v2/media/image/register" \  -H "Content-Type: application/json" \  -d '{    "externalId": "3f2b8c1e-6a4d-4f6e-9b1a-2c7d5e8f9a01"  }'
{
  "id": "string",
  "type": "IMAGE",
  "urls": [
    {
      "variant": "PUBLIC",
      "url": "string"
    }
  ],
  "width": 0,
  "height": 0,
  "fileUrl": "string",
  "hlsUrl": "string",
  "thumbnailUrl": "string",
  "duration": 0
}
{
  "code": "string",
  "status": 0,
  "message": "string",
  "data": {},
  "defined": true
}