Sinch Fax to Email API

The Emails endpoint allows you to configure the Fax to Email functionality. Fax to Email allows you to send an email and then receive a fax on your Sinch number or send a fax and have it sent to your email address. The service supports sending incoming faxes to multiple email addresses and having many numbers associated with one email address. ## Setting up fax to email You can configure fax to email in two different places: - In the dashboard on a number-by-number basis or by adding an email address and associating many numbers to one email address. - Via the API when you create a number or update a number, or by using the email endpoint to set it up directly - Supported fax to email file types are Word, PDF, and TIF ## Fax to email example The following example shows how to configure Fax to Email using the API: 1. Buy a number in the dashboard and assign it to a Fax service 2. Add your email and associate it with the number you bought in step 1. ```json POST https://fax.api.sinch.com/v3/projects/{projectId}/services/{serviceId}/emails { "email": "user@domain.com", "phoneNumbers": [ { "number": "+14155552222", "permissions": "both" } ] } ``` Now you can use your email client with the above email address to fax. ## Send a fax using email Make sure the email address you are sending from is added to your account. You can add it in the dashboard under the **Fax to email** of your Fax service in the [Build dashboard]https://dashboard.sinch.com/fax/fax-to-email) or via the API. Send an email to {PhoneNumberToSendFaxTo}@sinchfax.com with the following: | Field | Description | | ----- | ----------- | | **Subject:** | If you have multiple phone numbers associated with the email address, enter the number you want to use. If left blank, the first number that we find will be used. | | **Body:** | By default, the email body is not used. | | **Attachments** | Add any attachments you want to fax. If you want to specify the order of pages we recommend that you create one document with all pages in the correct order and attach that document. If you attach multiple documents we will merge them into one document in the order we receive them. | ## Receive a fax using email When you receive a fax, we will send you an email with the following: | Field | Description | | ----- | ----------- | | **From:** | The number the fax was sent from, e.g. +15612600684@sinchfax.com | | **Subject:** | You have received a new fax on {+1 234 555 5555} | | **Body:** | The page count and other metadata are HTML only, and will not appear in plain text in the email. | There will be one PDF attachment with the fax content. ## Configuring your email system for best performance Make sure you allowlist `sinchfax.com` and `sinch.com` in your spam filter to ensure delivery to your inbox, both on client and server side. Ensure your mail server is setup correctly and not on spam lists. ## Encryption All emails are sent using TLS during transport from Sinch.

Operations 9

GET /v3/projects/{projectId}/services/{id}/numbers/{phoneNumber}/emails List emails for a number #
GET /v3/projects/{projectId}/services/{serviceId}/emails List emails #
POST /v3/projects/{projectId}/services/{serviceId}/emails Add an email #
PUT /v3/projects/{projectId}/services/{serviceId}/emails/{email} Update numbers for email #
DELETE /v3/projects/{projectId}/services/{serviceId}/emails/{email} Remove email #
GET /v3/projects/{projectId}/services/{serviceId}/emails/{email}/numbers Get numbers for email #
POST /v3/projects/{project_id}/services/{service_id}/emails Create a Fax-to-email Configuration #
GET /v3/projects/{project_id}/services/{service_id}/emails List Fax-to-email Configurations #
DELETE /v3/projects/{project_id}/services/{service_id}/emails/{email} Delete a Fax-to-email Configuration #

Documentation

