Create an insight folder

POST
/api/v1/orgs/{orgId}/insights/folders

Creates a folder in the Insights workspace. Returns 201 for a new folder and 200 when a folder with the same name already exists under the parent.

Requires the api_insights_create scope.

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token using a Clai API key secret (clai_live_*).

In: header

Path Parameters

NameTypeDescription
orgId
required
string

Organization ID the key is operating in

Header Parameters

NameTypeDescription
Idempotency-Key
required
string

Required client-supplied idempotency key for safe create-folder retries

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
name
required
string
Length1 <= length
parentIdstring | null
Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://app.goclai.com/api/v1/orgs/org_2abc123/insights/folders" \  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",
  "path": "string"
}
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "parentId": "70850378-7d3c-4f45-91b7-942d4dfbbd43",
  "path": "string"
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}