FaxTerra Uploads API

Upload a document, then finalize it before sending.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 3

POST /uploads Get a URL to upload one document to #
POST /uploads/{fileKey}/finalize Prepare an uploaded document and count its pages #
POST /uploads/from-url Fetch a document from a link, and prepare it #

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/faxterra-com:faxterra-com-uploads-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

faxterra-com-uploads-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: FaxTerra Uploads API
  version: '1'
  description: 'Send faxes from code or an agent, on the same account, prices and free pages as the website. Sign in with an emailed code and the person’s acceptance of the Terms, upload, send, then poll each fax at its nextCheckAfter. The same calls are MCP tools at /api/v1/mcp (streamable HTTP), for an AI assistant connected with OAuth or any v1 credential. A body field or query parameter an operation doesn’t take is refused with VALIDATION_ERROR and its name in error.field, on every operation that takes a token or key; the three public reads (the guide, this document and the price list) ignore one. Each operation lists the error codes it can answer. Calls from a web page to the REST endpoints are not supported. They send no CORS headers, and an OPTIONS preflight gets 204 with an Allow header and no Access-Control headers, which a browser refuses. A token or API key is a secret that a web page would show to anyone who opens it, so call from a server, or from an app or agent that keeps the credential to itself. The MCP endpoint is the one exception: it answers a browser’s preflight, for assistants that connect from a browser with OAuth. A fax to a test number is never dialled and uses no pages: +12015550100 (echo), +12015550101 (delivered), +12015550102 (busy then delivered), +12015550103 (no answer), +12015550104 (voice line). POST /webhooks/{id}/test sends an endpoint a signed test event of any type. During early access, any change to v1, breaking or not, can take effect the day the changelog lists it. Changes to v1, and what counts as breaking: https://faxterra.com/developers/changes.'
servers:
- url: https://faxterra.com/api/v1
security:
- bearerAuth: []
tags:
- name: Uploads
  description: Upload a document, then finalize it before sending.
