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

# Export suppressions as CSV

> Streams the account's suppressions as a chunked CSV (server-side
cursor; never materialized). Content-type `text/csv`, header
`Content-Disposition: attachment; filename="email_blocks_export.csv"`.

Filters (`filter[reason]`, `filter[domain_id]`,
`filter[created_after]`, `filter[created_before]`) are the only
params that affect output. `sort` and `page[*]` are **parsed**
(bad values still produce `400`) but **ignored** — rows stream
`ORDER BY created_at ASC, id ASC` with no pagination.

CSV columns: `id,to,from,reason,source,scope,status,domain_id,
created_at,updated_at,expires_at,group_id`. The CSV carries the
`group_id` column so group-scoped suppressions' group link survives
the export (empty for account-scope rows).




## OpenAPI

````yaml /openapi/generated/email/suppressions.yml get /email_blocks/export
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: API for managing email suppression blocks (bounce, complaint, manual).
  title: Telnyx Email Suppressions API
  version: 2.0.0
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /email_blocks/export:
    get:
      tags:
        - Email Suppressions
      summary: Export suppressions as CSV
      description: |
        Streams the account's suppressions as a chunked CSV (server-side
        cursor; never materialized). Content-type `text/csv`, header
        `Content-Disposition: attachment; filename="email_blocks_export.csv"`.

        Filters (`filter[reason]`, `filter[domain_id]`,
        `filter[created_after]`, `filter[created_before]`) are the only
        params that affect output. `sort` and `page[*]` are **parsed**
        (bad values still produce `400`) but **ignored** — rows stream
        `ORDER BY created_at ASC, id ASC` with no pagination.

        CSV columns: `id,to,from,reason,source,scope,status,domain_id,
        created_at,updated_at,expires_at,group_id`. The CSV carries the
        `group_id` column so group-scoped suppressions' group link survives
        the export (empty for account-scope rows).
      operationId: exportEmailBlocks
      parameters:
        - $ref: '#/components/parameters/SortEmailBlocks'
        - $ref: '#/components/parameters/BlocksPageNumber'
        - $ref: '#/components/parameters/BlocksPageSize'
        - $ref: '#/components/parameters/FilterReason'
        - $ref: '#/components/parameters/FilterDomainId'
        - $ref: '#/components/parameters/FilterCreatedAfter'
        - $ref: '#/components/parameters/FilterCreatedBefore'
      responses:
        '200':
          description: CSV stream.
          content:
            text/csv:
              schema:
                type: string
                description: >-
                  CSV with header row
                  `id,to,from,reason,source,scope,status,domain_id,created_at,updated_at,expires_at,group_id`.
        '400':
          $ref: '#/components/responses/ValidationErrorQuery'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '406':
          $ref: '#/components/responses/FrameworkError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.emailBlocks.retrieveExport();

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.email_blocks.retrieve_export()
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.EmailBlocks.GetExport(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    var response = client.emailBlocks().retrieveExport();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.email_blocks.retrieve_export

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->emailBlocks->retrieveExport();

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx email-blocks retrieve-export \
              --api-key 'My API Key'
components:
  parameters:
    SortEmailBlocks:
      name: sort
      in: query
      description: >-
        Sort field. Leading `-` = desc; only `created_at` is sortable. Default
        `-created_at`. `--` is an error.
      schema:
        type: string
        default: '-created_at'
        enum:
          - created_at
          - '-created_at'
    BlocksPageNumber:
      name: page[number]
      in: query
      description: Offset page number (≥1, default 1).
      schema:
        type: integer
        minimum: 1
        default: 1
    BlocksPageSize:
      name: page[size]
      in: query
      description: Page size (1–100, default 25).
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    FilterReason:
      name: filter[reason]
      in: query
      description: Exact-match filter on reason.
      schema:
        $ref: '#/components/schemas/Reason'
    FilterDomainId:
      name: filter[domain_id]
      in: query
      description: Exact-match filter on domain_id (UUID).
      schema:
        type: string
        format: uuid
    FilterCreatedAfter:
      name: filter[created_after]
      in: query
      description: '`created_at > value` (ISO 8601).'
      schema:
        type: string
        format: date-time
    FilterCreatedBefore:
      name: filter[created_before]
      in: query
      description: '`created_at < value` (ISO 8601).'
      schema:
        type: string
        format: date-time
  responses:
    ValidationErrorQuery:
      description: Query-param validation error (`source.pointer /<field>`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorList'
          example:
            errors:
              - code: '10015'
                title: Validation Failed
                detail: is invalid
                source:
                  pointer: /filter[reason]
    Unauthorized:
      description: Missing or invalid gateway auth.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorList'
          example:
            errors:
              - code: '10007'
                title: Unauthorized
                detail: Missing authentication
    FrameworkError:
      description: |
        Framework-rendered error (e.g. 406 Not Acceptable, 405 Method Not
        Allowed, 415 Unsupported Media Type). HTTP status matches the error
        and the body `code` carries that same status (e.g. `"406"`, not a
        hardcoded `"500"`). The explicit `500.json` clause still emits
        `code: "500"` for genuine 500s.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorList'
          example:
            errors:
              - code: '406'
                title: Not Acceptable
                detail: Not Acceptable
  schemas:
    Reason:
      type: string
      enum:
        - hard_bounce
        - spam_complaint
        - unsubscribe
        - invalid
        - manual_block
    ErrorList:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/BlocksErrorObject'
    BlocksErrorObject:
      type: object
      required:
        - code
        - title
        - detail
      properties:
        code:
          type: string
          description: |
            Error codes: `10001` (Not Found), `10007` (Unauthorized),
            `10015` (Validation Failed), `10019` (Internal — import create
            fallback), `40901` (Conflict), `500` (framework/catch-all).
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              type: string
          description: >-
            `/data/attributes/<field>` for changeset/Params; `/<field>` for
            query-param errors.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````