> ## Documentation Index
> Fetch the complete documentation index at: https://api.globalwebindex.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# v1 Create Chart

> Create user's chart. If audiences on this chart are not accessible for the user, it creates new ones.



## OpenAPI

````yaml post /v1/charts
openapi: 3.0.0
info:
  contact:
    name: Slack Channel
    url: https://globalwebindex.slack.com/archives/CQV0R87DG
  description: platform-charts public API for Platform2.0
  license:
    name: GWI Platform 2.0 Community
    url: https://github.com/orgs/GlobalWebIndex/teams/engineering-platform-2-0
  title: platform-charts-api
  version: 0.0.1
servers:
  - url: http://api.globalwebindex.com
  - url: https://api.globalwebindex.com
security: []
paths:
  /v1/charts:
    post:
      tags:
        - Charts
      summary: v1 Create Chart
      description: >-
        Create user's chart. If audiences on this chart are not accessible for
        the user, it creates new ones.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/charts.CreateRequest'
        description: Chart to create.
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/charts.CreateResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
        '401':
          description: Invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
        '404':
          description: Invalid audience
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    charts.CreateRequest:
      properties:
        attributes:
          items:
            $ref: '#/components/schemas/common.AttributeKey'
          type: array
        audiences:
          items:
            $ref: '#/components/schemas/common.ChartAudience'
          type: array
        base_audience:
          $ref: '#/components/schemas/common.ChartAudience'
        color:
          type: string
        dataset_codes:
          items:
            type: string
          type: array
        dataset_names:
          items:
            type: string
          type: array
        folder_id:
          type: string
        group_type:
          type: integer
        location_codes:
          items:
            type: string
          type: array
        metrics:
          items:
            type: string
          type: array
        name:
          type: string
        segmented_base:
          type: boolean
        segments:
          items:
            type: string
          type: array
        sort_parameter_type:
          type: integer
        sort_parameter_value:
          type: string
        sort_type:
          type: integer
        splitter:
          type: string
        view_type:
          type: integer
        wave_codes:
          items:
            type: string
          type: array
      type: object
    charts.CreateResponse:
      properties:
        audience_replacements:
          items:
            $ref: '#/components/schemas/charts.AudienceReplacement'
          type: array
        id:
          type: string
      type: object
    common.ErrorResponse:
      properties:
        code:
          type: integer
        message:
          type: string
      type: object
    common.AttributeKey:
      properties:
        datapoint_code:
          type: string
        namespace_code:
          type: string
        question_code:
          type: string
        suffix_code:
          type: string
      type: object
    common.ChartAudience:
      properties:
        color_index:
          type: integer
        expression:
          $ref: '#/components/schemas/common.CoreClause'
        id:
          type: string
        is_hidden:
          type: boolean
        name:
          type: string
      type: object
    charts.AudienceReplacement:
      properties:
        from:
          type: string
        to:
          type: string
      type: object
    common.CoreClause:
      properties:
        and:
          items:
            $ref: '#/components/schemas/common.CoreClause'
          type: array
        datapoints:
          items:
            type: string
          type: array
        min_count:
          type: integer
        not:
          type: boolean
        or:
          items:
            $ref: '#/components/schemas/common.CoreClause'
          type: array
        question:
          type: string
        suffixes:
          items: {}
          type: array
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: JWT token for authentication
      in: header
      name: Authorization
      type: apiKey

````