Code Containers

Update a Code Container

Updates a code container in the authenticated user's account.

put/code_containers/{code_container_id}

Request

Path parameters

code_container_idinteger required

The unique ID of the container that needs to be updated.

Headers

Accept'application/vnd.nexla.api.v1+json' | 'application/json'

Setting to application/vnd.nexla.api.v1+json is recommended.

Request body

namestring required
descriptionstring
data_credentials_idinteger

Credential ID for accessing the code repository (e.g., Github). This is for code containers in which the code is saved in a remote repository.

Note that this is not required for script connectors in which the script is hosted in a Nexla Github repository.

resource_type'transform' | 'ai_function' | 'source' | 'sink' | 'error' | 'validator'

The type of resource that this code container is to be used for.

  • transform: For user defined code that is used in a Nexset transform.
  • ai_function: For user defined code that is used in an AI function. See ai_function_type for the scenarios where this is used.
  • source: For user defined code in a source.
  • sink: For user defined code in a sink.
  • error: For user defined code that acts as an error handler.
  • validator: For user defined code that acts as a validator.
ai_function_type'chunker' | 'context_enricher' | 'query_rewriter' | 'reranker'

The type of AI function that this code container is used for.

  • chunker: Used to chunk parsed file content into smaller chunks in a Document Ingestion flow.
  • context_enricher: Used to enrich the context of a query in a RAG flow.
  • query_rewriter: Used to rewrite a query in a RAG flow.
  • reranker: Used to rerank a list of results in a RAG flow.
output_type'record' | 'attribute' | 'custom' required

The type of output that this code container produces.

  • record: Produces a full Nexset record. Used only when the code container is used to modify a Nexset, i.e output_type: transform
  • attribute: Produces value for an attribute inside a Nexset record. Used only when the code container is used to modify a value inside a Nexset, i.e output_type: transform
  • custom: Produces custom output. Used as a catch-all output format when a code container is used in any context other than for Nexset modification.
code_type'jolt_standard' | 'jolt_custom' | 'python' | 'python3' | 'javascript' required
code_encoding'none' | 'base64' required

Whether or not the code in the code block is encoded. Set this to none for reusable record transforms.

reusableboolean required

Whether or not this transform can be referenced by multiple resources. This should always be true for reusable record and attribute transforms.

tagsstring[]
custom_configobject

Example request

{
  "name": "test",
  "description": "test",
  "code": [
    {
      "operation": "nexla.custom",
      "spec": {
        "language": "python",
        "encoding": "base64"
      }
    }
  ]
}

Response

Success

idinteger
namestring
resource_type'transform' | 'ai_function' | 'source' | 'sink' | 'error' | 'validator'

The type of resource that this code container is to be used for.

  • transform: For user defined code that is used in a Nexset transform.
  • ai_function: For user defined code that is used in an AI function. See ai_function_type for the scenarios where this is used.
  • source: For user defined code in a source.
  • sink: For user defined code in a sink.
  • error: For user defined code that acts as an error handler.
  • validator: For user defined code that acts as a validator.
ai_function_type'chunker' | 'context_enricher' | 'query_rewriter' | 'reranker'

The type of AI function that this code container is used for.

  • chunker: Used to chunk parsed file content into smaller chunks in a Document Ingestion flow.
  • context_enricher: Used to enrich the context of a query in a RAG flow.
  • query_rewriter: Used to rewrite a query in a RAG flow.
  • reranker: Used to rerank a list of results in a RAG flow.
reusableboolean
publicboolean
access_rolesstring[]

This property reflects all the permissions the user/team/organization has to this resource.

  1. collaborator: The user/team/organization can view the resource but not make any modifications to it.
  2. operator: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it.
  3. administrator: The user/team/organization has complete administrative rights to this resource.
  4. owner: This user created the resource and so has complete administrative rights to it.
descriptionstring
code_type'jolt_standard' | 'jolt_custom' | 'python' | 'python3' | 'javascript'
output_type'record' | 'attribute' | 'custom'

The type of output that this code container produces.

  • record: Produces a full Nexset record. Used only when the code container is used to modify a Nexset, i.e output_type: transform
  • attribute: Produces value for an attribute inside a Nexset record. Used only when the code container is used to modify a value inside a Nexset, i.e output_type: transform
  • custom: Produces custom output. Used as a catch-all output format when a code container is used in any context other than for Nexset modification.
code_configobject
custom_configobject
code_encodingstring
managedboolean
data_setsinteger[]
copied_from_idinteger
updated_atstring date-time
created_atstring date-time
tagsstring[]

Example response

{
  "id": 1,
  "name": "test",
  "description": "test",
  "code_encoding": "none",
  "code": [
    {
      "operation": "nexla.custom",
      "spec": {
        "language": "python",
        "encoding": "base64",
        "script": "ZGVmIHRyYW5zZm9ybShpbnB1dCwgbWV0YWRhdGEsIGFyZ3MpOgogICMgU2FtcGxlIHB5dGhvbiB0cmFuc2Zvcm0gdG8gcGFzcyBhbGwgYXR0cmlidXRlcyB0aHJvdWdoCiAgcmV0dXJuIGlucHV0"
      }
    }
  ],
  "updated_at": "2023-01-24T03:26:43.000Z",
  "created_at": "2023-01-24T03:26:43.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.