> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://next.developer.frame.io/camera-to-cloud/api-reference/authentication/device-request-code/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://next.developer.frame.io/_mcp/server. # Request device code POST https://api.frame.io/v2/auth/device/code Content-Type: multipart/form-data Reference: https://next.developer.frame.io/camera-to-cloud/api-reference/authentication/device-request-code ## Request ### Headers - `x-client-version` (string, optional, default: 0.0.0) — Firmware or software version of a C2C integration. Will be used to determine the correct Device Model configuration for the device when multiple are available. Must be a valid semantic version. For more on semantic versions, see here: https://semver.org/ - `x-client-platypus-enabled` (enum, optional) — Enable URL Pairing mode for C2C device code requests. Set to 'true' to enable. - Allowed values: `true` ### Body (multipart/form-data) This endpoint expects a multipart form. - `client_id` (string, required) — A unique identifier for the physical hardware device. This value needs to be guaranteed to be unique for the device. This could be a serial number or a randomly generated UUID. - `client_secret` (string, required) — This will be issued to you by Frame.io support and identifies the your device model. This value should be kept secret from the user, and should be encrypted at rest - `scope` (string, required) — Space-delimited list of permissions being requested. Hardware devices can request the following scopes: 'asset_create' (create assets), 'offline' (refresh tokens). Typically both are requested together. ## Response ### 200 Successful request - `device_code` (string, required) — The device code should be hidden from the user, and is used to identify this authorization request when polling to see if the user has entered their code successfully. - `expires_in` (double, required) — The number of seconds until this code expires. - `interval` (double, required) — How long the we should wait between polling requests to see if the user has entered the code. - `name` (string, required) — The name of the device we are trying to connect. - `user_code` (string, required) — The six-digit code the user will enter into Frame.io to pair the device to a project. - `verification_uri` (string, required) — The URL where the user should go to enter the pairing code. - `verification_uri_complete` (string, optional) — A complete URL with the user code pre-filled, which can be used to streamline the pairing process. ## Examples **Request** ```json {} ``` **Response** ```json { "device_code": "a1b2C3d4E5f6G7h8I9j0K1L2M3N4O5P6Q7R8S9T0U1V2W3X4Y5Z6a7b8c9d0e1f2g3h4i5j6k7", "expires_in": 120, "interval": 5, "name": "my-device-abc123", "user_code": "987654", "verification_uri": "https://next.frame.io/pair", "verification_uri_complete": "https://next.frame.io/pair/987654" } ``` **SDK Code** ```typescript const formData = new FormData(); formData.append('client_id', 'your-client-id'); formData.append('client_secret', 'your-client-secret'); formData.append('scope', 'asset_create offline'); const response = await fetch('https://api.frame.io/v2/auth/device/code', { method: 'POST', headers: { 'x-client-platypus-enabled': 'true', 'x-client-version': '1.0.0' }, body: formData }); const result = await response.json(); console.log(result); ``` ```python import requests headers = { 'x-client-platypus-enabled': 'true', 'x-client-version': '1.0.0' } data = { 'client_id': 'your-client-id', 'client_secret': 'your-client-secret', 'scope': 'asset_create offline' } response = requests.post( 'https://api.frame.io/v2/auth/device/code', headers=headers, data=data ) result = response.json() print(result) ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.frame.io/v2/auth/device/code" payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\n") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v2/auth/device/code") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001' request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\n" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.frame.io/v2/auth/device/code") .header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001") .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\n") .asString(); ``` ```php request('POST', 'https://api.frame.io/v2/auth/device/code', [ 'headers' => [ 'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.frame.io/v2/auth/device/code"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001"); request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "multipart/form-data; boundary=---011000010111000001101001"] let parameters = [ [ "name": "client_id", "value": ], [ "name": "client_secret", "value": ], [ "name": "scope", "value": ] ] let boundary = "---011000010111000001101001" var body = "" var error: NSError? = nil for param in parameters { let paramName = param["name"]! body += "--\(boundary)\r\n" body += "Content-Disposition:form-data; name=\"\(paramName)\"" if let filename = param["fileName"] { let contentType = param["content-type"]! let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8) if (error != nil) { print(error as Any) } body += "; filename=\"\(filename)\"\r\n" body += "Content-Type: \(contentType)\r\n\r\n" body += fileContent } else if let paramValue = param["value"] { body += "\r\n\r\n\(paramValue)" } } let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v2/auth/device/code")! 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() ```