POST /routines/request

POST /routines/request

Request the manual creation of a routine from offsite products

Body Required

  • routine_title string Required
  • routine_type string
  • products array[string] Required

Responses

  • 201

    successful operation

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • id integer
      • user_id integer
      • routine_id integer
      • status string
      • routine_title string
      • routine_type string
      • request object
        Hide request attribute Show request attribute object
        • products array[string]
      • 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 /routines/request
curl \
 -X POST https://api.cosmily.com/api/v1/routines/request \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"routine_title":"The Daily Grind","routine_type":"AM","products":["https://www.amazon.com/CeraVe-Hydrating-Facial-Cleanser-Fragrance/dp/B01MSSDEPK","https://www.sephora.com/product/supergoop-unseen-sunscreen-spf-40-P454380"]}'
Request example
{
  "routine_title": "The Daily Grind",
  "routine_type": "AM",
  "products": [
    "https://www.amazon.com/CeraVe-Hydrating-Facial-Cleanser-Fragrance/dp/B01MSSDEPK",
    "https://www.sephora.com/product/supergoop-unseen-sunscreen-spf-40-P454380"
  ]
}
Request examples
{
  "routine_title": "The Daily Grind",
  "routine_type": "AM",
  "products": [
    "https://www.amazon.com/CeraVe-Hydrating-Facial-Cleanser-Fragrance/dp/B01MSSDEPK",
    "https://www.sephora.com/product/supergoop-unseen-sunscreen-spf-40-P454380"
  ]
}
Response examples (201)
{
  "data": {
    "id": 123,
    "user_id": 55,
    "routine_id": null,
    "status": "pending",
    "routine_title": "The Daily Grind",
    "routine_type": "AM",
    "request": {
      "products": [
        "https://www.amazon.com/CeraVe-Hydrating-Facial-Cleanser-Fragrance/dp/B01MSSDEPK",
        "https://www.sephora.com/product/supergoop-unseen-sunscreen-spf-40-P454380"
      ]
    },
    "created_at": "2022-08-01T19:58:57.073Z",
    "updated_at": "2022-08-01T19:58:57.073Z"
  }
}
Response examples (201)
{
  "data": {
    "id": 42,
    "user_id": 42,
    "routine_id": 42,
    "status": "string",
    "routine_title": "string",
    "routine_type": "string",
    "request": {
      "products": [
        "string"
      ]
    },
    "created_at": "string",
    "updated_at": "string"
  }
}