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

# Post attachmentssignature

> Retrieve upload signature.



## OpenAPI

````yaml /swagger.json post /attachments/signature
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
paths:
  /attachments/signature:
    post:
      tags:
        - attachments
      description: Retrieve upload signature.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contentType:
                  type: string
                  example: image/png
                  description: Mime type
                contentLength:
                  type: number
                  example: 123
                  description: File size
                expiresIn:
                  type: number
                  example: 3600
                  description: Token expire time, seconds
                hash:
                  type: string
                  example: xxxxxxxx
                  description: File hash
                type:
                  type: integer
                  enum:
                    - 1
                    - 2
                    - 3
                    - 4
                    - 5
                    - 6
                    - 7
                    - 8
                    - 9
                    - 10
                    - 11
                    - 12
                    - 13
                    - 14
                  example: 1
                  description: Type
                baseId:
                  type: string
              required:
                - contentType
                - contentLength
                - type
      responses:
        '201':
          description: return the upload URL and the key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    example: https://example.com/attachment/upload
                    description: Upload url
                  uploadMethod:
                    type: string
                    example: POST
                    description: Upload method
                  token:
                    type: string
                    example: xxxxxxxx
                    description: Secret key
                  requestHeaders:
                    type: object
                    additionalProperties:
                      nullable: true
                    example:
                      Content-Type: image/png
                required:
                  - url
                  - uploadMethod
                  - token
                  - requestHeaders
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request POST \
              --url https://app.teable.ai/api/attachments/signature \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"contentType":"image/png","contentLength":123,"expiresIn":3600,"hash":"xxxxxxxx","type":1,"baseId":"string"}'
        - lang: JavaScript
          source: |-
            const url = 'https://app.teable.ai/api/attachments/signature';
            const options = {
              method: 'POST',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"contentType":"image/png","contentLength":123,"expiresIn":3600,"hash":"xxxxxxxx","type":1,"baseId":"string"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'POST',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/attachments/signature',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              contentType: 'image/png',
              contentLength: 123,
              expiresIn: 3600,
              hash: 'xxxxxxxx',
              type: 1,
              baseId: 'string'
            }));
            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            payload =
            "{\"contentType\":\"image/png\",\"contentLength\":123,\"expiresIn\":3600,\"hash\":\"xxxxxxxx\",\"type\":1,\"baseId\":\"string\"}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("POST", "/api/attachments/signature", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````