Skip to main content

Status API

Endpoint

Send a HTTP GET request to Onehouse REST API using the endpoint:

https://api.onehouse.ai/v1/status/{requestId}

{requestId} to be be replaced with 'requestId' received in SQL Command API response.

Required Headers

NameDescription
x-onehouse-account-uidID of the account. Find this in the Onehouse UI within the account console as AccountId when you click your profile in the top right.
x-onehouse-project-uidID of the project. Find this in the Onehouse UI for the selected project as ProjectID when you click your profile in the top right.
x-onehouse-api-keyPublic key for your access token. Find this on the 'Tokens' tab of your service principal in the Onehouse console.
x-onehouse-api-secretSecret key for your access token. Find this when you create a new access token on the 'Tokens' tab of your service principal in the Onehouse console.
x-onehouse-link-uidFind this in the Onehouse UI for the selected project as RequestID when you click your profile in the top right.
x-onehouse-regionRegion for the project. Find this in the Onehouse UI on the project selector at the top of the screen. Example format: us-west-1 or us-west1 (all lowercase).
x-onehouse-uuidYour user ID. Find this in the Onehouse UI as UserID when you click your profile in the top right.

Sample Request

For example, you would query: GET https://api.onehouse.ai/v1/status/<id-from-previous-command>. You may leave the body empty.

Sample Response

{
"apiStatus": "API_OPERATION_STATUS_SUCCESS"
"apiResponse": {
<api-response-payload>
}
}

apiStatus

Possible values for apiStatus field:

  • API_OPERATION_STATUS_INVALID: Semantic or Syntax Error in SQL Command API payload statement
  • API_OPERATION_STATUS_PENDING: Operation pending
  • API_OPERATION_STATUS_SUCCESS: Operation completed successfully
  • API_OPERATION_STATUS_FAILED : Operation failed when being executed by controller
  • API_OPERATION_STATUS_SUCCESS_PARTIAL: Operation partially succeeded (some sub-operations may have failed)

apiResponse

apiResponse field depends on the SQL Command API executed.

Rate Limiting

All projects have 10 queries per second. Reach out if you require a higher rate limit.

Python Example

This example checks the status of a specified request id. You can replace the request id with the one returned by your Onehouse SQL API command.

import requests
import json

base_url = "https://api.onehouse.ai/v1/status/"
api_key = "k+m3rTghtLXCVHwBEJAzMQ=="
api_secret = "fRpxkqwUBMN9yjT6+DmPL24zxfhSaWuvKnsBzHG1Bpq="
request_id = "8c3f2e9d-7a16-4d80-5b72-195e783a912f"

# Full URL for the status check
url = f"{base_url}{request_id}"

# Headers (reusing from your previous request, ensure these are correct)
headers = {
'x-onehouse-account-uid': '92e5f1ab-4c3a-4b81-b1fa-ec9c2e14d3f2',
'x-onehouse-project-uid': '3afe72cd-b841-4135-a673-1289c992edf7',
'x-onehouse-api-key': api_key,
'x-onehouse-api-secret': api_secret,
'x-onehouse-link-uid': 'da56fe8b-cde4-532a-9fbb-5edca787b459',
'x-onehouse-region': 'us-west-2',
'Content-Type': 'application/json'
}

try:
print("Sending status check request...")
response = requests.get(url, headers=headers)
print(f"Status code: {response.status_code}")
print("Response headers:")
print(json.dumps(dict(response.headers), indent=2))
print("Response text:")
print(response.text)
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")

print("Script completed.")