Replace what a dataset says about itself
const url = 'https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metadata';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"resourceKind":"example","descriptions":[{"lang":"example","value":"example"}],"keywords":[{"lang":"example","value":"example"}],"themes":["https://example.com"],"status":"UnderDevelopment","license":"https://example.com","landingPage":"https://example.com","identifier":"example","canonicalIri":"https://example.com","publisher":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","iri":"https://example.com","email":"example"},"maintainers":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","iri":"https://example.com","email":"example"}],"contactPoints":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","iri":"https://example.com","email":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metadata \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "resourceKind": "example", "descriptions": [ { "lang": "example", "value": "example" } ], "keywords": [ { "lang": "example", "value": "example" } ], "themes": [ "https://example.com" ], "status": "UnderDevelopment", "license": "https://example.com", "landingPage": "https://example.com", "identifier": "example", "canonicalIri": "https://example.com", "publisher": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "iri": "https://example.com", "email": "example" }, "maintainers": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "iri": "https://example.com", "email": "example" } ], "contactPoints": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "iri": "https://example.com", "email": "example" } ] }'Replace the dataset’s descriptive record with the given one. The record is replaced whole, so the body is the record as it should be from now on; a record stating nothing removes it. It is a setting of the dataset and commits nothing. An agent is kept by its fields alone, so the agents in the response carry no id. Whoever may change the dataset may replace it. Whether the dataset is shown in the public catalog is its publicRecords setting, not a field here.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”What a dataset says about itself for the catalog: the descriptive fields of a model’s metadata, from the same closed lists, without contributors, distributions or a public flag, and with the dataset’s kind of resource. A record that says nothing has every list empty.
object
What the dataset is to the public catalog, a value of datasetKinds from /public/metadata/vocabularies (VALUE_LIST, METADATA_RECORDS). A read names the dataset’s kind as it is stored, VALUE_LIST for a dataset that states none; a kind a later version added is named as stored, while the dataset is shown as a VALUE_LIST. A write naming a listed kind changes it, a write naming none or the kind as stored leaves it as it is, and a write naming any other value is refused with 422 naming resourceKind. Kept as a field of the dataset beside the record, not inside it, and left out of the record a public read serves, which names the kind on its own.
One text per language.
One language-tagged text; lang is null for a text without a language.
object
A language tag such as nl or en.
Free-text tags; a keyword may repeat a language or carry none.
One language-tagged text; lang is null for a text without a language.
object
A language tag such as nl or en.
EU data-theme IRIs from the shipped list.
A licence IRI from the shipped list.
The dataset’s stable external identifier.
The dataset’s stable identity.
object
The stored element’s id on a model’s record; null in a request, minted anew on every save. Always null on a dataset’s record, which keeps an agent by its fields alone.
The agent’s e-mail address. The anonymous public model read serves it on contact points only, and leaves it out for the publisher, maintainers and contributors.
A person or organization the metadata names. Which role it plays is the list it is in; the same agent named as publisher and as maintainer is two entries.
object
The stored element’s id on a model’s record; null in a request, minted anew on every save. Always null on a dataset’s record, which keeps an agent by its fields alone.
The agent’s e-mail address. The anonymous public model read serves it on contact points only, and leaves it out for the publisher, maintainers and contributors.
A person or organization the metadata names. Which role it plays is the list it is in; the same agent named as publisher and as maintainer is two entries.
object
The stored element’s id on a model’s record; null in a request, minted anew on every save. Always null on a dataset’s record, which keeps an agent by its fields alone.
The agent’s e-mail address. The anonymous public model read serves it on contact points only, and leaves it out for the publisher, maintainers and contributors.
Responses
Section titled “Responses”OK
What a dataset says about itself for the catalog: the descriptive fields of a model’s metadata, from the same closed lists, without contributors, distributions or a public flag, and with the dataset’s kind of resource. A record that says nothing has every list empty.
object
What the dataset is to the public catalog, a value of datasetKinds from /public/metadata/vocabularies (VALUE_LIST, METADATA_RECORDS). A read names the dataset’s kind as it is stored, VALUE_LIST for a dataset that states none; a kind a later version added is named as stored, while the dataset is shown as a VALUE_LIST. A write naming a listed kind changes it, a write naming none or the kind as stored leaves it as it is, and a write naming any other value is refused with 422 naming resourceKind. Kept as a field of the dataset beside the record, not inside it, and left out of the record a public read serves, which names the kind on its own.
One text per language.
One language-tagged text; lang is null for a text without a language.
object
A language tag such as nl or en.
Free-text tags; a keyword may repeat a language or carry none.
One language-tagged text; lang is null for a text without a language.
object
A language tag such as nl or en.
EU data-theme IRIs from the shipped list.
A licence IRI from the shipped list.
The dataset’s stable external identifier.
The dataset’s stable identity.
object
The stored element’s id on a model’s record; null in a request, minted anew on every save. Always null on a dataset’s record, which keeps an agent by its fields alone.
The agent’s e-mail address. The anonymous public model read serves it on contact points only, and leaves it out for the publisher, maintainers and contributors.
A person or organization the metadata names. Which role it plays is the list it is in; the same agent named as publisher and as maintainer is two entries.
object
The stored element’s id on a model’s record; null in a request, minted anew on every save. Always null on a dataset’s record, which keeps an agent by its fields alone.
The agent’s e-mail address. The anonymous public model read serves it on contact points only, and leaves it out for the publisher, maintainers and contributors.
A person or organization the metadata names. Which role it plays is the list it is in; the same agent named as publisher and as maintainer is two entries.
object
The stored element’s id on a model’s record; null in a request, minted anew on every save. Always null on a dataset’s record, which keeps an agent by its fields alone.
The agent’s e-mail address. The anonymous public model read serves it on contact points only, and leaves it out for the publisher, maintainers and contributors.
Example
{ "status": "UnderDevelopment"}The dataset is not the caller’s to change.
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}The dataset does not exist, or is not the caller’s to read.
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}The record was refused and nothing was written. violations names every refused field by its JSON path (status, descriptions[1].lang, maintainers[0].name), by the rules a model’s metadata is held to: a value outside a shipped list, two descriptions in one language or one without a language, an empty text, an agent without a name, a relative IRI or a javascript:, data:, vbscript: or file: one, a landing page that is no http or https address or carries a user name or password, a list past its size (50 descriptions, 100 keywords, 50 themes, 50 agents per role) or a text past its length (10,000 for a description, 200 for a keyword, 500 for a name, identifier or status, 2,048 for an IRI, 320 for an e-mail address).
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}default
Section titled “default”Error
An RFC 9457 problem document, always sent as application/problem+json.
object
Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.
The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.
Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}