Skip to content

Resources ​

Create Resource ​

http
POST /api/model-resources
FieldTypeRequiredDescription
namestringYesResource name
descriptionstringNoResource description
resourceTypeint否Resource type, 1:Image,2:Video,3:Audio, default: 1
group_idintNoResource group ID
urlstringYesResource URL
bash
curl --location 'https://neolink.com/api/api/model-resources' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "product-demo.png",
    "description": "Zhang San",
    "group_id": 8,
    "url": "https://example.com/product-demo.png"
  }'

Response:

json
{
  "success": true,
  "message": "",
  "data": {
    "uuid": "tkres_b6b6fbfcd79940ecb4d24afee99a4ca9",
    "group_id": 8,
    "name": "product-demo.png",
    "description": "Zhang San",
    "busi_type": 1,
    "url": "https://example.com/product-demo.png",
    "status": 2,
    "message": "",
    "created_at": 1779332818,
    "updated_at": 1779332818,
    "deleted_at": null
  }
}

Status Notes:

  • Initial status after creation is 2 Processing.
  • After successful sync, status changes to 1 Available.
  • After sync failure, status changes to 3 Failed, with the failure reason in message.

Query Resource List ​

http
GET /api/model-resources
FieldTypeRequiredDescription
pintNoPage number, default 1
page_sizeintNoItems per page
group_idintNoFilter by resource group
statusintNoFilter by resource status
keywordstringNoSearch by name, description, or UUID
created_startint64NoCreation start timestamp
created_endint64NoCreation end timestamp
bash
curl --location 'https://neolink.com/api/api/model-resources?p=1&page_size=20&group_id=8' \
  --header 'Authorization: Bearer <api-key>'

Response:

json
{
  "success": true,
  "message": "",
  "data": {
    "page": 1,
    "page_size": 20,
    "total": 1,
    "items": [
      {
        "uuid": "tkres_b6b6fbfcd79940ecb4d24afee99a4ca9",
        "group_id": 8,
        "name": "product-demo.png",
        "description": "Zhang San",
        "busi_type": 1,
        "url": "https://example.com/product-demo.png",
        "status": 1,
        "message": "",
        "created_at": 1779332818,
        "updated_at": 1779332818,
        "deleted_at": null
      }
    ]
  }
}

Query Resource Details ​

http
GET /api/model-resources/{uuid}
bash
curl --location 'https://neolink.com/api/api/model-resources/tkres_b6b6fbfcd79940ecb4d24afee99a4ca9' \
  --header 'Authorization: Bearer <api-key>'

Response fields are the same as a single resource in the resource list.

Update Resource ​

http
PATCH /api/model-resources/{uuid}
PUT /api/model-resources/{uuid}

Only name, description, and group can be updated.

FieldTypeRequiredDescription
namestringNoNew resource name
descriptionstringNoNew description
group_idintNoNew group ID
bash
curl --location --request PATCH 'https://neolink.com/api/api/model-resources/tkres_b6b6fbfcd79940ecb4d24afee99a4ca9' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "product-demo-v2.png",
    "description": "New description"
  }'