Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
  • App Installations
  • Atlassian GraphQL
  • Confluence
  • Forge Context
  • Forge Dynamic Modules
  • Forge Events
  • Forge KVS
  • Forge LLM
  • Forge Object Store
  • Forge Proxy
  • Forge Realtime
  • Forge SQL
  • Jira
Platform
Forge / Reference / APIs for Forge Containers

Forge SQL

Postman Collection
OpenAPI

Forge SQL Storage REST API for containers

POST

Execute a DML SQL statementExperimental

Executes a SQL statement, and with optional params to be substituted in. This is to be used for DML (Data Manipulation) queries.

DML queries are limited to SELECT, INSERT, UPDATE and DELETE statements.

This is recommended for all user facing requests, as the restrictive permissions limits the potential impact of a client being able to successfully use a query injection attack on your app. Using params will use server side params to further mitigate against these attacks.

The DDL API is available for all other statements, and should be used sparingly, and avoid usage where client provided parameters are included.

Forge and OAuth2 apps cannot access this REST resource.

Request

Header parameters

forge-proxy-authorization

string

Required

Request bodyapplication/json

query

string

Required
params

array<undefined>

Responses

Successful DML execution

application/json

QueryWithParamsResponse
POST/forge/storage/sql/v1/execute
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url '{FORGE_EGRESS_PROXY_URL}/forge/storage/sql/v1/execute' \ --header 'Accept: application/json' \ --header 'forge-proxy-authorization: Forge as=app,id=invocation-123' \ --header 'Content-Type: application/json' \ --data '{ "query": "SELECT name, age FROM users WHERE name = ? AND age = ?", "params": [ "Alice", 30 ] }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 { "rows": [ { "name": "Alice", "age": 30 } ], "metadata": { "dbExecutionTime": 5, "responseSize": 12, "fields": [ { "catalog": "def", "name": "name", "schema": "public", "characterSet": 33, "decimals": 0, "table": "users", "orgTable": "users", "orgName": "name", "flags": 0, "columnType": 1, "columnLength": 255 }, { "catalog": "def", "name": "age", "schema": "public", "characterSet": 33, "decimals": 0, "table": "users", "orgTable": "users", "orgName": "age", "flags": 0, "columnType": 3, "columnLength": 11 } ] } }
POST

Execute a DDL SQL statementExperimental

Executes a SQL statement, and with optional params to be substituted in. This is to be used for DDL (Data Definition) queries.

DDL refers to statements like CREATE, ALTER and DROP. This DDL endpoint is your schema management endpoint and is granted all * permissions to your schema.

We recommended to use this API only when modifying your schema in some way, and doesn’t include user generated params, as there is a chance for higher impact on failure to do so. Use the DML based endpoint for user based requests. The API rate and connection limits are more restrictive than the DML endpoint.

Forge and OAuth2 apps cannot access this REST resource.

Request

Header parameters

forge-proxy-authorization

string

Required

Request bodyapplication/json

query

string

Required
params

array<undefined>

Responses

Successful DDL execution

application/json

QueryWithParamsResponse
POST/forge/storage/sql/v1/execute/ddl
1 2 3 4 5 6 7 8 9 curl --request POST \ --url '{FORGE_EGRESS_PROXY_URL}/forge/storage/sql/v1/execute/ddl' \ --header 'Accept: application/json' \ --header 'forge-proxy-authorization: Forge as=app,id=invocation-123' \ --header 'Content-Type: application/json' \ --data '{ "query": "CREATE TABLE IF NOT EXISTS users (id INT PRIMARY KEY, name TEXT NOT NULL, age INT NOT NULL);", "params": [] }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "rows": { "fieldCount": 0, "affectedRows": 1, "insertId": 0, "info": "", "serverStatus": 2, "warningCount": 0 }, "metadata": { "dbExecutionTime": 10.5, "responseSize": 1234, "fields": [] } }

Rate this page: