github.com/phrase/openapi@v0.0.0-20240514140800-49e8a106740e/paths/keys/search.yaml (about)

     1  ---
     2  summary: Search keys
     3  description: Search keys for the given project matching query.
     4  operationId: keys/search
     5  tags:
     6  - Keys
     7  parameters:
     8  - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
     9  - "$ref": "../../parameters.yaml#/project_id"
    10  - "$ref": "../../parameters.yaml#/page"
    11  - "$ref": "../../parameters.yaml#/per_page"
    12  responses:
    13    '200':
    14      description: OK
    15      content:
    16        application/json:
    17          schema:
    18            type: array
    19            items:
    20              "$ref": "../../schemas/translation_key.yaml#/translation_key"
    21      headers:
    22        X-Rate-Limit-Limit:
    23          "$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
    24        X-Rate-Limit-Remaining:
    25          "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
    26        X-Rate-Limit-Reset:
    27          "$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
    28    '400':
    29      "$ref": "../../responses.yaml#/400"
    30    '404':
    31      "$ref": "../../responses.yaml#/404"
    32    '429':
    33      "$ref": "../../responses.yaml#/429"
    34  x-code-samples:
    35  - lang: Curl
    36    source: |-
    37      curl "https://api.phrase.com/v2/projects/:project_id/keys/search" \
    38        -u USERNAME_OR_ACCESS_TOKEN \
    39        -X POST \
    40        -d '{"branch":"my-feature-branch","sort":"updated_at","order":"desc","q":"mykey* translated:true","locale_id":"abcd1234abcd1234abcd1234abcd1234"}' \
    41        -H 'Content-Type: application/json'
    42  - lang: CLI v2
    43    source: |-
    44      phrase keys search \
    45      --project_id <project_id> \
    46      --data '{"branch":"my-feature-branch", "sort":"updated_at", "order":"desc", "q":"'mykey* translated:true'", "locale_id":"abcd1234abcd1234abcd1234abcd1234"}' \
    47      --access_token <token>
    48  requestBody:
    49    required: true
    50    content:
    51      application/json:
    52        schema:
    53          type: object
    54          title: keys/search/parameters
    55          properties:
    56            branch:
    57              description: specify the branch to use
    58              type: string
    59              example: my-feature-branch
    60            sort:
    61              description: 'Sort by field. Can be one of: name, created_at, updated_at.'
    62              type: string
    63              example: updated_at
    64            order:
    65              description: 'Order direction. Can be one of: asc, desc.'
    66              type: string
    67              example: desc
    68            q:
    69              description: |
    70                Specify a query to do broad search for keys by name (including wildcards).<br><br>
    71                The following qualifiers are also supported in the search term:<br>
    72                <ul>
    73                  <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li>
    74                  <li><code>name:key_name,...</code> for text queries on a comma-seperated list of exact key names - spaces, commas, and colons need to be escaped with double backslashes</li>
    75                  <li><code>tags:tag_name,...</code> to filter for keys with certain comma-seperated list of tags</li>
    76                  <li><code>uploads:upload_id,...</code> to filter for keys with certain comma-seperated list of uploads</li>
    77                  <li><code>job:{true|false}</code> to filter for keys mentioned in an active job</li>
    78                  <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li>
    79                  <li><code>updated_at:{&gt;=|&lt;=}2013-02-21T00:00:00Z</code> for date range queries</li>
    80                  <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li>
    81                </ul>
    82                Find more examples <a href="#overview--usage-examples">here</a>.
    83                Please note: If <code>tags</code> are added to filter the search, the search will be limited to a maximum of 65,536 tagged keys.
    84              type: string
    85              example: mykey* translated:true
    86            locale_id:
    87              description: Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
    88              type: string
    89              example: abcd1234abcd1234abcd1234abcd1234
    90  x-cli-version: '2.5'