# Hosting market submission create

`POST /hosting/market/submissions` · Rivier · hosting

Offer a library entry (a palette, type pairing, token set, section, flow, tone, site-type package or starting template) with its files, free or with a price. Rivier's staff review it before it is on the shelf; a newer offer of the same entry replaces one still waiting.

- Scope: hosting:write
- Sdk: hosting.marketSubmission.create
- Cli: hosting market submission create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "entry": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z-]+\\/[a-z][a-z0-9-]{1,60}$"
        },
        "kind": {
          "type": "string",
          "enum": [
            "component",
            "widget",
            "method",
            "layout",
            "stack",
            "palette",
            "type-pairing",
            "token-set",
            "section",
            "flow",
            "tone",
            "site-type",
            "template",
            "resource",
            "connection"
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "for": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "when": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1500
        },
        "not_when": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1500
        },
        "status": {
          "type": "string",
          "enum": [
            "ready",
            "planned"
          ]
        },
        "inputs": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "maxLength": 400
          }
        },
        "use": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "how": {
                  "type": "string",
                  "const": "registry-add"
                },
                "registry": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "item": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "files": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              },
              "required": [
                "how",
                "registry",
                "item"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "how": {
                  "type": "string",
                  "const": "element"
                },
                "tag": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*-[a-z0-9-]+$"
                },
                "script": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "required": [
                "how",
                "tag"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "how": {
                  "type": "string",
                  "const": "copy-tree"
                },
                "from": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "replace": {
                  "type": "boolean"
                }
              },
              "required": [
                "how",
                "from"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "how": {
                  "type": "string",
                  "const": "tokens"
                },
                "file": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              },
              "required": [
                "how",
                "file"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "how": {
                  "type": "string",
                  "const": "attach"
                },
                "resource": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                }
              },
              "required": [
                "how",
                "resource"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "how": {
                  "type": "string",
                  "const": "guide"
                }
              },
              "required": [
                "how"
              ],
              "additionalProperties": false
            }
          ]
        },
        "requires": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z-]+\\/[a-z0-9-]+$"
          },
          "maxItems": 40
        },
        "packages": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(@[a-z0-9._-]+\\/)?[a-z0-9._-]+$"
          },
          "maxItems": 40
        },
        "stacks": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "next",
              "static",
              "harness"
            ]
          },
          "minItems": 1
        },
        "plan": {
          "type": "object",
          "additionalProperties": {}
        },
        "version": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+\\.\\d+$"
        },
        "license": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "author": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "price": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$"
                }
              },
              "required": [
                "amount",
                "currency"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "seller": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "maxItems": 20
        },
        "guide": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "example": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "verified": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 400
          },
          "maxItems": 20
        },
        "source": {
          "type": "object",
          "properties": {
            "repository": {
              "type": "string",
              "maxLength": 200
            },
            "commit": {
              "type": "string",
              "maxLength": 64
            }
          },
          "required": [
            "repository",
            "commit"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "kind",
        "title",
        "for",
        "when",
        "use",
        "stacks",
        "version",
        "license",
        "author",
        "price"
      ],
      "additionalProperties": false
    },
    "files": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 400000
      }
    }
  },
  "required": [
    "entry",
    "files"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/hosting/market/submissions' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "entry": {
    "id": "string",
    "kind": "component",
    "title": "string",
    "for": "string",
    "when": "string",
    "use": {
      "how": "registry-add",
      "registry": "string",
      "item": "string"
    },
    "stacks": [
      "next"
    ],
    "version": "string"
  },
  "files": {}
}'
```
