logo
Development
Search
Delete metadata fields

Delete metadata fields

Delete metadata fields in batches by ID. Predefined system fields cannot be deleted. You can delete up to 50 fields per request. Pass ids as a comma-separated URL query parameter, not in the request body.

Request Method

DELETE

Endpoint

https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/delete

Authentication

For authentication details, see API Overview.

Request

Request Example

curl -X DELETE 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/delete?ids=665f1c8a9b2e4d001a3f0001,665f1c8a9b2e4d001a3f0002' \ -H 'Authorization: Bearer ${API Key}'
                      
                      curl -X DELETE 'https://api-${endpoint}.gptbots.ai/v1/bot/doc/metadata/field/delete?ids=665f1c8a9b2e4d001a3f0001,665f1c8a9b2e4d001a3f0002' \
-H 'Authorization: Bearer ${API Key}'

                    
This code block in the floating window

Request Headers

Field Type Description
Authorization Bearer ${API Key} Authenticate with Authorization: Bearer ${API Key}. Obtain the API Key from the API Keys page.

Request Parameters

Field Type Required Description
ids String Yes Comma-separated field IDs, up to 50 per request.

Response

Response Example

{ "success_count": 1, "failure_count": 2, "results": [ { "id": "665f1c8a9b2e4d001a3f0001", "success": true }, { "id": "665f1c8a9b2e4d001a3f0003", "success": false, "error_message": "field not found" }, { "id": "665f1c8a9b2e4d001a3f0004", "success": false, "error_message": "predefined field cannot be deleted" } ] }
                      
                      {
    "success_count": 1,
    "failure_count": 2,
    "results": [
        {
            "id": "665f1c8a9b2e4d001a3f0001",
            "success": true
        },
        {
            "id": "665f1c8a9b2e4d001a3f0003",
            "success": false,
            "error_message": "field not found"
        },
        {
            "id": "665f1c8a9b2e4d001a3f0004",
            "success": false,
            "error_message": "predefined field cannot be deleted"
        }
    ]
}

                    
This code block in the floating window

Success Response

Field Type Description
success_count Integer Number of successfully deleted fields.
failure_count Integer Number of fields that failed to be deleted.
results Array<Object> Result for each requested ID.
id String Field ID.
success Boolean Whether the deletion was successful.
error_message String Failure reason: field not found (field does not exist) / predefined field cannot be deleted (preset fields cannot be deleted).

Error Response

Field Type Description
code Integer Error code.
message String Error details.