Add a Category

POST /categories

Add a new category

application/json

Body

  • category object
    Hide category attributes Show category attributes object
    • title string
    • parent_id string(guid)
    • handle string

Responses

  • 201 application/json

    Category created

    Hide response attributes Show response attributes object
    • id string(guid)

      System generated unique identifier. Don't include this in POST request body.

    • title string
    • parent_id string(guid)
    • handle string
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • error string

      401: Invalid Credentials

      404: Resource not found

      422: Unprocessable Entity

    • details string

      404: empty

      401: The credentials presented are not valid to access this resource

  • 404 application/json

    Not Found

    Hide response attributes Show response attributes object
    • error string

      401: Invalid Credentials

      404: Resource not found

      422: Unprocessable Entity

    • details string

      404: empty

      401: The credentials presented are not valid to access this resource

  • 422 application/json

    Unprocessable Entity

    Hide response attributes Show response attributes object
    • error string

      401: Invalid Credentials

      404: Resource not found

      422: Unprocessable Entity

    • details string

      404: empty

      401: The credentials presented are not valid to access this resource

POST /categories
curl \
 --request POST 'https://app.getfoundation.com/api/external/v1/categories' \
 --header "X-API-Key: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"category":{"title":"Toys","parent_id":"string","handle":"toys"}}'
Request examples
{
  "category": {
    "title": "Toys",
    "parent_id": "string",
    "handle": "toys"
  }
}
Response examples (201)
{
  "id": "9aa62446-c3b0-42f5-8027-3648daed9d73",
  "title": "Toys",
  "parent_id": "string",
  "handle": "toys"
}
Response examples (401)
{
  "error": "string",
  "details": "string"
}
Response examples (404)
{
  "error": "string",
  "details": "string"
}
Response examples (422)
{
  "error": "string",
  "details": "string"
}