Skip to main content
Back to API List The API imports a model in chunks into the Agent Platform environment. The import process includes the following steps and APIs: Where can I find the API key? To use the API, you will need an API key. Learn more.

Start Import Session

The Import Model - Start Session API is executed in this step. The API initializes the import session and returns a Session Id in the response which is used in the next two steps of the import process.
MethodPOST
Endpointhttps://{host}/api/public/files/session/start
Content Typeapplication/json
AuthorizationX-api-key - The API key used for authentication.

Path Parameters

PARAMETERDESCRIPTIONTYPEREQUIRED/OPTIONAL
hostThe environment URL. For example, https://agent-platform.domain.ai/StringRequired

Sample Request

curl --location 'https://{host}/api/public/files/session/start' 
--header 'x-api-key: kg-1xxxxxx8-3xxf-5xxa-9xx7-0xxxxxxxxxx2-c9xxxxx8-6xx7-4xx5-axx6-5c6aacd8xxxx' 
--header 'Content-Type: application/json' 
--data '{
    "fileContext": "model",
    "totalChunks": 1,
    "fileExtension": "tar",
    "fileName": "sample-1.tar",
    "fileSize": 1100,
    "isAdapter": false
}'

Body Parameters

PARAMETERDESCRIPTIONTYPEREQUIRED/OPTIONAL
fileContextContext of the file (for example, model/dataset).StringRequired
totalChunksThe number of chunks the file is divided into.IntegerRequired
fileExtensionThe extension of the file (for example, tar).StringRequired
fileNameName of the file being uploaded. For example, example_model22.tarStringRequired
fileSizeThe size of the file in bytes.IntegerRequired
isAdapterIndicates whether the file is an adapter model. The values include “True” or “False.”BooleanOptional

Sample Response

{
   "sessionId": "dxxxxxx0-0xx2-4xx2-9xxd-5xxxxxxxxxx8",
   "expirationDate": "2025-02-05T11:58:03.638Z",
   "modelId": "cm-3xxxxxx6-axx6-5xx2-9xx6-0xxxxxxxxxx9"
}

Response Parameters

PARAMETERDESCRIPTIONTYPE
sessionIdThe unique identifier of the import session.String
expirationDateThe expiration date of the session.Date
modelIdThe unique identifier of the model.String

Upload Model in Chunks

The Import Model - Chunk Upload API uploads a file chunk for model import. The sessionId from the Start Import Session API must be used here to upload the file in incrementing chunks identified by a unique chunkNumber.
MethodPOST
Endpointhttps://{host}/api/public/files/session/{sessionId}
Content Typeapplication/json
AuthorizationX-api-key - The API key used for authentication.

Path Parameters

PARAMETERDESCRIPTIONTYPEREQUIRED/OPTIONAL
hostThe environment URL. For example, https://agent-platform.domain.ai/StringRequired
sessionIdThe Session Id from the start import session API.StringRequired

Sample Request

curl --location 'https://{host}/api/public/files/session/5cxxxxxb-5xx5-4xxa-bxx1-35xxxxxxxxxe' 
--header 'x-api-key: kg-11xxxxx8-3xxf-5xxa-9xx7-0xxxxxxxxxx2-c9xxxxx8-6xx7-4xx5-axx6-5c6aacdxxxx' 
--header 'Content-Type: application/json' 
--form 'file=@"postman-cloud:///1exxxxx8-7xx4-4xx0-axx0-1dxxxxxxxxxd"' 
--form 'chunkNumber="0"'

Body Parameters

PARAMETERDESCRIPTIONTYPEREQUIRED/OPTIONAL
fileThe file being uploaded.FileRequired
chunkNumberThe uploaded chunk number.NumberRequired

Sample Response

{
   "chunkNumber": "0",
   "sessionId": "dxxxxxx0-0xx2-4xx2-9xxd-51xxxxxxxxx8"
}

Response Parameters

PARAMETERDESCRIPTIONTYPE
chunkNumberThe uploaded chunk number.Number
sessionIdThe model import Session Id.String

Complete the Import Process

The Import Model- Complete API completes the model import process after all file chunks have been successfully uploaded. The sessionId from the Start Import Session API must be used for this API.
MethodPOST
Endpointhttps://{host}/api/public/files/session/{sessionId}/complete
Content Typeapplication/json
AuthorizationX-api-key - The API key used for authentication.

Path Parameters

PARAMETERDESCRIPTIONTYPEREQUIRED/OPTIONAL
hostThe environment URL. For example, https://agent-platform.domain.ai/StringRequired
sessionIdThe Session Id from the Start Import Session API.StringRequired

Sample Request

curl --location --request POST 'https://{host}/api/public/files/session/5cxxxxxb-xxx5-4xxa-bxx1-35xxxxxxxxxe/complete' 
--header 'x-api-key: kg-11xxxxx8-xxxf-5xxa-9xx7-07dxxxx3xxx2-c9xxxxx8-6xx7-4xx5-axx6-5c6aaxxxxxx'

Body Parameters

No parameters are passed.

Sample Response

{
  "dock-statusId": "ds-dxxxxxxd-bxx9-5xx0-8xx5-5bxxxxxxxxx1",
  "modelId": "cm-3xxxxxxa-bxx9-5xxf-axxc-73xxxxxxxxx2",
  "jobType": "MODELS",
  "action": "EXPORT",
  "status": "IN_PROGRESS"
}

Response Parameters

PARAMETERDESCRIPTIONTYPE
dockstatusIdThe unique identifier to track the status of model import.String
modelIdThe unique identifier of the model being imported.String
jobTypeType of job being performed, MODELString
actionThe action performed on the model.String
statusThe current status of the job (SUCCESS, IN_ PROGRESS, or FAILED).String