TalkJS Files API

Operations related to files

GitHub OpenAPI

Operations 1

POST /v1/{appId}/files Upload a file #

Specifications

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/talkjs:talkjs-files-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

talkjs-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TalkJS Files API
  summary: Manage messages, conversations, users, notifications and app metadata
  description: 'The TalkJS REST API allows you to manage messages, conversations, sessions, users and notifications from your backend. The API is REST-based, using HTTP and JSON. The API only accepts authenticated calls over HTTPS, and uses standard HTTP status codes for reporting results. ## Authentication


    Authentication helps keep your chat and user data secure. ### Single-use token authentication


    The TalkJS REST API works with token-based authentication. Because the REST API has read/write access to all data in your TalkJS account, we recommend using single-use tokens. With single-use tokens, your server generates a new token for each REST API request. Single-use tokens allow you to set an extremely short expiry time for a token. That means that even if you accidentally leak a token, the token will expire before anyone can exploit it. The following are example code snippets in different languages to generate a REST API token that expires after 30 seconds.'
  termsOfService: https://talkjs.com/terms/
  contact:
    name: TalkJS team
    url: https://talkjs.com/?chat
    email: hey@talkjs.com
  license:
    name: MIT License
    url: https://mit-license.org
  version: '2024-01-01'
servers:
- url: https://api.talkjs.com
  description: Production server
security:
- JWTAuth: []
- ApiKeyAuth: []
tags:
- name: Files
  description: Operations related to files
paths:
  /v1/{appId}/files:
    summary: Path for operations on files
    description: 'Use this endpoint to upload files.

      '
    post:
      tags:
      - Files
      summary: Upload a file
      description: 'Uploads a file—such as an image, video, audio file, or document—to the TalkJS servers, so that you can attach the file to a message.


        You can only send content of the type `multipart/form-data` to this endpoint, not a JSON payload.


        For information on how upload a file over HTTP, check the docs of your favorite HTTP client. For example:

        - JavaScript

        - Python (Requests)

        - PHP

        - Ruby (RestClient)


        When uploading a file, you''ll receive an `attachmentToken` in response to your request. To send a message with the uploaded file as an attachment, use the ''Send a message'' resource and include the `attachmentToken` when sending the message.


        ### Troubleshooting


        If you get a 400 Bad Request response, try the following:


        - Check if your code is explicitly setting a `Content-type: multipart/form-data` header. If so, **remove it**. Most HTTP libraries autogenerate this header when uploading files, and they will usually set the header to something like `Content-Type: multipart/form-data; boundary=a3eb698cd620e766f278e52886c572edcb0e4a97`. TalkJS requires the boundary to parse the data.

        - Make sure that the file you''re trying to upload has a `filename` directive set. Many HTTP libraries do this automatically, or allow you to set it explicitly. Setting a filename directive causes the library to generate a header, such as `Content-Disposition: form-data; file="This is a txt file."; filename="sample.txt"` inside the HTTP body. Many HTTP libraries allow you to give an uploaded file a filename.


        If you get a 500 Server Error response, reach out through live support chat.'
      operationId: uploadFile
      parameters:
      - $ref: '#/components/parameters/AppID'
      requestBody:
        $ref: '#/components/requestBodies/UploadFileRequestBody'
      responses:
        '200':
          $ref: '#/components/responses/UploadFileSuccessResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/ResourceNotFoundResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  responses:
    BadRequestResponse:
      description: Bad request
    UnauthorizedResponse:
      description: Authorization information is missing or invalid.
    ResourceNotFoundResponse:
      description: Resource not found
    UploadFileSuccessResponse:
      description: File uploaded successfully.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AttachmentToken'
    TooManyRequestsResponse:
      description: Too many requests
    InternalServerErrorResponse:
      description: Internal server error
  parameters:
    AppID:
      name: appId
      in: path
      description: 'A unique identifier of your TalkJS app. You can find your app ID on the **Settings** page of your [dashboard](https://talkjs.com/dashboard).

        '
      required: true
      schema:
        type: string
        example: abcd1234
  schemas:
    UploadFile:
      description: Details of a file to upload
      type: object
      required:
      - file
      - filename
      properties:
        file:
          description: File data to upload
          type: string
          format: binary
        filename:
          description: Name of the file to upload
          type: string
          example: avatar.jpg
    AttachmentToken:
      description: Attachment token
      type: object
      properties:
        attachmentToken:
          description: 'Attachment token. Use this token to identify a file to attach to a message.


            To obtain an attachment token, first upload the file with the ''Upload a file'' resource.

            '
          type: string
          example: aBcdeFGHijKLMNoPQrsT0123456789
          minLength: 1
  requestBodies:
    UploadFileRequestBody:
      content:
        multipart/form-data:
          schema:
            $ref: '#/components/schemas/UploadFile'
  securitySchemes:
    JWTAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: APIKey
externalDocs:
  description: TalkJS documentation
  url: https://talkjs.com/docs