> ## 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.

# Get all segments for an import

> Retrieves all segments for an import. This is a paginated endpoint and takes an optional pagination token as a query parameter. If no token is provided then it retrieves the first page of results.



## OpenAPI

````yaml GET /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:
    get:
      tags:
        - v1
      summary: Get all segments for an import.
      description: >-
        Retrieves all segments for an import. This is a paginated endpoint and
        takes an optional pagination token as a query parameter. If no token is
        provided then it retrieves the first page of results.
      operationId: getImportsImportidSegments
      parameters:
        - name: importId
          in: path
          description: Import ID
          required: true
          schema:
            type: string
            format: uuid
          example: 32f8e031-c532-41bb-b25e-65bdb677a96f
        - name: pagination_token
          in: query
          description: Pagination Token
          required: false
          schema:
            type: string
          examples:
            '123':
              value: MTIzNA==
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_Segment'
              example:
                elements:
                  - id: 1b890475-1482-496d-bcfd-6b2f5564b249
                    code: '1234'
                    name: Segment Name
                    import_id: 9f87bd3e-32eb-4d15-8e85-17fb275fa809
                    description: segment description
                    cpm: 2
                    categories:
                      - category_1
                    updated_at: '2023-04-12T11:27:00.716632Z'
                pagination:
                  next_token: MTIzNA==
                  total_count: 5
        '400':
          description: >-
            Invalid value for: path parameter importId, Invalid value for: query
            parameter pagination_token
          content:
            text/plain:
              schema:
                type: string
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
components:
  schemas:
    PaginatedResponse_Segment:
      required:
        - pagination
      type: object
      properties:
        elements:
          type: array
          items:
            $ref: '#/components/schemas/Segment'
        pagination:
          $ref: '#/components/schemas/Pagination'
    HttpErrorResponse:
      required:
        - requestId
        - error
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        error:
          $ref: '#/components/schemas/HttpError'
    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
    Pagination:
      type: object
      properties:
        nextToken:
          $ref: '#/components/schemas/PaginationToken'
        totalCount:
          $ref: '#/components/schemas/PaginationCount'
    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'
    PaginationToken:
      required:
        - value
      type: object
      properties:
        value:
          type: string
    PaginationCount:
      required:
        - value
      type: object
      properties:
        value:
          type: integer
          format: int64
    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

````