Launch Week 02 wrapped — explore all five launches

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.

GET/v2/transformers/{transformerId}
curl -X GET "https://api.confident-ai.com/v2/transformers/{transformerId}" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • transformerIdstringRequired

    The id of the transformer.

Response

Get Transformer succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    Code 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
    • idstring

      The id of the transformer, generated by Confident AI.

    • namestring

      The name of the transformer.

    • descriptionstring | null

      What the transformer extracts.

    • createdAtstring

      The timestamp when the transformer was created.

    • updatedAtstring

      The timestamp when the transformer was last updated.

    • codeDefinitionobject | null

      The code a transformer runs, with the language it is written in.

      Show 2 propertiesHide 2 properties
      • codestring

        The source of the transformer. It defines a transform function that takes the value being transformed and returns the value to use in its place.

      • languageenum

        The language a transformer's code is written in.

        Show 1 enum valueHide 1 enum value
        • PYTHON
  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI