Skip to main content
POST
/
v2
/
sql
Query SQL
curl --request POST \
  --url https://api.attio.com/v2/sql \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "sql": "SELECT * FROM companies WHERE companies.name = 'Fundstack'"
}
EOF
{
  "data": {
    "rows": [
      {
        "record_id": "bf071e1f-6035-429d-b874-d83ea64ea13b",
        "created_at": "2023-01-01T15:00:00.000000000Z",
        "name": "Fundstack",
        "created_by": {
          "type": "workspace-member",
          "id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
        },
        "domains": [
          "fundstack.com"
        ]
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

This API uses OAuth 2.0 with the authorization code grant flow.

Body

application/json
sql
string
required

The SQL query to be executed.

Example:

"SELECT * FROM companies WHERE companies.name = 'Fundstack'"

Response

Success

Success

data
object
required
Example:
{
"rows": [
{
"record_id": "bf071e1f-6035-429d-b874-d83ea64ea13b",
"created_at": "2023-01-01T15:00:00.000000000Z",
"name": "Fundstack",
"created_by": {
"type": "workspace-member",
"id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b"
},
"domains": ["fundstack.com"]
}
]
}