---
title: "Create or update a computation specification"
method: PUT
path: "/computation-specs/{computationSpecId}"
tags: ["ComputationSpecs"]
---

# Create or update a computation specification

`PUT /computation-specs/{computationSpecId}`

Create or update a computation specification. The request must contain all the input and output data-type IDs which are used to define the computation specification. These data-types must have previously been created. As an example, a computation specification could be defined as a specification for a compute which takes two pieces of input data and calculates a single piece of output data. The specification for this compute would take two input data-types and output a single output data-type.

## Path parameters

- `computationSpecId` string, required

## Headers

- `slb-data-partition-id` string, required

## Request body

- ReplaceComputationSpec — Create or update computation specification request.
  - `id` string, required — The id of the specification. The id should be of the form '{authority}:{spec-type}:{id}', where '{authority}' is the owning authority of the specification, '{spec-type}' is one of 'data-types', 'computation-specs' or 'workflow-specs'.
  - `name` string, required — The name of the specification.
  - `version` integer, required — The version of the specification definition.
  - `archived` boolean — Whether this specification has been marked as archived.
  - `description` string, required — The description of the specification.
  - `inputDataTypeIds` VersionId[], required — The input data-type IDs for the computation specification.
    - `id` string, required — The specification ID.
    - `version` integer, required — The version of the specification of the given ID.
  - `outputDataTypeIds` VersionId[], required — The output data-type IDs for the computation specification.
    - `id` string, required — The specification ID.
    - `version` integer, required — The version of the specification of the given ID.
  - `annotations` Annotation[] — The annotations for the computation specification.
    - `address` SpecAddress — An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
      - `type` 'Invalid' | 'Computation' | 'DataTypeInput' | 'DataTypeOutput', required — Whether the address refers to a data-type input, a data-type output or a computation specification.
      - `computationIndex` integer — The zero based index of the Computation Spec.
      - `dataTypeIndex` integer — The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    - `key` string — Free form content with relevant information for the given address.
    - `value` string — Free form content with relevant information for the given address.
    - `createdBy` string — The user who created this annotation.

## Response `200`

Computation specification updated successfully.

- ComputationSpec — An evaluation computation specification. The specification details the input data-types to the computation specification and the computed output data-types.
  - `id` string, required — The ID of the specification.
  - `name` string, required — The name of the specification.
  - `version` integer, required — The version of the specification definition.
  - `latest` boolean, required — Whether this is the latest version of the given specification.
  - `archived` boolean, required — Whether this specification has been marked as archived.
  - `description` string, required — The description of the specification.
  - `createdBy` string, required — The ID of the user who created the specification.
  - `createdAt` string, date-time, required — The date the specification was created.
  - `inputDataTypeIds` VersionId[], required — The input data-type IDs for the computation specification.
    - `id` string, required — The specification ID.
    - `version` integer, required — The version of the specification of the given ID.
  - `outputDataTypeIds` VersionId[], required — The output data-type IDs for the computation specification.
    - `id` string, required — The specification ID.
    - `version` integer, required — The version of the specification of the given ID.
  - `annotations` Annotation[] — The annotations for the computation specification. These annotations can be used to annotate the computation specification with useful information such as a 'name'.
    - `address` SpecAddress — An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
      - `type` 'Invalid' | 'Computation' | 'DataTypeInput' | 'DataTypeOutput', required — Whether the address refers to a data-type input, a data-type output or a computation specification.
      - `computationIndex` integer — The zero based index of the Computation Spec.
      - `dataTypeIndex` integer — The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    - `key` string — Free form content with relevant information for the given address.
    - `value` string — Free form content with relevant information for the given address.
    - `createdBy` string — The user who created this annotation.

## Other responses

- `201` — Computation specification created successfully.
- `400` — Unauthorized.
- `401` — Unauthorized.
- `default` — Unexpected error.

---

[API](https://skmtc.net/slb/apis/evaluation.md) · [All operations](https://skmtc.net/slb/apis/evaluation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/slb/evaluation/revisions/b563a2fae7de/schema)
