# APIClient

**Kind:** Interface

**Source:** [`atloria-monorepo/packages/ui-react/src/types/api-client.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/ui-react/src/types/api-client.ts#L95)

API Client interface for making backend requests
This follows the Repository pattern to abstract data access

## Properties

| Property | Type |
|---|---|
| `audiences` | `{
    list(): Promise<AudienceModel[]>;
    get(id: string): Promise<AudienceModel>;
    create(data: {
      name: string;
      slug: string;
      color: string;
      icon: string;
      description?: string;
    }): Promise<AudienceModel>;
    update(
      id: string,
      data: {
        name?: string;
        slug?: string;
        color?: string;
        icon?: string;
        description?: string;
      },
    ): Promise<AudienceModel>;
    delete(id: string): Promise<void>;
  }` |
| `documents` | `{
    get(id: string): Promise<Document>;
    list(params?: { projectId?: string }): Promise<DocumentListResponse>;
    create(data: Partial<Document>): Promise<Document>;
    update(id: string, data: Partial<Document>): Promise<Document>;
    delete(id: string): Promise<void>;
    publish(id: string, isPublic?: boolean): Promise<Document>;
    unpublish(id: string): Promise<Document>;
    getRevisions(id: string, limit?: number, offset?: number): Promise<DocumentRevision[]>;
    getRevision(id: string, revisionId: string): Promise<DocumentRevision>;
    restoreRevision(id: string, revisionId: string): Promise<Document>;
    compareDocuments(
      id: string,
      from: string,
      to: string,
      type?: 'version' | 'revision',
    ): Promise<DocumentCompareResult>;
  }` |
| `projects` | `{
    get(id: string): Promise<Project>;
    list(params?: { organizationId?: string }): Promise<Project[]>;
    create(data: Partial<Project>): Promise<Project>;
    update(id: string, data: Partial<Project>): Promise<Project>;
    delete(id: string): Promise<void>;
    publish(id: string): Promise<{
      id: string;
      name: string;
      slug: string;
      urlId: string;
      publishedSlug: string;
      publicUrl: string;
      publishedAt: string;
      isPublic: boolean;
    }>;
    unpublish(id: string): Promise<Project>;
  }` |
| `comments` | `{
    list(documentId: string, params?: any): Promise<CommentWithUser[]>;
    get(documentId: string, commentId: string): Promise<CommentWithUser>;
    create(documentId: string, dto: CreateCommentDto): Promise<CommentWithUser>;
    update(
      documentId: string,
      commentId: string,
      dto: UpdateCommentDto,
    ): Promise<CommentWithUser>;
    delete(documentId: string, commentId: string): Promise<void>;
    resolve(documentId: string, commentId: string): Promise<CommentWithUser>;
    unresolve(documentId: string, commentId: string): Promise<CommentWithUser>;
    reply(
      documentId: string,
      parentCommentId: string,
      dto: Omit<CreateCommentDto, 'parentCommentId'>,
    ): Promise<CommentWithUser>;
    getReplies(parentCommentId: string): Promise<CommentWithUser[]>;
  }` |
| `suggestions` | `{
    list(documentId: string, params?: any): Promise<SuggestionWithUser[]>;
    get(suggestionId: string): Promise<SuggestionWithUser>;
    create(documentId: string, dto: CreateSuggestionDto): Promise<SuggestionWithUser>;
    update(suggestionId: string, dto: UpdateSuggestionDto): Promise<SuggestionWithUser>;
    delete(suggestionId: string): Promise<void>;
    accept(suggestionId: string, reviewComment?: string): Promise<SuggestionWithUser>;
    reject(suggestionId: string, reviewComment?: string): Promise<SuggestionWithUser>;
  }` |
| `auth` | `{
    login(email: string, password: string): Promise<{ user: User; token: string }>;
    logout(): Promise<void>;
    getCurrentUser(): Promise<User | null>;
    register(data: {
      email: string;
      password: string;
      name: string;
    }): Promise<{ user: User; token: string }>;
  }` |
| `parser` | `{
    parse(code: string, language: string, filename?: string): Promise<ParseResult>;
    parseDocument(documentId: string): Promise<ParseResult>;
    getSupportedLanguages(): Promise<SupportedLanguagesResponse>;
  }` |
| `templates` | `{
    list(filters?: TemplateFiltersDto): Promise<DocumentTemplate[]>;
    get(id: string): Promise<DocumentTemplate>;
    create(dto: CreateTemplateDto): Promise<DocumentTemplate>;
    update(id: string, dto: Partial<CreateTemplateDto>): Promise<DocumentTemplate>;
    delete(id: string): Promise<void>;
    useTemplate(id: string, dto: CreateFromTemplateDto): Promise<Document>;
    saveAsTemplate(documentId: string, dto: SaveAsTemplateDto): Promise<DocumentTemplate>;
  }` |
| `branding` | `{
    get(projectId: string): Promise<any>;
    update(projectId: string, dto: any): Promise<any>;
  }` |
| `snippets` | `{
    list(projectId: string): Promise<any[]>;
    get(projectId: string, id: string): Promise<any>;
    references(projectId: string, id: string): Promise<any[]>;
    create(projectId: string, data: { name: string; title?: string; content?: string }): Promise<any>;
    update(
      projectId: string,
      id: string,
      data: { name?: string; title?: string; content?: string },
    ): Promise<any>;
    remove(projectId: string, id: string): Promise<{ deleted: boolean }>;
  }` |
| `issues` | `{
    list(projectId: string, params?: Record<string, any>): Promise<any>;
    getStats(projectId: string): Promise<any>;
    get(projectId: string, issueId: string): Promise<any>;
    update(projectId: string, issueId: string, dto: any): Promise<any>;
    bulkUpdate(projectId: string, dto: any): Promise<any>;
    addComment(projectId: string, issueId: string, dto: any): Promise<any>;
    getDuplicates(projectId: string, issueId: string): Promise<any>;
    getBoardsForIssue(projectId: string, issueId: string): Promise<any>;
  }` |
| `boards` | `{
    list(projectId: string): Promise<any>;
    create(projectId: string, dto: any): Promise<any>;
    get(projectId: string, boardId: string, includeCards?: boolean): Promise<any>;
    update(projectId: string, boardId: string, dto: any): Promise<any>;
    deleteBoard(projectId: string, boardId: string): Promise<any>;
    restore(projectId: string, boardId: string): Promise<any>;
    addColumn(projectId: string, boardId: string, dto: any): Promise<any>;
    updateColumn(projectId: string, boardId: string, columnId: string, dto: any): Promise<any>;
    reorderColumns(projectId: string, boardId: string, columnIds: string[]): Promise<any>;
    deleteColumn(projectId: string, boardId: string, columnId: string, moveCardsTo?: string): Promise<any>;
    listCards(projectId: string, boardId: string, since?: string): Promise<any>;
    addCards(projectId: string, boardId: string, dto: { issueIds: string[]; columnId?: string }): Promise<any>;
    moveCard(projectId: string, boardId: string, cardId: string, dto: { columnId: string; position: number }): Promise<any>;
    removeCard(projectId: string, boardId: string, cardId: string): Promise<any>;
  }` |
| `audit` | `{
    query(
      projectId: string,
      opts?: {
        action?: string;
        actorId?: string;
        entityType?: string;
        startDate?: string;
        endDate?: string;
        limit?: number;
        offset?: number;
      },
    ): Promise<any>;
    queryOrg(opts?: {
      action?: string;
      actorId?: string;
      projectId?: string;
      entityType?: string;
      startDate?: string;
      endDate?: string;
      limit?: number;
      offset?: number;
    }): Promise<any>;
    facets(): Promise<{ actions: string[]; actors: { actorId: string; actorEmail: string }[] }>;
    exportCSV(projectId: string): Promise<string>;
    exportJSON(projectId: string): Promise<any>;
    exportOrgCSV(): Promise<string>;
    exportOrgJSON(): Promise<any>;
  }` |
| `analytics` | `{
    getOverview(projectId: string, days: number): Promise<any>;
    getDailyTraffic(projectId: string, days: number): Promise<any>;
    getTopDocuments(projectId: string, days: number): Promise<any>;
    getTopSearchQueries(projectId: string, days: number): Promise<any>;
    getVersionTraffic(projectId: string, days: number): Promise<any>;
    getDeviceBreakdown(projectId: string, days: number): Promise<any>;
    getSourceBreakdown(projectId: string, days: number): Promise<any>;
    getGeoBreakdown(projectId: string, days: number): Promise<any>;
    getZeroResultSearches(projectId: string, days: number): Promise<any>;
    getGhostDocs(projectId: string, days: number): Promise<any>;
    getTrendingDocs(projectId: string, days: number): Promise<any>;
    getScrollHistogram(projectId: string, days: number): Promise<any>;
    getFeedbackSummary(projectId: string, days: number): Promise<any>;
    submitFeedback(data: any): Promise<any>;
    exportNow(projectId: string, data: any): Promise<any>;
    listScheduledReports(projectId: string): Promise<any>;
    createScheduledReport(projectId: string, data: any): Promise<any>;
    updateScheduledReport(projectId: string, id: string, data: any): Promise<any>;
    deleteScheduledReport(projectId: string, id: string): Promise<any>;
    runScheduledReport(projectId: string, id: string): Promise<any>;
    listExportHistory(projectId: string): Promise<any>;
  }` |
