---
title: "Create or update data-type"
method: PUT
path: "/data-types/{dataTypeId}"
tags: ["DataTypes"]
---

# Create or update data-type

`PUT /data-types/{dataTypeId}`

Create or update data-type. The request must contain all the file types
which are to be associated with the data-type. For example, if
the data-type was to allow the use of JSON documents then the request
would list it as a file specification.

## Path parameters

- `dataTypeId` string, required

## Headers

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

## Request body

- ReplaceDataType — Replace data-type 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.
  - `fileSpecs` FileSpec[]
    - `extension` string — The file extension e.g. 'xlsx'
    - `schemaRef` SchemaRef — A schema reference.
      - `id` string, required — The unique idenitifer for the schema.
      - `type` 'JSON', required — The type of schema, for instance JSON schema.
    - `defaultFilename` string — The optional default filename for this file specification. This field is useful when the file specification defines a single file which always has the same filename. (e.g. filename.json). Note that the extension of the default filename should match the file specification extension.

## Response `200`

Data-type updated successfully.

- DataType — An evaluation data-type.
  - `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.
  - `fileSpecs` FileSpec[] — Specification of the file types allowed to be used with this container.
    - `extension` string — The file extension e.g. 'xlsx'
    - `schemaRef` SchemaRef — A schema reference.
      - `id` string, required — The unique idenitifer for the schema.
      - `type` 'JSON', required — The type of schema, for instance JSON schema.
    - `defaultFilename` string — The optional default filename for this file specification. This field is useful when the file specification defines a single file which always has the same filename. (e.g. filename.json). Note that the extension of the default filename should match the file specification extension.

## Other responses

- `201` — Data-type created successfully.
- `400` — Bad request
- `401` — Unauthorized.
- `default` — Unexpected error

---

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