Skip to content
StudyFetch API

Components

Update component

OpenAPI specification
PATCH/api/v1/components/{id}

Authentication

x-api-key

Request

curl --globoff --request PATCH \
  --url 'https://api.example.com/api/v1/components/%3Cid%3E' \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{}'

Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.

Replace https://api.example.com with the API server URL.

Use the sample JSON body as your starting point, and enter values that match the endpoint's schema.

Parameters

idpath · string · required

Component ID

Request body schema or example

{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "active",
        "inactive",
        "processing",
        "error"
      ],
      "description": "Component status"
    }
  }
}

Responses

200Component updated successfully
{
  "type": "object",
  "properties": {
    "_id": {
      "type": "string",
      "description": "Component ID (MongoDB ObjectId)"
    },
    "componentId": {
      "type": "string",
      "description": "Unique component identifier"
    },
    "type": {
      "type": "string",
      "description": "Component type",
      "enum": [
        "chat",
        "data_analyst",
        "flashcards",
        "scenarios",
        "practice_test",
        "audio_recap",
        "tutor_me",
        "explainers",
        "uploads",
        "chat_analytics",
        "video_generation",
        "performance_insights"
      ]
    },
    "name": {
      "type": "string",
      "description": "Component name"
    },
    "description": {
      "type": "string",
      "description": "Component description"
    },
    "organization": {
      "type": "string",
      "description": "Organization ID"
    },
    "config": {
      "type": "object",
      "description": "Component configuration"
    },
    "status": {
      "type": "string",
      "description": "Component status",
      "enum": [
        "active",
        "inactive",
        "draft"
      ]
    },
    "usage": {
      "type": "object",
      "description": "Usage statistics"
    },
    "createdAt": {
      "format": "date-time",
      "type": "string",
      "description": "Creation timestamp"
    },
    "updatedAt": {
      "format": "date-time",
      "type": "string",
      "description": "Last update timestamp"
    }
  },
  "required": [
    "_id",
    "componentId",
    "type",
    "name",
    "organization",
    "config",
    "status",
    "usage",
    "createdAt",
    "updatedAt"
  ]
}