---
updatedAt: 2026-05-11T06:52:59.000Z
agentTools:
  projectIndex: https://platform.simpplr.com/llms.txt
---

# Upload files for users

This API allows generation of upload URL for user photos and cover images. To set the photo on a user object, 
- Do a PUT to the response URL with the image data returned, including the Authorization: Bearer <access_token> header
- The URL is valid for 5 minutes.
- Call user update API (preferably PATCH) to set the `photoFileId` and `coverImageId` to the file IDs returned in this API response.

**Example request:**
```json
{
  "useFor": "photo",
  "userId": "123e4567-e89b-12d3-a456-426614174000",
  "mimeType": "image/jpeg",
  "size": 1024000
}
```


# OpenAPI definition

````json
{
  "openapi": "3.0.2",
  "info": {
    "version": "1.0.0",
    "title": "Simpplr B2B API Documentation",
    "description": "API documentation for Simpplr B2B integration services",
    "contact": {
      "name": "Simpplr Support"
    }
  },
  "x-proxy-enabled": true,
  "tags": [
    {
      "name": "Feed",
      "description": "Everything about Feed"
    },
    {
      "name": "Users",
      "description": "Everything about Users"
    }
  ],
  "servers": [
    {
      "url": "https://{endpoint}/v1",
      "variables": {
        "env": {
          "default": "app"
        },
        "endpoint": {
          "default": "platform.app.simpplr.com"
        }
      }
    }
  ],
  "paths": {
    "/b2b/identity/users/files": {
      "post": {
        "operationId": "uploadFilesB2b",
        "tags": [
          "Users"
        ],
        "summary": "Upload files for users",
        "description": "This API allows generation of upload URL for user photos and cover images. To set the photo on a user object, \n- Do a PUT to the response URL with the image data returned, including the Authorization: Bearer <access_token> header\n- The URL is valid for 5 minutes.\n- Call user update API (preferably PATCH) to set the `photoFileId` and `coverImageId` to the file IDs returned in this API response.\n\n**Example request:**\n```json\n{\n  \"useFor\": \"photo\",\n  \"userId\": \"123e4567-e89b-12d3-a456-426614174000\",\n  \"mimeType\": \"image/jpeg\",\n  \"size\": 1024000\n}\n```\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "useFor": {
                    "type": "string",
                    "description": "Purpose of the file upload:\n- photo: User profile photo (recommended: square images, preferably 200px x 200px)\n- coverImage: User cover image (recommended: 746px x 304px)\n",
                    "enum": [
                      "photo",
                      "coverImage"
                    ],
                    "example": "photo"
                  },
                  "userId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the user for whom the file is being uploaded",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "MIME type of the file to be uploaded.\nSupported formats:\n- image/png\n- image/jpg\n- image/jpeg\n- image/gif\n",
                    "example": "image/jpeg"
                  },
                  "size": {
                    "type": "number",
                    "description": "Size of the file in bytes.\n- photo limit: 2097152 (2MB)  \n- coverImage limit: 4194304 (4MB)\n",
                    "minimum": 1,
                    "maximum": 4194304,
                    "example": 1024000
                  }
                },
                "required": [
                  "useFor",
                  "userId",
                  "mimeType",
                  "size"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success",
                      "description": "Response status",
                      "enum": [
                        "success",
                        "error"
                      ]
                    },
                    "result": {
                      "type": "object",
                      "description": "Contains the details of the file upload URL",
                      "properties": {
                        "fileId": {
                          "type": "string",
                          "format": "uuid",
                          "example": "27275ee6-d56f-4e52-bc40-a44229d83c86",
                          "description": "Unique identifier for the uploaded file"
                        },
                        "uploadUrl": {
                          "type": "string",
                          "format": "uri",
                          "example": "https://fe-domain/u/o/277b3c02-c912-4c45-8512-867d92e47b84?Content-Type=image%2Fjpeg&X-Amz-Algorithm=.........",
                          "description": "URL to be used for uploading the file"
                        }
                      },
                      "required": [
                        "fileId",
                        "uploadUrl"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "result"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Invalid user object provided",
                      "description": "Error message"
                    },
                    "errors": {
                      "type": "array",
                      "description": "List of validation errors",
                      "items": {
                        "type": "object",
                        "properties": {
                          "fieldName": {
                            "type": "string",
                            "example": "userId",
                            "description": "Name of the field that has an error"
                          },
                          "message": {
                            "type": "string",
                            "example": "userId is required",
                            "description": "Error message for the field"
                          }
                        },
                        "required": [
                          "fieldName",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/paths/~1b2b~1rfeed~1feeds/get/responses/401"
          },
          "403": {
            "$ref": "#/paths/~1b2b~1rfeed~1feeds/get/responses/403"
          }
        }
      }
    },
    "/b2b/rfeed/feeds": {
      "get": {
        "operationId": "getFeedsUser",
        "tags": [
          "Feed"
        ],
        "summary": "Get feeds",
        "description": "This API allows you to retrieve all feeds",
        "parameters": [
          {
            "name": "nextPageToken",
            "in": "query",
            "required": true,
            "description": "Token for pagination. \n- For initial request, send empty string \"\"\n- For subsequent requests, use the nextPageToken returned as integer from previous response\n",
            "schema": {
              "type": "string",
              "example": "1759911721822"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": true,
            "description": "The number of feeds to return per page",
            "schema": {
              "type": "string",
              "example": "16"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "lastActivityAt"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ],
              "default": "all"
            },
            "description": "The filter to apply to the feeds"
          },
          {
            "name": "feedContext",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "home",
                "site",
                "content"
              ],
              "default": "home"
            },
            "description": "The context of the feeds. \n- When set to \"site\", siteId parameter is required\n- When set to \"content\", both siteId and contentId parameters are required\n"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "post",
                "question"
              ],
              "example": "post",
              "description": "The type of feed to return"
            }
          },
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
            },
            "description": "The ID of the site. \nRequired when feedContext is \"site\" or \"content\"\n"
          },
          {
            "name": "contentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
            },
            "description": "The ID of the content.\nRequired when feedContext is \"content\"\n"
          },
          {
            "name": "feedIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "97576a5d-4362-40cb-b8ac-5418b64bf84f,6d54cb3d-da29-461b-8019-3dfb8aa8afe2"
            },
            "description": "The IDs of the feeds to return (send comma-separated list of feed IDs without spaces)"
          },
          {
            "name": "exemptFeedIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "97576a5d-4362-40cb-b8ac-5418b64bf84f,6d54cb3d-da29-461b-8019-3dfb8aa8afe2"
            },
            "description": "The IDs of the feeds to exempt from the search (send comma-separated list of feed IDs without spaces)"
          },
          {
            "name": "isSearchForMarkDuplicate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "example": false
            },
            "description": "Whether to search for mark duplicate feeds(questions)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "nextPageToken": {
                          "type": "integer",
                          "example": 1759911721822
                        },
                        "size": {
                          "type": "integer",
                          "example": 10
                        },
                        "total": {
                          "type": "integer",
                          "example": 11
                        },
                        "listOfItems": {
                          "type": "array",
                          "items": {
                            "$ref": "#/paths/~1b2b~1rfeed~1feeds~1{feedId}/get/responses/200/content/application~1json/schema/properties/result"
                          }
                        },
                        "sortBy": {
                          "type": "string",
                          "example": "lastActivityAt"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "message": {
                      "type": "string",
                      "example": "Failed to get feeds"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "INVALID_INPUT"
                          },
                          "message": {
                            "type": "string",
                            "example": "An error occurred while processing the request"
                          },
                          "cause": {
                            "type": "string",
                            "example": "size is required"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorize error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Missing/Invalid authentication token"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error_code": {
                      "type": "integer",
                      "example": 2001
                    },
                    "message": {
                      "type": "string",
                      "example": "Something went wrong, please try again"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "OAuth2ClientCredentials": {
        "type": "oauth2",
        "description": "This API uses OAuth 2 with the implicit grant flow.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://platform.{env}.simpplr.xyz/v1/identity/oauth/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "OAuth2ClientCredentials": []
    }
  ]
}
````