Get Transformer
GEThttps://api.confident-ai.com/v2/transformers/{transformerId}
Retrieves a transformer by id, including the code it runs. A transformer saved without code returns codeDefinition as null.
curl -X GET "https://api.confident-ai.com/v2/transformers/{transformerId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"success": true,
"data": {
"id": "<TRANSFORMER-ID>",
"name": "Extract nested answer",
"description": "Pulls the answer out of a nested envelope.",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-20T08:15:00.000Z",
"codeDefinition": {
"code": "def transform(input_data):\n return input_data[\"data\"][\"answer\"]",
"language": "PYTHON"
}
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
transformerIdstringRequiredThe id of the transformer.
Response
Get Transformer succeeded.
successbooleanIndicates if the request was successful.
dataobjectCode that reshapes a value on its way into or out of an evaluation, such as extracting the answer from your endpoint's response.
Show 6 propertiesHide 6 properties
idstringThe id of the transformer, generated by Confident AI.
namestringThe name of the transformer.
descriptionstring | nullWhat the transformer extracts.
createdAtstringThe timestamp when the transformer was created.
updatedAtstringThe timestamp when the transformer was last updated.
codeDefinitionobject | nullThe code a transformer runs, with the language it is written in.
Show 2 propertiesHide 2 properties
codestringThe source of the transformer. It defines a
transformfunction that takes the value being transformed and returns the value to use in its place.languageenumThe language a transformer's code is written in.
Show 1 enum valueHide 1 enum value
PYTHON
deprecatedbooleanIndicates if this endpoint is deprecated.