📖
Documentation
https://developers.sinch.com/docs/conversation
📖
APIReference
https://developers.sinch.com/docs/conversation/api-reference/template
📖
Documentation
https://developers.sinch.com/docs/est
📖
APIReference
https://developers.sinch.com/docs/est/api-reference/est
📖
Documentation
https://developers.sinch.com/docs/fax
📖
APIReference
https://developers.sinch.com/docs/fax/api-reference/fax
📖
Documentation
https://developers.sinch.com/docs/number-lookup-api-v2
📖
APIReference
https://developers.sinch.com/docs/number-lookup-api-v2/api-reference/number-lookup-v2
📖
Documentation
https://developers.sinch.com/docs/numbers
📖
APIReference
https://developers.sinch.com/docs/numbers/api-reference/imported-hosting
📖
APIReference
https://developers.sinch.com/docs/numbers/api-reference/numbers
📖
APIReference
https://developers.sinch.com/docs/numbers/api-reference/porting
📖
Documentation
https://developers.sinch.com/docs/provisioning-api
📖
APIReference
https://developers.sinch.com/docs/provisioning-api/api-reference/provisioning-api-1
📖
Documentation
https://developers.sinch.com/docs/verification
📖
APIReference
https://developers.sinch.com/docs/verification/api-reference/verification
📖
Documentation
https://developers.sinch.com/docs/voice-2.0
📖
APIReference
https://developers.sinch.com/docs/voice-2.0/api-reference/voice
📖
Documentation
https://developers.sinch.com/docs/10dlc-registration
📖
APIReference
https://developers.sinch.com/docs/10dlc-registration/api-reference/10dlc-registration
📖
Documentation
https://developers.sinch.com/docs/accesskeys
📖
APIReference
https://developers.sinch.com/docs/accesskeys/api-reference/oldaccesskeys
📖
APIReference
https://developers.sinch.com/docs/accesskeys/api-reference/accesskeys
📖
Documentation
https://developers.sinch.com/docs/campaigns
📖
APIReference
https://developers.sinch.com/docs/campaigns/api-reference/campaigns
📖
Documentation
https://developers.sinch.com/docs/chatlayer-analytics
📖
APIReference
https://developers.sinch.com/docs/chatlayer-analytics/api-reference/chatlayer-analytics
📖
Documentation
https://developers.sinch.com/docs/compliance-center
📖
APIReference
https://developers.sinch.com/docs/compliance-center/api-reference/compliance-brands
📖
Documentation
https://developers.sinch.com/docs/subprojects
📖
APIReference
https://developers.sinch.com/docs/subprojects/api-reference/subprojects

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-v2-template-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-v2-list-translations-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-v2-list-templates-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-call-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-sip-trunk-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-sip-endpoint-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-ip-range-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-access-control-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-fax-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-service-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-template-by-name-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-update-template-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-service-phone-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-cover-page-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-lookup-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-lookup-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-hosting-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-qualified-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-text-enable-numbers-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-hosting-order-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-imported-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-imported-numbers-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-active-number-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-rent-any-number-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-validate-address-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-number-order-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-registration-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-order-list-item-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-defaults-configuration-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-pagination-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-voice-configuration-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-order-document-base-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-port-in-order-group-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-account-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-sender-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-template-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-partial-template-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-webhook-webhook-input-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-webhook-update-webhook-input-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-verification-report-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-batch-summary-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-session-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-call-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-service-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-validate-svaml-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-tcr-campaign-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-access-key-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-access-key-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-access-keys-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-access-key-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-update-access-key-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-campaign-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-carrier-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-note-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-campaign-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-campaign-attachment-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-campaign-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-get-flow-step-details-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-get-conversation-flow-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-funnel-step-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-funnel-step-filter-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-get-intents-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-event-definitions-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-brand-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-brand-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-attachment-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-import-brand-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-brand-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-callback-config-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-subproject-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-subprojects-response-schema.json

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sinch:sinch-fax-to-email-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sinch-fax-to-email-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sinch Fax to Email API
  version: '3.0'
  description: 'Operations tagged Fax to Email across 2 of this provider''s published API definitions: sinch-fax-api-openapi.yaml, original-sinch-fax-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://fax.api.sinch.com
  description: v3.0 of the Fax API
tags:
- name: Fax to Email
  description: The Emails endpoint allows you to configure the Fax to Email functionality.
