Custom Fields

Define custom data fields for tickets, customers and articles. Supports text, number, date, select and checkbox types.

The Custom Field object

id string

Field ID

contentType string

Record type this field belongs to "ticket" | "customer" | "article"

label string

Display name

fieldType string

Input type "text" | "number" | "date" | "select" | "checkbox"

defaultValue string

Pre-filled value, or null

options object[]

Choices for select fields as { value, label } (a record stores the value), or null

minValue number

Lower bound for number fields, or null

maxValue number

Upper bound for number fields, or null

required boolean

Whether the field is required

sortOrder integer

Display order within its type

createdAt datetime

When the field was created

Endpoints

GET /api/v1/teams/{teamId}/custom-fields

List Custom Fields

List custom field definitions in display order.

Query Parameters

entity string

Only fields for this record type

Code Examples

bash
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/custom-fields?entity=ticket" \
  -H "Authorization: Bearer sk_live_your_key"

Responses

200 Custom fields
json
{
  "success": true,
  "data": [
    {
      "id": "cf_abc",
      "object": "custom_field",
      "contentType": "ticket",
      "label": "Region",
      "fieldType": "select",
      "defaultValue": null,
      "options": [
        {
          "value": "US",
          "label": "US"
        },
        {
          "value": "EU",
          "label": "EU"
        },
        {
          "value": "APAC",
          "label": "APAC"
        }
      ],
      "minValue": null,
      "maxValue": null,
      "required": false,
      "sortOrder": 0,
      "createdAt": "2026-10-01T12:00:00Z"
    }
  ]
}

401 Authentication failed: missing or invalid API key
json
{
  "success": false,
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "The API key provided is invalid or has been revoked",
    "doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
    "request_id": "req_abc123"
  },
  "meta": {
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

403 Insufficient permissions: wrong key type or team access
json
{
  "success": false,
  "error": {
    "type": "authentication_error",
    "code": "insufficient_permissions",
    "message": "Your API key does not have permission for this operation",
    "doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
    "request_id": "req_abc123"
  },
  "meta": {
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

429 Rate limit exceeded
json
{
  "success": false,
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Try again in 60 seconds.",
    "retryAfter": 60,
    "doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
    "request_id": "req_abc123"
  },
  "meta": {
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

POST /api/v1/teams/{teamId}/custom-fields

Create Custom Field

Create a new custom field definition at the end of its type. A test key is refused with 400 (team settings are live, with no test copy).

Request Body

contentType string required

Record type

label string required

Display name

fieldType string

Input type

Default: text

options array

Choices for select fields: strings (each its own label) or { value, label } objects. Stored and returned as { value, label }; values must be unique.

defaultValue string

Pre-filled value

minValue number

Lower bound for number fields

maxValue number

Upper bound for number fields

required boolean

Whether the field is required

Code Examples

bash
curl -X POST "https://www.cstar.help/api/v1/teams/{teamId}/custom-fields" \
  -H "Authorization: Bearer sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"contentType":"ticket","label":"Region","fieldType":"select","options":["US","EU","APAC"]}'

Responses

201 Field created
json
{
  "success": true,
  "data": {
    "id": "cf_abc",
    "object": "custom_field",
    "contentType": "ticket",
    "label": "Region",
    "fieldType": "select",
    "options": [
      {
        "value": "US",
        "label": "US"
      },
      {
        "value": "EU",
        "label": "EU"
      },
      {
        "value": "APAC",
        "label": "APAC"
      }
    ],
    "required": false,
    "sortOrder": 0
  }
}

409 Idempotency-Key in use: its first request is still running (Retry-After says when to send it again) or it was used on another endpoint
json
{
  "success": false,
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_key_in_use",
    "message": "A request with this Idempotency-Key is still being processed. Retry after it finishes.",
    "doc_url": "https://www.cstar.help/developers/errors#idempotency_key_in_use",
    "request_id": "req_abc123"
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

422 Idempotency-Key already used within 24 hours for a request with a different body
json
{
  "success": false,
  "error": {
    "type": "invalid_request_error",
    "code": "idempotency_key_reused",
    "message": "The Idempotency-Key was already used for a request with a different body. Generate a new key for this request.",
    "doc_url": "https://www.cstar.help/developers/errors#idempotency_key_reused",
    "request_id": "req_abc123"
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

401 Authentication failed: missing or invalid API key
json
{
  "success": false,
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "The API key provided is invalid or has been revoked",
    "doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
    "request_id": "req_abc123"
  },
  "meta": {
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

403 Insufficient permissions: wrong key type or team access
json
{
  "success": false,
  "error": {
    "type": "authentication_error",
    "code": "insufficient_permissions",
    "message": "Your API key does not have permission for this operation",
    "doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
    "request_id": "req_abc123"
  },
  "meta": {
    "timestamp": "2025-12-10T14:30:00Z"
  }
}

429 Rate limit exceeded
json
{
  "success": false,
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Try again in 60 seconds.",
    "retryAfter": 60,
    "doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
    "request_id": "req_abc123"
  },
  "meta": {
    "timestamp": "2025-12-10T14:30:00Z"
  }
}