# Create or update data-type

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.

Endpoint: PUT /data-types/{dataTypeId}
Version: 1.0.0
Security: bearer, appkey

## Security:

  - `bearer` (unknown)
    apiKey in header Authorization

  - `appkey` (unknown)
    apiKey in header appkey

## Path parameters:

  - `dataTypeId` (string, required)
    The data-type ID.

## Header parameters:

  - `slb-partition-id` (string, required)
    Data partition id.

## Request body:

  - `application/json` (unknown)
    The data-type to be updated or created.

## Request fields (application/json):

  - `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'.
    Example: slb:data-types:custom-specification

  - `name` (string, required)
    The name of the specification.
    Example: A custom data-type

  - `version` (integer, required)
    The version of the specification definition.
    Example: 1

  - `archived` (boolean)
    Whether this specification has been marked as archived.
    Example: false

  - `description` (string, required)
    The description of the specification.
    Example: A specification

  - `fileSpecs` (array)
    Example: [{"extension":"json","schemaRef":{"id":"planning:fdplan:result-set:0.0.1","type":"JSON"},"defaultFilename":"filename.json"},{"extension":"xlsx"}]

  - `fileSpecs.extension` (string)
    The file extension e.g. 'xlsx'
    Example: xlsx

  - `fileSpecs.schemaRef` (object)
    A schema reference.
    Example: {"id":"planning:fdplan:result-set:0.0.1","type":"JSON"}

  - `fileSpecs.schemaRef.id` (string, required)
    The unique idenitifer for the schema.
    Example: planning:fdplan:result-set:0.0.1

  - `fileSpecs.schemaRef.type` (string, required)
    The type of schema, for instance JSON schema.
    Enum: "JSON"

  - `fileSpecs.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:

  - `200` (unknown)
    Data-type updated successfully.

## Response 200 fields (application/json):

  - `id` (string, required)
    The ID of the specification.
    Example: 01DV2RPKYS5NYBAR6TNMJ8TNT8

  - `name` (string, required)
    The name of the specification.
    Example: A custom data-type

  - `version` (integer, required)
    The version of the specification definition.
    Example: 1

  - `latest` (boolean, required)
    Whether this is the latest version of the given specification.
    Example: true

  - `archived` (boolean, required)
    Whether this specification has been marked as archived.
    Example: false

  - `description` (string, required)
    The description of the specification.
    Example: A specification

  - `createdBy` (string, required)
    The ID of the user who created the specification.
    Example: user@slb.com

  - `createdAt` (string, required)
    The date the specification was created.
    Example: 2020-01-01T00:00:00.000Z

  - `fileSpecs` (array)
    Specification of the file types allowed to be used with this container.
    Example: [{"extension":"xlsx"},{"extension":"json","schemaRef":{"id":"planning:fdplan:result-set:0.0.1","type":"JSON"},"defaultFilename":"filename.json"}]

  - `fileSpecs.extension` (string)
    The file extension e.g. 'xlsx'
    Example: xlsx

  - `fileSpecs.schemaRef` (object)
    A schema reference.
    Example: {"id":"planning:fdplan:result-set:0.0.1","type":"JSON"}

  - `fileSpecs.schemaRef.id` (string, required)
    The unique idenitifer for the schema.
    Example: planning:fdplan:result-set:0.0.1

  - `fileSpecs.schemaRef.type` (string, required)
    The type of schema, for instance JSON schema.
    Enum: "JSON"

  - `fileSpecs.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 201:

  - `201` (unknown)
    Data-type created successfully.

## Response 201 fields (application/json):

  - `id` (string, required)
    The ID of the specification.
    Example: 01DV2RPKYS5NYBAR6TNMJ8TNT8

  - `name` (string, required)
    The name of the specification.
    Example: A custom data-type

  - `version` (integer, required)
    The version of the specification definition.
    Example: 1

  - `latest` (boolean, required)
    Whether this is the latest version of the given specification.
    Example: true

  - `archived` (boolean, required)
    Whether this specification has been marked as archived.
    Example: false

  - `description` (string, required)
    The description of the specification.
    Example: A specification

  - `createdBy` (string, required)
    The ID of the user who created the specification.
    Example: user@slb.com

  - `createdAt` (string, required)
    The date the specification was created.
    Example: 2020-01-01T00:00:00.000Z

  - `fileSpecs` (array)
    Specification of the file types allowed to be used with this container.
    Example: [{"extension":"xlsx"},{"extension":"json","schemaRef":{"id":"planning:fdplan:result-set:0.0.1","type":"JSON"},"defaultFilename":"filename.json"}]

  - `fileSpecs.extension` (string)
    The file extension e.g. 'xlsx'
    Example: xlsx

  - `fileSpecs.schemaRef` (object)
    A schema reference.
    Example: {"id":"planning:fdplan:result-set:0.0.1","type":"JSON"}

  - `fileSpecs.schemaRef.id` (string, required)
    The unique idenitifer for the schema.
    Example: planning:fdplan:result-set:0.0.1

  - `fileSpecs.schemaRef.type` (string, required)
    The type of schema, for instance JSON schema.
    Enum: "JSON"

  - `fileSpecs.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 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/json):

  - `data` (object, required)

  - `data.code` (integer, required)
    The HTTP status code.
    Example: 500

  - `data.message` (string)
    The error message.
    Example: internal server error

## Response 401:

  - `401` (unknown)
    Unauthorized.

## Response 401 fields (application/json):

  - `data` (object, required)

  - `data.code` (integer, required)
    The HTTP status code.
    Example: 500

  - `data.message` (string)
    The error message.
    Example: internal server error

## Response default:

  - `default` (unknown)
    Unexpected error

## Response default fields (application/json):

  - `data` (object, required)

  - `data.code` (integer, required)
    The HTTP status code.
    Example: 500

  - `data.message` (string)
    The error message.
    Example: internal server error