paths:
  /v3/projects/{projectId}/services/{id}/numbers/{phoneNumber}/emails:
    parameters:
    - $ref: '#/components/parameters/ProjectId'
    - name: phoneNumber
      description: The phone number you want to get emails for.
      required: true
      in: path
      schema:
        type: string
        description: A phone number in e.164 format.
        example: '+15612600684'
    - name: id
      description: The serviceId containing the numbers you want to list.
      required: true
      in: path
      schema:
        type: string
    get:
      summary: List emails for a number
      description: List any emails for a number.
      operationId: getEmailsForNumber
      tags:
      - Fax to Email
      parameters:
      - name: page
        in: query
        description: The page to fetch. If not specified, the first page will be returned.
        schema:
          type: integer
          default: 1
          example: 1
      - name: pageSize
        in: query
        schema:
          type: integer
          default: 100
          example: 20
          maximum: 1000
        description: Number of items to return on each page.
      responses:
        '200':
          description: A list of emails associated with the number.
          content:
            application/json:
              schema:
                allOf:
                - type: object
                  properties:
                    emails:
                      description: List of emails numbers
                      type: array
                      items:
                        type: string
                        format: email
                - $ref: '#/components/schemas/Pagination'
      x-codeSamples:
      - lang: Node.js
        source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n  // The Fax Service ID you want to list emails associated with a phone number for\n  const serviceId = 'FAX_SERVICE_ID';\n  // The phone numbers you want to get emails for\n  const phoneNumber ='PHONE_NUMBER';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try {\n    const response = await sinch.fax.faxToEmail.listForNumber({\n      serviceId,\n      phoneNumber,\n    });\n    if (response.data.length === 0) {\n      console.log('No Emails found.');\n      return;\n    }\n    console.log(`✅ Found ${response.data.length} Emails.`);\n    response.data.forEach((email) => {\n      console.log(email);\n    });\n  } catch (err) {\n    console.error(`❌ Failed to list the configured Emails associated with the phone number ${phoneNumber} and to the Fax Service with ID ${serviceId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
      security:
      - BasicAuth: []
      - OAuth2: []
    servers:
    - url: https://fax.api.sinch.com
      description: v3.0 of the Fax API
  /v3/projects/{projectId}/services/{serviceId}/emails:
    parameters:
    - $ref: '#/components/parameters/ProjectId'
    get:
      description: List emails for the project.
      summary: List emails
      operationId: getEmailsForProject
      tags:
      - Fax to Email
      parameters:
      - name: serviceId
        in: path
        description: The serviceId containing the emails you want to list.
        required: true
        schema:
          type: string
      - name: page
        in: query
        description: The page to fetch. If not specified, the first page will be returned.
        schema:
          type: integer
          default: 1
          example: 1
      - name: pageSize
        in: query
        schema:
          type: integer
          default: 100
          example: 20
          maximum: 1000
        description: Number of items to return on each page.
      responses:
        '200':
          description: A list of emails associated with the project.
          content:
            application/json:
              schema:
                allOf:
                - type: object
                  properties:
                    emails:
                      description: List of emails
                      type: array
                      items:
                        $ref: '#/components/schemas/Email'
                - $ref: '#/components/schemas/Pagination'
      x-codeSamples:
      - lang: Node.js
        source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n  // The Fax Service ID you want to list emails for\n  const serviceId = 'FAX_SERVICE_ID';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try {\n    const response = await sinch.fax.faxToEmail.list({ serviceId });\n    if (response.data.length === 0) {\n      console.log('No Emails found.');\n      return;\n    }\n    console.log(`✅ Found ${response.data.length} Emails.`);\n    response.data.forEach((email) => {\n      console.log(email);\n    });\n  } catch (err) {\n    console.error(`❌ Failed to list Emails associated to the Fax Service with ID ${serviceId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
      security:
      - BasicAuth: []
      - OAuth2: []
    post:
      description: Add an email to the specified service to be used for sending and receiving faxes. Default settings for permissions parameter is `both`.
      summary: Add an email
      operationId: createEmailForProject
      tags:
      - Fax to Email
      parameters:
      - name: serviceId
        in: path
        description: The serviceId to which you want to add the email.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Email'
            example:
              email: user@domain.com
              phoneNumbers:
              - number: '+14155552222'
                permissions: both
      responses:
        '201':
          description: The added email
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Email'
      x-codeSamples:
      - lang: Node.js
        source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n  // The Fax Service ID you want to add email for\n  const serviceId = 'FAX_SERVICE_ID';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try {\n    const response = await sinch.fax.faxToEmail.addToNumbers({\n      serviceId,\n      emailRequestBody: {\n        email: 'user@domain.com',\n        phoneNumbers: [\n          {\n            number: '+14155552222',\n            permissions: 'both',\n          },\n        ],\n      },\n    });\n    console.log('✅ Successfully added an Email to the Fax Service.');\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error(`❌ Failed to add an Email to the Fax Service with ID ${serviceId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
      security:
      - BasicAuth: []
      - OAuth2: []
    servers:
    - url: https://fax.api.sinch.com
      description: v3.0 of the Fax API
  /v3/projects/{projectId}/services/{serviceId}/emails/{email}:
    parameters:
    - $ref: '#/components/parameters/ProjectId'
    - name: serviceId
      description: The serviceId containing the email you want to work with.
      required: true
      in: path
      schema:
        type: string
    - name: email
      description: The email you want to work with.
      required: true
      in: path
      schema:
        type: string
    put:
      description: Set the numbers for an email.
      operationId: updateEmail
      summary: Update numbers for email
      tags:
      - Fax to Email
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - phoneNumbers
              properties:
                phoneNumbers:
                  description: List of numbers
                  type: array
                  items:
                    $ref: '#/components/schemas/Number'
            example:
              phoneNumbers:
              - number: '+14155552222'
                permissions: both
      responses:
        '200':
          description: The added email
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Email'
      x-codeSamples:
      - lang: Node.js
        source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n  // The Fax Service ID you want to update the email for\n  const serviceId = 'FAX_SERVICE_ID';\n  // The email address you want to update the phone numbers for\n  const email ='EMAIL_ADDRESS';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try {\n    const response = await sinch.fax.faxToEmail.update({\n      serviceId,\n      email,\n      updateEmailRequestBody: {\n        phoneNumbers: [\n          {\n            number: '+14155552222',\n            permissions: 'both',\n          },\n        ],\n      },\n    });\n    console.log('✅ Successfully updated the Phone Numbers.');\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error(`❌ Failed to update the Phone Numbers associated with the Email ${email} from the Fax Service with ID ${serviceId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
      security:
      - BasicAuth: []
      - OAuth2: []
    delete:
      tags:
      - Fax to Email
      summary: Remove email
      description: Delete an email and associated numbers to that email to disable that email from sending and receiving faxes.
      operationId: deleteEmail
      responses:
        '204':
          description: 'No content: **The email was deleted**'
      x-codeSamples:
      - lang: Node.js
        source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n  // The Fax Service ID you want to remove the email from\n  const serviceId = 'FAX_SERVICE_ID';\n  // The email you want to remove\n  const email ='EMAIL_ADDRESS';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try {\n    await sinch.fax.faxToEmail.delete({\n      serviceId,\n      email,\n    });\n    console.log(`✅ Successfully deleted the Email ${email} from the Fax Service with ID ${serviceId}.`);\n  } catch (err) {\n    console.error(`❌ Failed to delete the Email ${email} from the Fax Service with ID ${serviceId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
      security:
      - BasicAuth: []
      - OAuth2: []
    servers:
    - url: https://fax.api.sinch.com
      description: v3.0 of the Fax API
  /v3/projects/{projectId}/services/{serviceId}/emails/{email}/numbers:
    parameters:
    - $ref: '#/components/parameters/ProjectId'
    - name: serviceId
      description: The serviceId containing the email you want to work with.
      required: true
      in: path
      schema:
        type: string
    - name: email
      description: The email you want to get numbers for.
      required: true
      in: path
      schema:
        type: string
    - name: pageSize
      in: query
      schema:
        type: integer
        default: 20
        example: 20
        maximum: 1000
      description: Number of items to return on each page.
    - name: page
      in: query
      schema:
        type: string
      description: Optional. The page to fetch. If not specified, the first page will be returned.
    get:
      description: Get configured numbers for an email
      summary: Get numbers for email
      operationId: getNumbersByEmail
      tags:
      - Fax to Email
      responses:
        '200':
          description: A list of numbers associated with the email
          content:
            application/json:
              schema:
                allOf:
                - type: object
                  properties:
                    phoneNumbers:
                      description: List of numbers
                      type: array
                      items:
                        $ref: '#/components/schemas/ServicePhoneNumber'
                - $ref: '#/components/schemas/Pagination'
      x-codeSamples:
      - lang: Node.js
        source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n  const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n  const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n  const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n  // The Fax Service ID you want to list phone numbers associated with an email address for\n  const serviceId = 'FAX_SERVICE_ID';\n  // The email address you want to get numbers for\n  const email ='EMAIL_ADDRESS';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try {\n    const response = await sinch.fax.faxToEmail.listNumbers({\n      serviceId,\n      email,\n    });\n    if (response.data.length === 0) {\n      console.log('No Phone Numbers found.');\n      return;\n    }\n    console.log(`✅ Found ${response.data.length} Phone Numbers.`);\n    response.data.forEach((servicePhoneNumber) => {\n      console.log(servicePhoneNumber);\n    });\n  } catch (err) {\n    console.error(`❌ Failed to list the configured Phone Numbers associated with the Email address ${email} and to the Fax Service with ID ${serviceId}:`);\n    console.error(err);\n  }\n}\n\nmain();\n"
      security:
      - BasicAuth: []
      - OAuth2: []
    servers:
    - url: https://fax.api.sinch.com
      description: v3.0 of the Fax API
  /v3/projects/{project_id}/services/{service_id}/emails:
    post:
      operationId: createFaxToEmail
      summary: Create a Fax-to-email Configuration
      description: Configures an email address to receive incoming faxes for a specific fax service.
      tags:
      - Fax to Email
      parameters:
      - $ref: '#/components/parameters/ProjectId_2'
      - $ref: '#/components/parameters/ServiceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FaxToEmailRequest'
      responses:
        '200':
          description: Fax-to-email configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FaxToEmail'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
      security:
      - oAuth2: []
      - basicAuth: []
    get:
      operationId: listFaxToEmails
      summary: List Fax-to-email Configurations
      description: Returns the list of email addresses configured for fax-to-email on a service.
      tags:
      - Fax to Email
      parameters:
      - $ref: '#/components/parameters/ProjectId_2'
      - $ref: '#/components/parameters/ServiceId'
      responses:
        '200':
          description: List of fax-to-email configurations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FaxToEmailList'
        '401':
          description: Unauthorized
      security:
      - oAuth2: []
      - basicAuth: []
    servers:
    - url: https://fax.api.sinch.com
      description: Global Production Server
  /v3/projects/{project_id}/services/{service_id}/emails/{email}:
    delete:
      operationId: deleteFaxToEmail
      summary: Delete a Fax-to-email Configuration
      description: Removes an email address from the fax-to-email configuration.
      tags:
      - Fax to Email
      parameters:
      - $ref: '#/components/parameters/ProjectId_2'
      - $ref: '#/components/parameters/ServiceId'
      - name: email
        in: path
        required: true
        description: The email address to remove
        schema:
          type: string
          format: email
      responses:
        '200':
          description: Fax-to-email configuration removed
        '401':
          description: Unauthorized
        '404':
          description: Configuration not found
      security:
      - oAuth2: []
      - basicAuth: []
    servers:
    - url: https://fax.api.sinch.com
      description: Global Production Server
