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

# Create MaterializedSegment

> Create a new materialized segment. The materialization can then be attached to rules.



## OpenAPI

````yaml /api/flags/api/materialized-segments.openapi.json post /v1/materializedSegments
openapi: 3.1.0
info:
  title: Confidence Materialized-segments API
  version: 1.0.0
  description: API documentation for materialized-segments
servers: []
security: []
paths:
  /v1/materializedSegments:
    post:
      summary: Create MaterializedSegment
      description: >-
        Create a new materialized segment. The materialization can then be
        attached to rules.
      operationId: MaterializedSegment.create
      parameters:
        - name: materializedSegmentId
          in: query
          required: false
          description: >-
            The id of the materialization which would be the the last segment of
            the resource name
             such as 'materializedSegments/\{materialized_segment_id}'. If none is specified a server generated one
             will be used.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/confidence.flags.admin.v1.CreateMaterializedSegmentRequest
        required: true
      responses:
        '200':
          description: >-
            Returns a
            [MaterializedSegment](/api-reference/schemas/materializedsegment).
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/confidence.flags.admin.v1.MaterializedSegment
      security:
        - admin: []
      servers:
        - url: https://flags.eu.confidence.dev
        - url: https://flags.us.confidence.dev
        - url: https://flags.confidence.dev
components:
  schemas:
    confidence.flags.admin.v1.CreateMaterializedSegmentRequest:
      title: CreateMaterializedSegmentRequest
      type: object
      description: Create a new materialized segment.
      properties:
        materializedSegment:
          $ref: '#/components/schemas/confidence.flags.admin.v1.MaterializedSegment'
          description: >-
            [MaterializedSegment](/api-reference/schemas/materializedsegment):
            The properties of the materialization to be created.
        materializedSegmentId:
          type: string
          description: >-
            The id of the materialization which would be the the last segment of
            the resource name
             such as 'materializedSegments/\{materialized_segment_id}'. If none is specified a server generated one
             will be used.
      required:
        - materializedSegment
    confidence.flags.admin.v1.MaterializedSegment:
      title: MaterializedSegment
      type: object
      description: >-
        A slice of the entity population that has is materialized as individual
        entity identifiers stored in a database.
         Useful for segmenting a large list of entities that cannot otherwise be easily targeted through evaluation context.
      properties:
        name:
          type: string
          description: |-
            The resource name of the materialized segment.
             For example:
             `materializedSegment/0smva5nxuhv4yts6paxt`
        displayName:
          type: string
          description: A human-friendly name for the segment.
        labels:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
          description: General labels for this resource.
        createTime:
          type: object
          description: Time when the segment was first created.
        updateTime:
          type: object
          description: Time when the segment was last updated.
        creator:
          type: string
          description: Reference to the identity that created this segment.
        updater:
          type: string
          description: Reference to the identity that last updated this segment.
        owner:
          type: string
          description: The owner of the resource. If not set will default to the creator.
      required:
        - displayName
        - createTime
        - updateTime
        - creator
        - updater
  securitySchemes:
    admin:
      type: http
      scheme: bearer

````