POST /facets/create

POST /facets/create

Create facet

Body Required

  • facet_type string Required

    Values are routine_goals, skin_types, or skin_concerns.

  • facet_value string Required
  • menuindex integer

Responses

  • 201

    successful operation

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • id integer
      • facet_type string
      • facet_value string
      • menuindex integer
      • created_at string(DateTime)
      • updated_at string(DateTime)
  • 400

    Bad Request

  • 401

    Authorization information is missing or invalid.

  • 422

    Unprocessable Entity

  • 500

    Server Error

POST /facets/create
curl \
 -X POST https://api.cosmily.com/api/v1/facets/create \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"facet_type":"routine_goals","facet_value":"string","menuindex":42}'
Request example
{
  "facet_type": "routine_goals",
  "facet_value": "string",
  "menuindex": 42
}
Request examples
{
  "facet_type": "routine_goals",
  "facet_value": "string",
  "menuindex": 42
}
Response examples (201)
{
  "data": {
    "id": 1,
    "facet_type": "skin_types",
    "facet_value": "dry skin",
    "menuindex": 0,
    "created_at": "2021-10-04T13:24:22.000Z",
    "updated_at": "2021-11-13T20:23:18.000Z"
  }
}
Response examples (201)
{
  "data": {
    "id": 42,
    "facet_type": "string",
    "facet_value": "string",
    "menuindex": 42,
    "created_at": "string",
    "updated_at": "string"
  }
}