components:
  schemas:
    Pagination:
      type: object
      readOnly: true
      properties:
        page:
          readOnly: true
          type: integer
          description: Current page
        totalPages:
          readOnly: true
          type: integer
          description: Total number of pages.
        pageSize:
          readOnly: true
          type: integer
          description: Number of items per page.
        totalItems:
          type: integer
          readOnly: true
          format: int32
          description: Total size of the result.
    Email:
      type: object
      required:
      - email
      - phoneNumbers
      properties:
        email:
          type: string
          format: email
          example: user@domain.com
        phoneNumbers:
          description: Numbers you want to associate with this email.
          type: array
          items:
            $ref: '#/components/schemas/Number'
        projectId:
          readOnly: true
          x-version: 1
          allOf:
          - $ref: '#/components/schemas/ProjectId'
        createdAt:
          type: string
          format: date-time
          readOnly: true
          description: The date and time the email configuration was created.
        updatedAt:
          type: string
          format: date-time
          readOnly: true
          description: The date and time the email configuration was last updated.
    PhoneNumber:
      x-PII: true
      x-v1: true
      type: string
      format: phoneNumber
      description: A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading '+'.
      example: '+15551235656'
    Number:
      description: A phone number and its permissions.
      type: object
      properties:
        number:
          $ref: '#/components/schemas/PhoneNumber'
        permissions:
          type: string
          description: Allows you to set permissions for sending and receiving faxes to this email/phone number combination. Default value is `both`.
          x-enumDescriptions:
            both: Allows the email to send and receive faxes to this email/phone number combination.
            send: Allows the email to only send faxes to this email/phone number combination.
            receive: Allows the email to only receive faxes from this email/phone number combination.
          enum:
          - both
          - send
          - receive
          default: both
    ProjectId:
      type: string
      x-PII: false
      x-v1: false
      description: The `Id` of the project associated with the call.
      x-Internal: to support future account keys
      readOnly: true
      example: ae00f005-e392-44dc-b3f5-a657a2684dg3
    ServicePhoneNumber:
      type: object
      properties:
        phoneNumber:
          $ref: '#/components/schemas/PhoneNumber'
        permissions:
          type: string
          description: Allows you to set permissions for sending and receiving faxes to this email/phone number combination. Default value is `both`.
          x-enumDescriptions:
            both: Allows the email to send and receive faxes to this email/phone number combination.
            send: Allows the email to only send faxes to this email/phone number combination.
            receive: Allows the email to only receive faxes from this email/phone number combination.
          enum:
          - both
          - send
          - receive
          default: both
        country:
          readOnly: true
          type: string
          description: The country code of the phone number in ISO 3166-1 alpha-2 format.
          example: US
        suspended:
          type: boolean
          description: Specifies if a number is suspended or not.
          example: true
          readOnly: true
        note:
          type: string
          description: An optional field providing context about the suspension.
          example: Reason for suspending the number.
          readOnly: true
        projectId:
          $ref: '#/components/schemas/ProjectId'
          readOnly: true
        serviceId:
          $ref: '#/components/schemas/ServiceId'
          readOnly: true
    ServiceId:
      x-PII: false
      x-v1: true
      readOnly: true
      type: string
      example: 01GVRB50KEQFFE1SGMPFRNBG6J
      description: ID of the fax service used.
    FaxToEmail:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The configured email address
        phoneNumber:
          type: string
          description: The associated phone number
        serviceId:
          type: string
          description: The service ID
        projectId:
          type: string
          description: The project ID
    FaxToEmailRequest:
      type: object
      required:
      - email
      properties:
        email:
          type: string
          format: email
          description: The email address for fax-to-email
        phoneNumber:
          type: string
          description: Specific phone number to associate
    FaxToEmailList:
      type: object
      properties:
        emails:
          type: array
          description: List of fax-to-email configurations
          items:
            $ref: '#/components/schemas/FaxToEmail'
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      description: The `projectId` is a required parameter you must include when making any API calls. You can find your project ID on your [Build dashboard](https://dashboard.sinch.com).
      schema:
        type: string
        example: 3acb7ae1-cf3d-4112-ba5e-3a9d8c71cd47
    ProjectId_2:
      name: project_id
      in: path
      required: true
      description: The unique project identifier
      schema:
        type: string
    ServiceId:
      name: service_id
      in: path
      required: true
      description: The unique service identifier
      schema:
        type: string
  securitySchemes:
    WebhookBasicAuth:
      type: http
      scheme: basic
      description: 'You can validate whether a webhook is genuine by providing credentials you set and will check on your server side along with the callback URL, as in this example: `https://username:password@www.YourWebhookWebsite.com`'
    BasicAuth:
      type: http
      scheme: basic
      description: The user name and password is your keyId and key secret from the [Access keys sections](https://dashboard.sinch.com/settings/access-keys)
    OAuth2:
      type: oauth2
      description: The user name and password is your key id and key secret from the [Access keys sections](https://dashboard.sinch.com/settings/access-keys)
      flows:
        clientCredentials:
          tokenUrl: https://auth.sinch.com/oauth2/token
          scopes: {}
    oAuth2:
      type: oauth2
      description: OAuth 2.0 client credentials flow.
      flows:
        clientCredentials:
          tokenUrl: https://auth.sinch.com/oauth2/token
          scopes: {}
    basicAuth:
      type: http
      scheme: basic
      description: Application key and secret for basic authentication.
externalDocs:
  description: Sinch Fax API Documentation
  url: https://developers.sinch.com/docs/fax
x-refined-from:
- sinch-fax-api-openapi.yaml
- original-sinch-fax-openapi.yml
x-explorer-enabled: false
x-samples-languages:
- curl
- java
- csharp
- node
- php
x-original-swagger-version: '2.0'