Skip to content

Create or update an artifact

POST
/api/v1/artifacts/{type}/{name}
curl --request POST \
--url http://localhost:11044/api/v1/artifacts/example/example \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "content": "example" }'

The JSON body carries the content under a content key. Type is one of the ArtifactType names (case-insensitive).

type
required
string

The artifact’s type, one of the ArtifactType names, case-insensitive. An unrecognised type is refused with 400

name
required
string

The artifact’s name, including its extension, unique within its type

The content to store, verbatim. A write REPLACES an existing artifact of that name rather than merging, and the content is validated first: a failure answers 400 with the rules it broke, and nothing is written. The stored size is the content’s length in CHARACTERS, which is not necessarily its size in bytes.

Media typeapplication/json

An artifact’s new content

object
content
required

The content to store, verbatim

string

Example generated

{
"content": "example"
}

Artifact written

Media type*/*

Confirmation that an artifact was created or replaced

object
name
required

The artifact’s name

string
size
required

The stored content’s length in characters, which is not necessarily its size in bytes

integer format: int32
status
required

Always written

string
type
required

The ArtifactType name, upper case

string

An unknown type or missing content answers with the reason alone; a validation failure also carries violations

Media type*/*
One of:

A refusal carrying only its reason

object
error
required

Why the request was refused, written to be shown

string