Skip to content

Website operator response type uses userID but REST API returns user_id #76

Description

@timurkh-devstark

Summary

The WebsiteOperator TypeScript type does not match the payload returned by the Crisp REST API for listWebsiteOperators.

Environment

  • crisp-api: 10.10.6
  • Endpoint: GET /v1/website/{website_id}/operators/list

Actual REST response

{
  "type": "operator",
  "details": {
    "user_id": "operator-user-id",
    "email": "operator@example.com"
  }
}

This also matches the official REST API documentation, which documents details.user_id.

Current type

export interface WebsiteOperator {
  userID?: string;
  email?: string;
}

Impact

listWebsiteOperators() is typed as returning WebsiteOperatorListOne[], so TypeScript consumers read details.userID, but the runtime value is undefined. The SDK request implementation returns response.body.data without converting snake_case keys.

Expected behavior

Please either:

  1. change the affected operator response types to use the REST field name user_id; or
  2. explicitly transform the API response to camelCase before returning it, and document that behavior.

The current declaration should not claim userID unless the SDK performs that transformation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions