---
title: Uploads an image to be used for testimonials.
slug: uploads-an-image-to-be-used-for-testimonials
docTags: 
createdAt: 2025-08-10T07:26:32.596Z
---

{
  "id": "JC8jbDaoWW1ti2qxyCHAl",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.usetrust.app/v1/contacts/upload-image/{workspaceId}",
    "servers": [],
    "name": "Uploads an image to be used for testimonials.",
    "description": "",
    "contentType": "multipart/form-data",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "workspaceId",
          "type": "string",
          "description": "<p>The id of the registered workspace (format of Guid).</p>"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "file",
              "kind": "optional",
              "type": "string<binary>",
              "description": "The image to be uploaded in a FormData (content-type: multipart/form-data).",
              "example": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [
        {
          "name": "file",
          "kind": "optional",
          "type": "string<binary>",
          "description": "The image to be uploaded in a FormData (content-type: multipart/form-data).",
          "example": ""
        }
      ],
      "oAuthParameters": [
        {
          "id": "basic",
          "name": "basic",
          "kind": "optional",
          "type": "http",
          "description": "Basic Authentication header",
          "scheme": "basic"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Returns the url to the uploaded image.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "string",
            "description": "",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "string",
            "description": "",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "ojJRDD56pJZImEzSIvfOY",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.usetrust.app/v1/contacts/upload-image/{workspaceId} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "7kt83FBBtgd_8Yr178-Tc",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"multipart/form-data\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.usetrust.app/v1/contacts/upload-image/{workspaceId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "o6tPW7P6TlXNcvZvPWDlN",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.usetrust.app/v1/contacts/upload-image/{workspaceId}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"multipart/form-data\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "dpNisEapSfTzbctCDD1xy",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"https://api.usetrust.app/v1/contacts/upload-image/{workspaceId}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'multipart/form-data'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        },
        {
          "id": "fqj65WBLu2yrLvpgAAGJb",
          "language": "csharp",
          "label": "C#",
          "code": "var options = new RestClientOptions(\"https://api.usetrust.app\")\n{\n   MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"/v1/contacts/upload-image/{workspaceId}\", Method.Post);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"multipart/form-data\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
        }
      ],
      "selectedLanguageId": "ojJRDD56pJZImEzSIvfOY"
    },
    "results": {
      "languages": [
        {
          "id": "k0RCuOg8Vvm4sPm7sy1hP",
          "language": "200",
          "code": "// Returns the url to the uploaded image.\n"
        },
        {
          "id": "qfJK_zEsEINxTeevS6YnL",
          "language": "400",
          "code": "// Bad Request\n\"\""
        },
        {
          "id": "Y1U9uuhbvedOK9xHU-tg3",
          "language": "500",
          "code": "// Internal Server Error\n\"\""
        }
      ],
      "selectedLanguageId": "k0RCuOg8Vvm4sPm7sy1hP"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}