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

# List Attribute definitions

> Returns a cursor-paginated page of Attribute definitions available in the environment.



## OpenAPI

````yaml /reference/study-api-v2.json get /v2/attributes
openapi: 3.1.0
info:
  title: Sprig Public API V2 — Studies
  version: 1.0.0
  description: >-
    Programmatically create and manage Sprig Studies (surveys), their Questions,
    Blocks, invitations, and translations.
  contact:
    name: Support
    email: support@sprig.com
servers:
  - url: https://api.sprig.com
security: []
tags:
  - name: Studies
    description: The root resource for a programmatically managed survey.
  - name: Questions
    description: Questions, with their nested options, owned by a Study.
  - name: Blocks
    description: >-
      Blocks and Pages; Pages are not supported for IN_PRODUCT_SURVEY Studies.
      Group skip and display logic live on the Block. Question logic is member
      display, plus skip logic only outside a Page.
  - name: Invitations
    description: >-
      Invitation codes for SURVEY Studies; invitations are not supported for
      IN_PRODUCT_SURVEY Studies.
  - name: Translations
    description: >-
      Per-locale translated content for a Study, and the asynchronous jobs that
      generate it. Job cancellation is best-effort and does not roll back
      committed output.
  - name: Attributes
    description: Custom Attribute definitions available in the environment.
  - name: Targeting
    description: Event triggers and audience conditions for IN_PRODUCT_SURVEY Studies.
  - name: Events
    description: Existing tracked and page-URL Events available for Study targeting.
paths:
  /v2/attributes:
    get:
      tags:
        - Attributes
      summary: List Attribute definitions
      description: >-
        Returns a cursor-paginated page of Attribute definitions available in
        the environment.
      operationId: listAttributes
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 50
          required: false
          name: limit
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
      responses:
        '200':
          description: Attribute definitions returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAttributesResponse'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The environment API key is missing or invalid, cannot access this
            resource, or the Study API is not available for the account.
      security:
        - EnvironmentApiKey: []
components:
  schemas:
    ListAttributesResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AttributeDefinition'
        cursor:
          type:
            - string
            - 'null'
          description: >-
            Opaque cursor for the next page, or null when this is the final
            page.
      required:
        - data
        - cursor
      additionalProperties: false
      description: A cursor-paginated page of Attribute definitions.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: A machine-readable error code (e.g. STUDY_NOT_FOUND).
        message:
          type: string
          description: A human-readable description of the error.
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              path:
                type: string
              message:
                type: string
              resource:
                type: object
                properties:
                  type:
                    type: string
                  id:
                    type: string
                required:
                  - type
                  - id
                description: >-
                  The other resource this issue points at, when the issue is not
                  about the request itself.
            required:
              - code
              - message
          description: >-
            Per-field validation issues, present when the request itself was
            malformed.
      required:
        - code
        - message
      description: Error response returned by the Public API V2.
    AttributeDefinition:
      type: object
      properties:
        key:
          type: string
          minLength: 1
          description: Stable attribute key used in targeting.
        displayName:
          type: string
          minLength: 1
          description: Display name shown in Sprig.
        valueType:
          type: string
          enum:
            - STRING
            - NUMBER
            - BOOLEAN
          description: Authoring value type for the attribute.
      required:
        - key
        - displayName
        - valueType
      additionalProperties: false
      description: >-
        Environment attribute definition. Observed visitor values are never
        returned.
  securitySchemes:
    EnvironmentApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Use `API-Key YOUR_API_KEY`. The key selects the Production or
        Development environment.

````