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

     1  ---
     2  summary: Delete collection of keys
     3  description: Delete all keys matching query. Same constraints as list. Please limit the number of affected keys to about 1,000 as you might experience timeouts otherwise.
     4  operationId: keys/delete-collection
     5  tags:
     6  - Keys
     7  parameters:
     8  - "$ref": "../../parameters.yaml#/X-PhraseApp-OTP"
     9  - "$ref": "../../parameters.yaml#/project_id"
    10  - description: specify the branch to use
    11    example: my-feature-branch
    12    name: branch
    13    in: query
    14    schema:
    15      type: string
    16  - description: |
    17      Specify a query to do broad search for keys by name (including wildcards).<br><br>
    18      The following qualifiers are also supported in the search term:<br>
    19      <ul>
    20        <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li>
    21        <li><code>name:key_name</code> for text queries on exact key names - spaces, commas, and colons  need to be escaped with double backslashes</li>
    22        <li><code>tags:tag_name</code> to filter for keys with certain tags</li>
    23        <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li>
    24        <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li>
    25        <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li>
    26      </ul>
    27      Find more examples <a href="#overview--usage-examples">here</a>.
    28    example: mykey* translated:true
    29    name: q
    30    in: query
    31    schema:
    32      type: string
    33  - description: Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
    34    example: abcd1234abcd1234abcd1234abcd1234
    35    name: locale_id
    36    in: query
    37    schema:
    38      type: string
    39  responses:
    40    '200':
    41      description: OK
    42      content:
    43        application/json:
    44          schema:
    45            "$ref": "../../schemas/affected_resources.yaml#/affected_resources"
    46      headers:
    47        X-Rate-Limit-Limit:
    48          "$ref": "../../headers.yaml#/X-Rate-Limit-Limit"
    49        X-Rate-Limit-Remaining:
    50          "$ref": "../../headers.yaml#/X-Rate-Limit-Remaining"
    51        X-Rate-Limit-Reset:
    52          "$ref": "../../headers.yaml#/X-Rate-Limit-Reset"
    53    '400':
    54      "$ref": "../../responses.yaml#/400"
    55    '404':
    56      "$ref": "../../responses.yaml#/404"
    57    '429':
    58      "$ref": "../../responses.yaml#/429"
    59  x-code-samples:
    60  - lang: Curl
    61    source: |-
    62      curl "https://api.phrase.com/v2/projects/:project_id/keys" \
    63        -u USERNAME_OR_ACCESS_TOKEN \
    64        -X DELETE \
    65        -d '{"branch":"my-feature-branch","q":"mykey* translated:true","locale_id":"abcd1234abcd1234abcd1234abcd1234"}' \
    66        -H 'Content-Type: application/json'
    67  - lang: CLI v2
    68    source: |-
    69      phrase keys delete-collection \
    70      --project_id <project_id> \
    71      --branch my-feature-branch \
    72      --query 'mykey* translated:true' \
    73      --locale_id abcd1234abcd1234abcd1234abcd1234 \
    74      --access_token <token>
    75  x-cli-version: '2.5'