> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.pinnacle.sh/v-2/api-reference/tools/refresh-file/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pinnacle.sh/_mcp/server. # Refresh File URLs POST https://api.pinnacle.sh/tools/files/refresh Content-Type: application/json Refresh expiring presigned URLs for Pinnacle-hosted files to extend their access time. This only works for presigned download URLs. At this moment, you cannot refresh a presigned upload URL, generate a new one instead. Reference: https://docs.pinnacle.sh/api-reference/tools/refresh-file ## Authentication - `PINNACLE-API-KEY` header (required) — API Key authentication via header ## Request ### Body (application/json) This endpoint expects a fileRefreshSchema. - `urls` (list of string, required) — Array of file URLs to refresh for extended access. Provided URLs must be presigned URLs (i.e. `https://server.trypinnacle.app/storage/v1/object/sign/...`). Invalid or external URLs will be returned unchanged in the response. ## Response ### 200 Successfully refreshed file URLs. - `list of RefreshedFileUrl` ## Errors ### 400 Bad Request Error Validation failed. The payload has missing required fields and/or invalid types. See [https://zod.dev/error-formatting](https://zod.dev/error-formatting) for more information. - `description` (string, required) — Human-readable summary of validation failures. - `errors` (ZodErrorErrors, required) — Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array ### 401 Unauthorized Error The request lacks valid authentication credentials or the provided credentials are invalid. Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ### 403 Forbidden Error Your subscription does not include access to this feature. This occurs when attempting to use functionality that requires a higher subscription tier. Please upgrade your subscription to access this feature. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ### 500 Internal Server Error An unexpected error occurred on Pinnacle's servers while processing your request. If this error persists, please contact support with the request details. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ## Types ### RefreshedFileUrl - `original` (string, required) — The original file URI that was provided in the request. - `refreshed` (string, required) — The new refreshed presigned URL that expires in one hour. ### ZodErrorErrors Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array ## Examples **Request** ```json { "urls": [ "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "invalid/url", "https://google.com" ] } ``` **Response** ```json [ { "original": "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "refreshed": "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=newtoken" }, { "original": "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "refreshed": "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=newtoken2" }, { "original": "invalid/url", "refreshed": "invalid/url" }, { "original": "https://google.com", "refreshed": "https://google.com" } ] ``` **SDK Code** ```python Refreshed URLs import requests url = "https://api.pinnacle.sh/tools/files/refresh" payload = { "urls": ["https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "invalid/url", "https://google.com"] } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Refreshed URLs const url = 'https://api.pinnacle.sh/tools/files/refresh'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"urls":["https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken","https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2","invalid/url","https://google.com"]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Refreshed URLs package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/tools/files/refresh" payload := strings.NewReader("{\n \"urls\": [\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken\",\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2\",\n \"invalid/url\",\n \"https://google.com\"\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Refreshed URLs require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/tools/files/refresh") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"urls\": [\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken\",\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2\",\n \"invalid/url\",\n \"https://google.com\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Refreshed URLs import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/tools/files/refresh") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"urls\": [\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken\",\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2\",\n \"invalid/url\",\n \"https://google.com\"\n ]\n}") .asString(); ``` ```php Refreshed URLs request('POST', 'https://api.pinnacle.sh/tools/files/refresh', [ 'body' => '{ "urls": [ "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "invalid/url", "https://google.com" ] }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Refreshed URLs using RestSharp; var client = new RestClient("https://api.pinnacle.sh/tools/files/refresh"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"urls\": [\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken\",\n \"https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2\",\n \"invalid/url\",\n \"https://google.com\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Refreshed URLs import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = ["urls": ["https://server.trypinnacle.app/storage/v1/object/sign/vault/3/test.jpg?token=oldtoken", "https://server.trypinnacle.app/storage/v1/object/sign/vault/3/document.pdf?token=oldtoken2", "invalid/url", "https://google.com"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/tools/files/refresh")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > One API for RCS, iMessage, MMS, and SMS. Build, test, and scale every channel — send your first message in minutes, not weeks.