paths:
  /uploads:
    post:
      operationId: createUpload
      tags:
      - Uploads
      summary: Get a URL to upload one document to
      description: PUT the file to uploadUrl with exactly uploadHeaders and exactly fileSize bytes, within 300 seconds. After that the URL stops working and you ask for a new one. Then finalize it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                fileName:
                  type: string
                  minLength: 1
                  description: The document’s name, with its extension
                contentType:
                  enum:
                  - application/pdf
                  - image/jpeg
                  - image/png
                  - image/heic
                  - image/heif
                  - image/tiff
                  - image/gif
                  - image/bmp
                  - image/webp
                  - application/vnd.openxmlformats-officedocument.wordprocessingml.document
                  - application/msword
                  description: The document’s type; the PUT must send the same Content-Type
                fileSize:
                  type: integer
                  minimum: 1
                  maximum: 209715200
                  description: The file’s exact size in bytes. uploadUrl accepts a PUT of this length only, and refuses any other with 403
              required:
              - fileName
              - contentType
              - fileSize
              additionalProperties: false
            example:
              fileName: invoice-1042.pdf
              contentType: application/pdf
              fileSize: 48213
      responses:
        '200':
          description: PUT the file to uploadUrl with uploadHeaders, then finalize it
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    const: true
                  data:
                    type: object
                    properties:
                      fileKey:
                        type: string
                      uploadUrl:
                        type: string
                        format: uri
                        description: Usable for 300 seconds
                      uploadMethod:
                        const: PUT
                      uploadHeaders:
                        type: object
                        additionalProperties:
                          type: string
                    required:
                    - fileKey
                    - uploadUrl
                    - uploadMethod
                    - uploadHeaders
                required:
                - success
                - data
              example:
                success: true
                data:
                  fileKey: 3f2504e0-4f89-41d3-9a0c-0305e82c3301.pdf
                  uploadUrl: https://storage.example/uploads/<userId>/3f2504e0-4f89-41d3-9a0c-0305e82c3301.pdf?X-Amz-Signature=…
                  uploadMethod: PUT
                  uploadHeaders:
                    Content-Type: application/pdf
        '400':
          description: '`VALIDATION_ERROR` with `error.field`: a type we can’t fax, a file over the size limit, or a field this call does not take.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - VALIDATION_ERROR
                      required:
                      - code
                  required:
                  - error
        '401':
          description: '`UNAUTHORIZED`: no valid token or key (missing, wrong or expired). `TOKEN_REVOKED`: the person’s API sign-ins were signed out. `SESSION_INVALID`: the person this sign-in names no longer exists. In each case, sign in again with a new code; the same token will not work again. If POST /auth/token then answers `ACCOUNT_DELETED`, the account was deleted.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - UNAUTHORIZED
                          - TOKEN_REVOKED
                          - SESSION_INVALID
                          - ACCOUNT_DELETED
                      required:
                      - code
                  required:
                  - error
        '403':
          description: '`HIPAA_ACCOUNT`: the account gained the HIPAA add-on after this sign-in, and apps and AI assistants can’t sign in to it; signing in again will not help. On a received fax’s document, it means the account held that fax while it had the add-on, and apps and AI assistants can’t open it even after the add-on ends. `KEY_ATTESTATION_REQUIRED`: this API key predates the account’s HIPAA add-on and is paused until an owner or admin confirms it in Settings. `INSUFFICIENT_SCOPE`: the call is outside what the assistant was connected to do. One connected read only asked to send, change or delete something, or one connected send only asked to open, mark or delete a received fax, or to open a sent document.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - HIPAA_ACCOUNT
                          - KEY_ATTESTATION_REQUIRED
                          - INSUFFICIENT_SCOPE
                      required:
                      - code
                  required:
                  - error
        '409':
          description: '`ACCOUNT_UNAVAILABLE`: this person can no longer act in the account the credential names (they were removed from it); `error.message` says what to do.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - ACCOUNT_UNAVAILABLE
                      required:
                      - code
                  required:
                  - error
        '429':
          description: '`RATE_LIMITED`: too many requests on this sign-in. It always carries `Retry-After` (also `error.retryAfter`). Wait that many seconds, then try again. A 429 with no JSON body is the limit on calls from one IP address. Wait 1 minute, then try again. `UPLOAD_LIMITED`: too many upload requests on this sign-in (an API key, a connected assistant, or a person’s emailed-code sign-ins). It carries no `Retry-After`. Wait a minute, and do not retry in a loop.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - RATE_LIMITED
                          - UPLOAD_LIMITED
                      required:
                      - code
                  required:
                  - error
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before trying again
        '500':
          description: '`INTERNAL_ERROR`: something went wrong on our side. Try again.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - INTERNAL_ERROR
                      required:
                      - code
                  required:
                  - error
  /uploads/{fileKey}/finalize:
    post:
      operationId: finalizeUpload
      tags:
      - Uploads
      summary: Prepare an uploaded document and count its pages
      description: Converts Word and TIFF to PDF and counts the pages. A PDF or an image takes seconds; a large Word or TIFF file can take minutes, up to 300 seconds, so let the request run that long.
      parameters:
      - name: fileKey
        in: path
        required: true
        description: The fileKey from POST /uploads
        schema:
          type: string
      responses:
        '200':
          description: Ready to send
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    const: true
                  data:
                    type: object
                    properties:
                      fileKey:
                        type: string
                      pageCount:
                        type: integer
                      kind:
                        enum:
                        - document
                        - image
                    required:
                    - fileKey
                    - pageCount
                    - kind
                required:
                - success
                - data
              example:
                success: true
                data:
                  fileKey: 3f2504e0-4f89-41d3-9a0c-0305e82c3301.pdf
                  pageCount: 2
                  kind: document
        '400':
          description: '`VALIDATION_ERROR`: not a fileKey from POST /uploads.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - VALIDATION_ERROR
                      required:
                      - code
                  required:
                  - error
        '401':
          description: '`UNAUTHORIZED`: no valid token or key (missing, wrong or expired). `TOKEN_REVOKED`: the person’s API sign-ins were signed out. `SESSION_INVALID`: the person this sign-in names no longer exists. In each case, sign in again with a new code; the same token will not work again. If POST /auth/token then answers `ACCOUNT_DELETED`, the account was deleted.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - UNAUTHORIZED
                          - TOKEN_REVOKED
                          - SESSION_INVALID
                          - ACCOUNT_DELETED
                      required:
                      - code
                  required:
                  - error
        '403':
          description: '`HIPAA_ACCOUNT`: the account gained the HIPAA add-on after this sign-in, and apps and AI assistants can’t sign in to it; signing in again will not help. On a received fax’s document, it means the account held that fax while it had the add-on, and apps and AI assistants can’t open it even after the add-on ends. `KEY_ATTESTATION_REQUIRED`: this API key predates the account’s HIPAA add-on and is paused until an owner or admin confirms it in Settings. `INSUFFICIENT_SCOPE`: the call is outside what the assistant was connected to do. One connected read only asked to send, change or delete something, or one connected send only asked to open, mark or delete a received fax, or to open a sent document.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - HIPAA_ACCOUNT
                          - KEY_ATTESTATION_REQUIRED
                          - INSUFFICIENT_SCOPE
                      required:
                      - code
                  required:
                  - error
        '404':
          description: '`FILE_NOT_FOUND`: nothing was uploaded to this fileKey yet; PUT the file to its uploadUrl first.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - FILE_NOT_FOUND
                      required:
                      - code
                  required:
                  - error
        '409':
          description: '`ACCOUNT_UNAVAILABLE`: this person can no longer act in the account the credential names (they were removed from it); `error.message` says what to do.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - ACCOUNT_UNAVAILABLE
                      required:
                      - code
                  required:
                  - error
        '422':
          description: '`FILE_INVALID`: the file can’t be faxed as it is. `PDF_PASSWORD_REQUIRED`: the PDF needs a password to open; remove it and upload again.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - FILE_INVALID
                          - PDF_PASSWORD_REQUIRED
                      required:
                      - code
                  required:
                  - error
        '429':
          description: '`RATE_LIMITED`: too many requests on this sign-in. It always carries `Retry-After` (also `error.retryAfter`). Wait that many seconds, then try again. A 429 with no JSON body is the limit on calls from one IP address. Wait 1 minute, then try again.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - RATE_LIMITED
                      required:
                      - code
                  required:
                  - error
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before trying again
        '500':
          description: '`INTERNAL_ERROR`: something went wrong on our side. Try again.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - INTERNAL_ERROR
                      required:
                      - code
                  required:
                  - error
  /uploads/from-url:
    post:
      operationId: uploadFromUrl
      tags:
      - Uploads
      summary: Fetch a document from a link, and prepare it
      description: Fetches an https link (port 443) to a PDF, an image or a Word document, up to 200 MB, within 30 seconds and up to 3 redirects, then finalizes it as POST /uploads/{fileKey}/finalize does. A link to a private or internal address, at any hop, is refused. An account's uploads from a link can fetch 1 GB a day (account.linkUploadBudget); past that, LINK_LIMIT_REACHED says when to try again.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: An https link to the document
                filename:
                  type: string
                  maxLength: 200
                  description: The document’s name, like referral.pdf
              required:
              - url
              additionalProperties: false
            example:
              url: https://records.example/referral.pdf
              filename: referral.pdf
      responses:
        '200':
          description: Ready to send
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    const: true
                  data:
                    type: object
                    properties:
                      fileKey:
                        type: string
                      pageCount:
                        type: integer
                      kind:
                        enum:
                        - document
                        - image
                    required:
                    - fileKey
                    - pageCount
                    - kind
                required:
                - success
                - data
              example:
                success: true
                data:
                  fileKey: 3f2504e0-4f89-41d3-9a0c-0305e82c3301.pdf
                  pageCount: 2
                  kind: document
        '400':
          description: '`URL_NOT_ALLOWED`: not https on port 443, a private or internal address, or a redirect to one. `URL_FETCH_FAILED`: the link did not answer the document. `URL_TOO_MANY_REDIRECTS`. `VALIDATION_ERROR` with `error.field`.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - URL_NOT_ALLOWED
                          - URL_FETCH_FAILED
                          - URL_TOO_MANY_REDIRECTS
                          - VALIDATION_ERROR
                      required:
                      - code
                  required:
                  - error
        '401':
          description: '`UNAUTHORIZED`: no valid token or key (missing, wrong or expired). `TOKEN_REVOKED`: the person’s API sign-ins were signed out. `SESSION_INVALID`: the person this sign-in names no longer exists. In each case, sign in again with a new code; the same token will not work again. If POST /auth/token then answers `ACCOUNT_DELETED`, the account was deleted.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - UNAUTHORIZED
                          - TOKEN_REVOKED
                          - SESSION_INVALID
                          - ACCOUNT_DELETED
                      required:
                      - code
                  required:
                  - error
        '403':
          description: '`HIPAA_ACCOUNT`: the account gained the HIPAA add-on after this sign-in, and apps and AI assistants can’t sign in to it; signing in again will not help. On a received fax’s document, it means the account held that fax while it had the add-on, and apps and AI assistants can’t open it even after the add-on ends. `KEY_ATTESTATION_REQUIRED`: this API key predates the account’s HIPAA add-on and is paused until an owner or admin confirms it in Settings. `INSUFFICIENT_SCOPE`: the call is outside what the assistant was connected to do. One connected read only asked to send, change or delete something, or one connected send only asked to open, mark or delete a received fax, or to open a sent document.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - HIPAA_ACCOUNT
                          - KEY_ATTESTATION_REQUIRED
                          - INSUFFICIENT_SCOPE
                      required:
                      - code
                  required:
                  - error
        '409':
          description: '`ACCOUNT_UNAVAILABLE`: this person can no longer act in the account the credential names (they were removed from it); `error.message` says what to do.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - ACCOUNT_UNAVAILABLE
                      required:
                      - code
                  required:
                  - error
        '413':
          description: '`FILE_TOO_LARGE`: the document is over the upload size limit.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - FILE_TOO_LARGE
                      required:
                      - code
                  required:
                  - error
        '415':
          description: '`URL_UNSUPPORTED_TYPE`: the link is not a PDF, an image or a Word document.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - URL_UNSUPPORTED_TYPE
                      required:
                      - code
                  required:
                  - error
        '422':
          description: '`FILE_INVALID` or `PDF_PASSWORD_REQUIRED`: fetched, but it can''t be faxed as it is.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - FILE_INVALID
                          - PDF_PASSWORD_REQUIRED
                      required:
                      - code
                  required:
                  - error
        '429':
          description: '`RATE_LIMITED`: too many requests on this sign-in. It always carries `Retry-After` (also `error.retryAfter`). Wait that many seconds, then try again. A 429 with no JSON body is the limit on calls from one IP address. Wait 1 minute, then try again. `LINK_LIMIT_REACHED` with `Retry-After`: the account''s uploads from a link can fetch 1 GB a day (account.linkUploadBudget on GET /account), and this document is larger than what is left. A fetch counts what it downloaded against the budget. Uploading the file itself (POST /uploads) still works.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - RATE_LIMITED
                          - LINK_LIMIT_REACHED
                      required:
                      - code
                  required:
                  - error
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before trying again
        '500':
          description: '`INTERNAL_ERROR`: something went wrong on our side. Try again.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - INTERNAL_ERROR
                      required:
                      - code
                  required:
                  - error
        '504':
          description: '`URL_TIMEOUT`: the download took too long.'
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Error'
                - type: object
                  properties:
                    error:
                      type: object
                      properties:
                        code:
                          enum:
                          - URL_TIMEOUT
                      required:
                      - code
                  required:
                  - error
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          const: false
        error:
          type: object
          properties:
            code:
              type: string
              description: 'What went wrong, stable: act on this'
            message:
              type: string
              description: The same, written for a person
            field:
              type: string
              description: The request field at fault, dotted (`files.0.fileKey`), when one is
            reason:
              type: string
              description: 'With `field`: the check it failed (`unrecognized_keys`, `invalid_format`, `invalid_number`, …)'
            retryAfter:
              type: integer
              description: 'On a request-limit 429: seconds to wait, as in Retry-After. Absent on a sending limit or TOO_MANY_ATTEMPTS.'
            version:
              type: string
              description: 'On `TOS_REQUIRED` at sign-in: the Terms version to send as acceptTerms'
            termsUrl:
              type: string
              format: uri
              description: 'On `TOS_REQUIRED` at sign-in: where the Terms are'
          required:
          - code
          - message
      required:
      - success
      - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A token from POST /auth/token, or an API key (ftk_…), as "Authorization: Bearer <token>". A token the FaxTerra app holds does not work here. A token acts in the person’s default account: their own signup account when they are an active member of it, otherwise their first active membership. An API key is bound to the one account it was created in and acts in that one, as the person who created it. No cookie or header on the request changes which account. Keep a token or key secret, like a password: never in a URL or a log.'