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

# Get a Rule

> Returns a Rule by ID.



## OpenAPI

````yaml /openapi/phrase-style-guides.json get /api/v1/rules/{id}
openapi: 3.1.0
info:
  version: 1.1.0
  title: Style Guide API
  description: REST API for managing Style Guides on the Phrase Platform
  contact:
    name: Linguistic Assets
    email: engineering@phrase.com
servers:
  - url: https://eu.phrase.com/styleguide
    description: Production EU
  - url: https://us.phrase.com/styleguide
    description: Production US
security:
  - bearerAuth: []
tags:
  - name: Style Guide
    description: Public API for managing Style Guides
  - name: Rule
    description: Public API for managing Rules
paths:
  /api/v1/rules/{id}:
    get:
      tags:
        - Rule
      summary: Get a Rule
      description: Returns a Rule by ID.
      operationId: getRule
      parameters:
        - name: id
          in: path
          description: Rule ID
          required: true
          schema:
            type: string
            format: uuid
          example: 01900000-0000-7000-8000-000000000001
      responses:
        '200':
          description: Rule retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleResponse'
        '401':
          description: Unauthorized - Invalid or missing authentication token
        '403':
          description: 'Forbidden - Insufficient permissions. Error codes: ACCESS_DENIED.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 'Rule not found. Error codes: RULE_NOT_FOUND.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RuleResponse:
      type: object
      description: Rule details
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for this Rule
          example: 01900000-0000-7000-8000-000000000001
        rule:
          type: string
          description: The rule text
          example: Avoid passive voice in all user-facing content.
        active:
          type: boolean
          description: Whether this rule is active
        aiCheckEnabled:
          type: boolean
          description: Whether this rule is used during AI-powered quality checks
        allContentGroups:
          type: boolean
          description: Whether this rule applies to all content groups
        allLanguages:
          type: boolean
          description: Whether this rule applies to all languages
        styleGuide:
          $ref: '#/components/schemas/StyleGuideDetails'
          type: 'null'
          description: >-
            Style Guide this rule was extracted from. Null when the rule is
            unlinked — either manually created or subsequently edited.
        contentGroups:
          type:
            - array
            - 'null'
          description: >-
            Content Groups this rule applies to. Empty list means all content
            groups. Null means no content groups are assigned.
          items:
            $ref: '#/components/schemas/ContentGroupDetails'
        languages:
          type:
            - array
            - 'null'
          description: >-
            Language details for languages this rule applies to. Empty list
            means all languages. Null means no languages are assigned.
          items:
            $ref: '#/components/schemas/SupportedLanguageResponse'
        createdAt:
          type: string
          format: date-time
          description: When this rule was created
          example: '2024-01-15T10:30:00Z'
        lastModifiedAt:
          type: string
          format: date-time
          description: When this rule was last modified
          example: '2024-06-01T14:22:00Z'
        createdBy:
          $ref: '#/components/schemas/UserReference'
          type: 'null'
          description: User who created this rule
        lastModifiedBy:
          $ref: '#/components/schemas/UserReference'
          type: 'null'
          description: User who last modified this rule
      required:
        - active
        - aiCheckEnabled
        - allContentGroups
        - allLanguages
        - contentGroups
        - createdAt
        - id
        - languages
        - lastModifiedAt
        - rule
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        detail:
          type: string
    StyleGuideDetails:
      type: object
      description: Style Guide reference
      properties:
        id:
          type: string
          format: uuid
          description: Style Guide ID
          example: 01900000-0000-7000-8000-000000000002
        name:
          type: string
          description: Style Guide name
          example: English Style Guide
      required:
        - id
        - name
    ContentGroupDetails:
      type: object
      description: Content Group reference
      properties:
        id:
          type: string
          description: Content Group ID
          example: cg-marketing-en
    SupportedLanguageResponse:
      type: object
      description: Supported Style Guide language
      properties:
        bcpCode:
          type: string
          description: Language code in BCP-47 format (more specifically RFC 5646 format)
          example: en-GB
        description:
          type: string
          description: Human-readable language name in English
          example: English (United Kingdom)
        region:
          type: string
          description: Region code, or null if not present
          example: gb
        script:
          type: string
          description: Script code when defined, or null
          enum:
            - ARAB
            - ARMN
            - BENG
            - CANS
            - CYRL
            - DEVA
            - GREK
            - GURU
            - HANG
            - HANS
            - HANT
            - HEBR
            - HMNG
            - JPAN
            - KHMR
            - LAOO
            - LATN
            - MONG
            - MTEI
            - MYMR
            - OLCK
            - ORYA
            - PIQD
            - ROHG
            - SIND
            - SYRC
            - TAML
            - TFNG
            - TELU
          example: LATN
        language:
          type: string
          description: ISO 639-1 language code (e.g., 'cs' from 'cs-CZ')
          example: cs
      required:
        - bcpCode
        - description
        - language
    UserReference:
      type: object
      description: User reference
      properties:
        id:
          type: string
          description: User ID
          example: 01900000-0000-7000-8000-000000000003
  securitySchemes:
    bearerAuth:
      type: http
      description: 'JWT from IDM (Authorization: Bearer <token>)'
      scheme: bearer
      bearerFormat: JWT

````