> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.instabase.com/api-sdk/api-reference/jobs/job-status/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.instabase.com/_mcp/server. # Poll file operation job status GET https://aihub.instabase.com/api/v2/jobs/{job_id} Poll the asynchronous job created during a file operation request such as deleting a batch or file. Reference: https://docs.instabase.com/api-sdk/api-reference/jobs/job-status ## Authentication - `Authorization` header (bearer token, required) — Bearer HTTP authentication. ## Request ### Path parameters - `job_id` (string, required) — The job ID returned by a request. ### Headers - `IB-Context` (string, optional) — Typically your organization ID. See [Authorization and context identification](/api-sdk/authorization#ib-context-header) for details. ## Response ### 200 Request successful - `state` (enum, optional) — The status of the job. - Allowed values: `COMPLETE`, `FAILED`, `CANCELLED`, `RUNNING`, `PENDING` - `message` (string, optional) — Job status message. ## Examples **Response** ```json { "state": "COMPLETE", "message": "string" } ``` **SDK Code** ```python with SDK import time from aihub import AIHub client = AIHub( api_root="https://aihub.instabase.com/api", api_key="abcdefghijklmnopqrst1234567890", ib_context="john.doe_acme.com" ) # start asynchronous job whose status we'll check delete_response = client.batches.delete(batch_id=12345) # poll job status until done while True: status_response = client.jobs.status(job_id=delete_response.job_id) if status_response.state not in ["PENDING", "RUNNING"]: break time.sleep(3) # pause before polling status again ``` ```python without SDK import requests # start asynchronous job whose status we'll check batch_id = 12345 url = f"https://aihub.instabase.com/api/v2/batches/{batch_id}" headers = { "Authorization": "Bearer abcdefghijklmnopqrst1234567890", "IB-Context": "john.doe_acme.com" } delete_response = requests.delete(url, headers=headers) url = f"https://aihub.instabase.com/api/v2/jobs/{delete_response.json()['job_id']}" # make the GET request status_response = requests.get(url, headers=headers) # handle the response if status_response.status_code == 200: print(f"Job status: {status_response.json()['state']}") else: print(f"Error: {status_response.status_code} - {status_response.text}") ``` ```javascript const url = 'https://aihub.instabase.com/api/v2/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://aihub.instabase.com/api/v2/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") 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://aihub.instabase.com/api/v2/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://aihub.instabase.com/api/v2/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://aihub.instabase.com/api/v2/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://aihub.instabase.com/api/v2/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://aihub.instabase.com/api/v2/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers 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() ```