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

# Create a segment for an import



## OpenAPI

````yaml POST /imports/{importId}/segments
openapi: 3.0.3
info:
  title: Taxonomy API
  version: v1
servers:
  - url: https://api.permutive.app/audience-api/v1
security: []
paths:
  /imports/{importId}/segments:
    post:
      tags:
        - v1
      summary: Creates a segment for an import.
      operationId: postImportsImportidSegments
      parameters:
        - name: importId
          in: path
          description: Import ID
          required: true
          schema:
            type: string
            format: uuid
          example: 32f8e031-c532-41bb-b25e-65bdb677a96f
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SegmentCreate'
            example:
              name: segment
              code: '1234'
              description: segment description
              cpm: 2
              categories:
                - category1
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        '400':
          description: 'Invalid value for: path parameter importId, Invalid value for: body'
          content:
            text/plain:
              schema:
                type: string
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
components:
  schemas:
    SegmentCreate:
      required:
        - name
        - code
      type: object
      properties:
        name:
          type: string
        code:
          type: string
        description:
          type: string
        cpm:
          type: number
          format: double
        categories:
          type: array
          items:
            type: string
    Segment:
      required:
        - id
        - code
        - name
        - importId
        - updatedAt
      type: object
      properties:
        id:
          type: string
          format: uuid
        code:
          type: string
        name:
          type: string
        importId:
          type: string
          format: uuid
        description:
          type: string
        cpm:
          type: number
          format: double
        categories:
          type: array
          items:
            type: string
        updatedAt:
          type: string
          format: date-time
    HttpErrorResponse:
      required:
        - requestId
        - error
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        error:
          $ref: '#/components/schemas/HttpError'
    HttpError:
      oneOf:
        - $ref: '#/components/schemas/AlreadyExists'
        - $ref: '#/components/schemas/AuthorizationFailed'
        - $ref: '#/components/schemas/AuthorizationFailedForAPIKey'
        - $ref: '#/components/schemas/AuthorizationFailedForUser'
        - $ref: '#/components/schemas/AuthorizationMissing'
        - $ref: '#/components/schemas/BadEncoding'
        - $ref: '#/components/schemas/BadOrigin'
        - $ref: '#/components/schemas/DoesNotExist'
        - $ref: '#/components/schemas/InsufficientAPIKey'
        - $ref: '#/components/schemas/InvalidAPIKey'
        - $ref: '#/components/schemas/InvalidHeader'
        - $ref: '#/components/schemas/InvalidParameters'
        - $ref: '#/components/schemas/InvalidRequestBody'
        - $ref: '#/components/schemas/MissingHeader'
        - $ref: '#/components/schemas/MissingOrigin'
        - $ref: '#/components/schemas/MissingParameters'
        - $ref: '#/components/schemas/MissingRequestBody'
        - $ref: '#/components/schemas/RouteDeprecated'
        - $ref: '#/components/schemas/SchemeNotSupported'
        - $ref: '#/components/schemas/UnknownError'
        - $ref: '#/components/schemas/UnspecifiedInternalError'
        - $ref: '#/components/schemas/ValidationError'
        - $ref: '#/components/schemas/VerbNotImplemented'
    AlreadyExists:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    AuthorizationFailed:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    AuthorizationFailedForAPIKey:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    AuthorizationFailedForUser:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    AuthorizationMissing:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    BadEncoding:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    BadOrigin:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    DoesNotExist:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    InsufficientAPIKey:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    InvalidAPIKey:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    InvalidHeader:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    InvalidParameters:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    InvalidRequestBody:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    MissingHeader:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    MissingOrigin:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    MissingParameters:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    MissingRequestBody:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    RouteDeprecated:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    SchemeNotSupported:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    UnknownError:
      required:
        - s
        - co
        - m
      type: object
      properties:
        s:
          $ref: '#/components/schemas/HttpStatus'
        co:
          type: integer
          format: int32
        m:
          type: string
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    UnspecifiedInternalError:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    ValidationError:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    VerbNotImplemented:
      type: object
      properties:
        c:
          type: string
        d:
          $ref: '#/components/schemas/JsonObject'
    JsonObject:
      type: object
    HttpStatus:
      required:
        - code
      type: object
      properties:
        code:
          type: integer
          format: int32

````